diff --git a/jsowell-admin/src/main/java/com/jsowell/api/uniapp/customer/JumpController.java b/jsowell-admin/src/main/java/com/jsowell/api/uniapp/customer/JumpController.java index 33478e00e..1b72825c7 100644 --- a/jsowell-admin/src/main/java/com/jsowell/api/uniapp/customer/JumpController.java +++ b/jsowell-admin/src/main/java/com/jsowell/api/uniapp/customer/JumpController.java @@ -84,6 +84,39 @@ public class JumpController extends BaseController { return response; } + /** + * 查询充电桩详情 + */ + @GetMapping("/pile/pileDetail/{pileSn}/{connectorCode}") + public RestApiResponse getPileDetailV2(HttpServletRequest request, @PathVariable("pileSn") String pileSn + , @PathVariable("connectorCode") String connectorCode) { + // logger.info("app-xcx-h5查询充电桩详情 param:{}", pileSn); + logger.debug("User-Agent:{}", request.getHeader("user-agent")); + RestApiResponse response = null; + try { + // 如果对接了类似华为平台的第三方平台,先修改一下枪口状态 + updateThirdPartyConnectorStatus(pileSn); + }catch (Exception e) { + logger.error("修改第三方平台枪口状态 error", e); + } + + try { + // 进入充电桩详情做一下鉴权 + String memberId = getMemberIdByAuthorization(request); + AppletPileDetailVO vo = pileService.getPileDetailByPileSn(pileSn); + addMember2MemberGroup(memberId, vo); + response = new RestApiResponse<>(vo); + } catch (BusinessException e) { + logger.warn("app-xcx-h5查询充电桩详情 warn", e); + response = new RestApiResponse<>(e.getCode(), e.getMessage()); + } catch (Exception e) { + logger.error("app-xcx-h5查询充电桩详情 error", e); + response = new RestApiResponse<>(ReturnCodeEnum.CODE_GET_PILE_DETAIL_ERROR); + } + logger.info("app-xcx-h5查询充电桩详情 param:{}, result:{}", pileSn, JSON.toJSONString(response)); + return response; + } + // 针对汇鑫大厦的用户,自动加入集团中 private void addMember2MemberGroup(String memberId, AppletPileDetailVO vo) { if (vo == null || StringUtils.isBlank(memberId)) { diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/domain/OrderSplitInfo.java b/jsowell-pile/src/main/java/com/jsowell/pile/domain/OrderSplitInfo.java new file mode 100644 index 000000000..b4de0842a --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/domain/OrderSplitInfo.java @@ -0,0 +1,87 @@ +package com.jsowell.pile.domain; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; +import lombok.experimental.SuperBuilder; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 订单分账信息表 + */ +@Data +@Accessors(chain = true) +@SuperBuilder +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class OrderSplitInfo { + /** + * 主键 + */ + private Integer id; + + /** + * 订单编号 + */ + private String orderCode; + + /** + * 订单结算金额(总金额) + */ + private BigDecimal settleAmount; + + /** + * 汇付用户id + */ + private String adapayMemberId; + + /** + * 分润比例 + */ + private BigDecimal shareRatio; + + /** + * 分润金额 + */ + private BigDecimal shareAmount; + + /** + * 分账状态 + */ + private String status; + + /** + * 备注 + */ + private String remark; + + /** + * 创建人 + */ + private String cerateBy; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新人 + */ + private String updateBy; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 删除标识(0-正常; 1-删除) + */ + private String delFlag; +} \ No newline at end of file diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/OrderSplitInfoMapper.java b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/OrderSplitInfoMapper.java new file mode 100644 index 000000000..20224c781 --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/OrderSplitInfoMapper.java @@ -0,0 +1,30 @@ +package com.jsowell.pile.mapper; + +import com.jsowell.pile.domain.OrderSplitInfo; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface OrderSplitInfoMapper { + int deleteByPrimaryKey(Integer id); + + int insert(OrderSplitInfo record); + + int insertOrUpdate(OrderSplitInfo record); + + int insertOrUpdateSelective(OrderSplitInfo record); + + int insertSelective(OrderSplitInfo record); + + OrderSplitInfo selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(OrderSplitInfo record); + + int updateByPrimaryKey(OrderSplitInfo record); + + int updateBatch(List list); + + int updateBatchSelective(List list); + + int batchInsert(@Param("list") List list); +} \ No newline at end of file diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/OrderSplitInfoService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/OrderSplitInfoService.java new file mode 100644 index 000000000..f8eac8169 --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/OrderSplitInfoService.java @@ -0,0 +1,31 @@ +package com.jsowell.pile.service; + +import com.jsowell.pile.domain.OrderSplitInfo; + +import java.util.List; +public interface OrderSplitInfoService{ + + + int deleteByPrimaryKey(Integer id); + + int insert(OrderSplitInfo record); + + int insertOrUpdate(OrderSplitInfo record); + + int insertOrUpdateSelective(OrderSplitInfo record); + + int insertSelective(OrderSplitInfo record); + + OrderSplitInfo selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(OrderSplitInfo record); + + int updateByPrimaryKey(OrderSplitInfo record); + + int updateBatch(List list); + + int updateBatchSelective(List list); + + int batchInsert(List list); + +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderSplitInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderSplitInfoServiceImpl.java new file mode 100644 index 000000000..58d56a375 --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderSplitInfoServiceImpl.java @@ -0,0 +1,71 @@ +package com.jsowell.pile.service.impl; + +import com.jsowell.pile.domain.OrderSplitInfo; +import com.jsowell.pile.mapper.OrderSplitInfoMapper; +import com.jsowell.pile.service.OrderSplitInfoService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +@Service +public class OrderSplitInfoServiceImpl implements OrderSplitInfoService{ + + @Resource + private OrderSplitInfoMapper orderSplitInfoMapper; + + @Override + public int deleteByPrimaryKey(Integer id) { + return orderSplitInfoMapper.deleteByPrimaryKey(id); + } + + @Override + public int insert(OrderSplitInfo record) { + return orderSplitInfoMapper.insert(record); + } + + @Override + public int insertOrUpdate(OrderSplitInfo record) { + return orderSplitInfoMapper.insertOrUpdate(record); + } + + @Override + public int insertOrUpdateSelective(OrderSplitInfo record) { + return orderSplitInfoMapper.insertOrUpdateSelective(record); + } + + @Override + public int insertSelective(OrderSplitInfo record) { + return orderSplitInfoMapper.insertSelective(record); + } + + @Override + public OrderSplitInfo selectByPrimaryKey(Integer id) { + return orderSplitInfoMapper.selectByPrimaryKey(id); + } + + @Override + public int updateByPrimaryKeySelective(OrderSplitInfo record) { + return orderSplitInfoMapper.updateByPrimaryKeySelective(record); + } + + @Override + public int updateByPrimaryKey(OrderSplitInfo record) { + return orderSplitInfoMapper.updateByPrimaryKey(record); + } + + @Override + public int updateBatch(List list) { + return orderSplitInfoMapper.updateBatch(list); + } + + @Override + public int updateBatchSelective(List list) { + return orderSplitInfoMapper.updateBatchSelective(list); + } + + @Override + public int batchInsert(List list) { + return orderSplitInfoMapper.batchInsert(list); + } + +} diff --git a/jsowell-pile/src/main/resources/mapper/pile/OrderSplitInfoMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/OrderSplitInfoMapper.xml new file mode 100644 index 000000000..889d2fd62 --- /dev/null +++ b/jsowell-pile/src/main/resources/mapper/pile/OrderSplitInfoMapper.xml @@ -0,0 +1,530 @@ + + + + + + + + + + + + + + + + + + + + + + + id, order_code, settle_amount, adapay_member_id, share_ratio, share_amount, `status`, + remark, cerate_by, create_time, update_by, update_time, del_flag + + + + + delete from order_split_info + where id = #{id,jdbcType=INTEGER} + + + + insert into order_split_info (id, order_code, settle_amount, + adapay_member_id, share_ratio, share_amount, + `status`, remark, cerate_by, + create_time, update_by, update_time, + del_flag) + values (#{id,jdbcType=INTEGER}, #{orderCode,jdbcType=VARCHAR}, #{settleAmount,jdbcType=DECIMAL}, + #{adapayMemberId,jdbcType=VARCHAR}, #{shareRatio,jdbcType=DECIMAL}, #{shareAmount,jdbcType=DECIMAL}, + #{status,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{cerateBy,jdbcType=VARCHAR}, + #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, + #{delFlag,jdbcType=VARCHAR}) + + + + insert into order_split_info + + + id, + + + order_code, + + + settle_amount, + + + adapay_member_id, + + + share_ratio, + + + share_amount, + + + `status`, + + + remark, + + + cerate_by, + + + create_time, + + + update_by, + + + update_time, + + + del_flag, + + + + + #{id,jdbcType=INTEGER}, + + + #{orderCode,jdbcType=VARCHAR}, + + + #{settleAmount,jdbcType=DECIMAL}, + + + #{adapayMemberId,jdbcType=VARCHAR}, + + + #{shareRatio,jdbcType=DECIMAL}, + + + #{shareAmount,jdbcType=DECIMAL}, + + + #{status,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + #{cerateBy,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateBy,jdbcType=VARCHAR}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + #{delFlag,jdbcType=VARCHAR}, + + + + + + update order_split_info + + + order_code = #{orderCode,jdbcType=VARCHAR}, + + + settle_amount = #{settleAmount,jdbcType=DECIMAL}, + + + adapay_member_id = #{adapayMemberId,jdbcType=VARCHAR}, + + + share_ratio = #{shareRatio,jdbcType=DECIMAL}, + + + share_amount = #{shareAmount,jdbcType=DECIMAL}, + + + `status` = #{status,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + cerate_by = #{cerateBy,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + update_by = #{updateBy,jdbcType=VARCHAR}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + del_flag = #{delFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + + update order_split_info + set order_code = #{orderCode,jdbcType=VARCHAR}, + settle_amount = #{settleAmount,jdbcType=DECIMAL}, + adapay_member_id = #{adapayMemberId,jdbcType=VARCHAR}, + share_ratio = #{shareRatio,jdbcType=DECIMAL}, + share_amount = #{shareAmount,jdbcType=DECIMAL}, + `status` = #{status,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + cerate_by = #{cerateBy,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_by = #{updateBy,jdbcType=VARCHAR}, + update_time = #{updateTime,jdbcType=TIMESTAMP}, + del_flag = #{delFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + + + update order_split_info + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.orderCode,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.settleAmount,jdbcType=DECIMAL} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.adapayMemberId,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.shareRatio,jdbcType=DECIMAL} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.shareAmount,jdbcType=DECIMAL} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.status,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.remark,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.cerateBy,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.delFlag,jdbcType=VARCHAR} + + + + where id in + + #{item.id,jdbcType=INTEGER} + + + + + update order_split_info + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.orderCode,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.settleAmount,jdbcType=DECIMAL} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.adapayMemberId,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.shareRatio,jdbcType=DECIMAL} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.shareAmount,jdbcType=DECIMAL} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.status,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.remark,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.cerateBy,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.delFlag,jdbcType=VARCHAR} + + + + + where id in + + #{item.id,jdbcType=INTEGER} + + + + + insert into order_split_info + (id, order_code, settle_amount, adapay_member_id, share_ratio, share_amount, `status`, + remark, cerate_by, create_time, update_by, update_time, del_flag) + values + + (#{item.id,jdbcType=INTEGER}, #{item.orderCode,jdbcType=VARCHAR}, #{item.settleAmount,jdbcType=DECIMAL}, + #{item.adapayMemberId,jdbcType=VARCHAR}, #{item.shareRatio,jdbcType=DECIMAL}, #{item.shareAmount,jdbcType=DECIMAL}, + #{item.status,jdbcType=VARCHAR}, #{item.remark,jdbcType=VARCHAR}, #{item.cerateBy,jdbcType=VARCHAR}, + #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, + #{item.delFlag,jdbcType=VARCHAR}) + + + + + insert into order_split_info + (id, order_code, settle_amount, adapay_member_id, share_ratio, share_amount, `status`, + remark, cerate_by, create_time, update_by, update_time, del_flag) + values + (#{id,jdbcType=INTEGER}, #{orderCode,jdbcType=VARCHAR}, #{settleAmount,jdbcType=DECIMAL}, + #{adapayMemberId,jdbcType=VARCHAR}, #{shareRatio,jdbcType=DECIMAL}, #{shareAmount,jdbcType=DECIMAL}, + #{status,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{cerateBy,jdbcType=VARCHAR}, + #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, + #{delFlag,jdbcType=VARCHAR}) + on duplicate key update + id = #{id,jdbcType=INTEGER}, + order_code = #{orderCode,jdbcType=VARCHAR}, + settle_amount = #{settleAmount,jdbcType=DECIMAL}, + adapay_member_id = #{adapayMemberId,jdbcType=VARCHAR}, + share_ratio = #{shareRatio,jdbcType=DECIMAL}, + share_amount = #{shareAmount,jdbcType=DECIMAL}, + `status` = #{status,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + cerate_by = #{cerateBy,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_by = #{updateBy,jdbcType=VARCHAR}, + update_time = #{updateTime,jdbcType=TIMESTAMP}, + del_flag = #{delFlag,jdbcType=VARCHAR} + + + + insert into order_split_info + + + id, + + + order_code, + + + settle_amount, + + + adapay_member_id, + + + share_ratio, + + + share_amount, + + + `status`, + + + remark, + + + cerate_by, + + + create_time, + + + update_by, + + + update_time, + + + del_flag, + + + values + + + #{id,jdbcType=INTEGER}, + + + #{orderCode,jdbcType=VARCHAR}, + + + #{settleAmount,jdbcType=DECIMAL}, + + + #{adapayMemberId,jdbcType=VARCHAR}, + + + #{shareRatio,jdbcType=DECIMAL}, + + + #{shareAmount,jdbcType=DECIMAL}, + + + #{status,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + #{cerateBy,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateBy,jdbcType=VARCHAR}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + #{delFlag,jdbcType=VARCHAR}, + + + on duplicate key update + + + id = #{id,jdbcType=INTEGER}, + + + order_code = #{orderCode,jdbcType=VARCHAR}, + + + settle_amount = #{settleAmount,jdbcType=DECIMAL}, + + + adapay_member_id = #{adapayMemberId,jdbcType=VARCHAR}, + + + share_ratio = #{shareRatio,jdbcType=DECIMAL}, + + + share_amount = #{shareAmount,jdbcType=DECIMAL}, + + + `status` = #{status,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + cerate_by = #{cerateBy,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + update_by = #{updateBy,jdbcType=VARCHAR}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + del_flag = #{delFlag,jdbcType=VARCHAR}, + + + + \ No newline at end of file