Просмотр исходного кода

[支付][修改]:微信分账相关代码调整

release_toaliyun_real
hupeng 7 лет назад
Родитель
Сommit
58a8190de5
8 измененных файлов: 40 добавлений и 40 удалений
  1. +12
    -12
      mallinkService/src/main/java/com/simple/domain/po/WxProfitSharingOrder.java
  2. +3
    -3
      mallinkService/src/main/java/com/simple/domain/po/WxProfitSharingReceiver.java
  3. +6
    -6
      mallinkService/src/main/java/com/simple/domain/po/WxProfitSharingResult.java
  4. +9
    -9
      mallinkService/src/main/java/com/simple/service/impl/WxProfitSharingOrderServiceImpl.java
  5. +2
    -2
      mallinkService/src/main/java/com/simple/service/impl/WxProfitSharingReceiverServiceImpl.java
  6. +5
    -5
      mallinkService/src/main/resources/mapper/WxProfitSharingOrderMapper.xml
  7. +1
    -1
      mallinkService/src/main/resources/mapper/WxProfitSharingReceiverMapper.xml
  8. +2
    -2
      mallinkService/src/main/resources/mapper/WxProfitSharingResultMapper.xml

+ 12
- 12
mallinkService/src/main/java/com/simple/domain/po/WxProfitSharingOrder.java Просмотреть файл

@@ -47,10 +47,10 @@ public class WxProfitSharingOrder implements Serializable {
private String tenantId; private String tenantId;
/*商户ID**/ /*商户ID**/
@io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId") @io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId")
private String merchantId;
private Long merchantId;
/*订单ID**/ /*订单ID**/
@io.swagger.annotations.ApiModelProperty(value="订单ID",name="orderId") @io.swagger.annotations.ApiModelProperty(value="订单ID",name="orderId")
private String orderId;
private Long orderId;
/*分账总金额(分)**/ /*分账总金额(分)**/
@io.swagger.annotations.ApiModelProperty(value="分账总金额(分)",name="payAmount") @io.swagger.annotations.ApiModelProperty(value="分账总金额(分)",name="payAmount")
private Integer payAmount; private Integer payAmount;
@@ -65,7 +65,7 @@ public class WxProfitSharingOrder implements Serializable {
private String transactionId; private String transactionId;
/*微信生成分账单号**/ /*微信生成分账单号**/
@io.swagger.annotations.ApiModelProperty(value="微信生成分账单号",name="sharingOrderId") @io.swagger.annotations.ApiModelProperty(value="微信生成分账单号",name="sharingOrderId")
private String sharingOrderId;
private String sharingOrderNo;
/*分账申请失败原因**/ /*分账申请失败原因**/
@io.swagger.annotations.ApiModelProperty(value="分账申请失败原因",name="errorMsg") @io.swagger.annotations.ApiModelProperty(value="分账申请失败原因",name="errorMsg")
private String errorMsg; private String errorMsg;
@@ -84,16 +84,16 @@ public class WxProfitSharingOrder implements Serializable {
public void setTenantId(String _tenantId) { public void setTenantId(String _tenantId) {
tenantId = _tenantId; tenantId = _tenantId;
} }
public String getMerchantId() {
public Long getMerchantId() {
return merchantId; return merchantId;
} }
public void setMerchantId(String _merchantId) {
public void setMerchantId(Long _merchantId) {
merchantId = _merchantId; merchantId = _merchantId;
} }
public String getOrderId() {
public Long getOrderId() {
return orderId; return orderId;
} }
public void setOrderId(String _orderId) {
public void setOrderId(Long _orderId) {
orderId = _orderId; orderId = _orderId;
} }
public Integer getPayAmount() { public Integer getPayAmount() {
@@ -114,17 +114,17 @@ public class WxProfitSharingOrder implements Serializable {
public void setPayTimeStart(Date _payTimeStart) { public void setPayTimeStart(Date _payTimeStart) {
payTimeStart = _payTimeStart; payTimeStart = _payTimeStart;
} }
public String getTransactionId() {
public String getTransaction() {
return transactionId; return transactionId;
} }
public void setTransactionId(String _transactionId) { public void setTransactionId(String _transactionId) {
transactionId = _transactionId; transactionId = _transactionId;
} }
public String getSharingOrderId() {
return sharingOrderId;
public String getSharingOrderNo() {
return sharingOrderNo;
} }
public void setSharingOrderId(String _sharingOrderId) {
sharingOrderId = _sharingOrderId;
public void setSharingOrderNo(String _sharingOrderNo) {
sharingOrderNo = _sharingOrderNo;
} }
public String getErrorMsg() { public String getErrorMsg() {
return errorMsg; return errorMsg;


+ 3
- 3
mallinkService/src/main/java/com/simple/domain/po/WxProfitSharingReceiver.java Просмотреть файл

@@ -44,7 +44,7 @@ public class WxProfitSharingReceiver implements Serializable {
/*商户ID**/ /*商户ID**/
@io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId") @io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId")
private String merchantId;
private Long merchantId;
/*分账接收方类型,1 = MERCHANT_ID(商户 ID) 2 = PERSONAL_WECHATID(个人微信号) 3 = PERSONAL_OPENID(个人openid(由父商 户 APPID 转换得到) 4 = PERSONAL_SUB_OPENID(个人 sub_openid(由子商户 APPID 转换得到))**/ /*分账接收方类型,1 = MERCHANT_ID(商户 ID) 2 = PERSONAL_WECHATID(个人微信号) 3 = PERSONAL_OPENID(个人openid(由父商 户 APPID 转换得到) 4 = PERSONAL_SUB_OPENID(个人 sub_openid(由子商户 APPID 转换得到))**/
@io.swagger.annotations.ApiModelProperty(value="分账接收方类型,1 = MERCHANT_ID(商户 ID) 2 = PERSONAL_WECHATID(个人微信号) 3 = PERSONAL_OPENID(个人openid(由父商 户 APPID 转换得到) 4 = PERSONAL_SUB_OPENID(个人 sub_openid(由子商户 APPID 转换得到))",name="receiverType") @io.swagger.annotations.ApiModelProperty(value="分账接收方类型,1 = MERCHANT_ID(商户 ID) 2 = PERSONAL_WECHATID(个人微信号) 3 = PERSONAL_OPENID(个人openid(由父商 户 APPID 转换得到) 4 = PERSONAL_SUB_OPENID(个人 sub_openid(由子商户 APPID 转换得到))",name="receiverType")
private Integer receiverType; private Integer receiverType;
@@ -72,10 +72,10 @@ public class WxProfitSharingReceiver implements Serializable {
/***/ /***/
@io.swagger.annotations.ApiModelProperty(value="",name="bankCode") @io.swagger.annotations.ApiModelProperty(value="",name="bankCode")
private String bankCode; private String bankCode;
public String getMerchantId() {
public Long getMerchantId() {
return merchantId; return merchantId;
} }
public void setMerchantId(String _merchantId) {
public void setMerchantId(Long _merchantId) {
merchantId = _merchantId; merchantId = _merchantId;
} }
public Integer getReceiverType() { public Integer getReceiverType() {


+ 6
- 6
mallinkService/src/main/java/com/simple/domain/po/WxProfitSharingResult.java Просмотреть файл

@@ -44,10 +44,10 @@ public class WxProfitSharingResult implements Serializable {
/*分账订单号**/ /*分账订单号**/
@io.swagger.annotations.ApiModelProperty(value="分账订单号",name="sharingOrderId") @io.swagger.annotations.ApiModelProperty(value="分账订单号",name="sharingOrderId")
private String sharingOrderId;
private Long sharingOrderId;
/*分账接收方id**/ /*分账接收方id**/
@io.swagger.annotations.ApiModelProperty(value="分账接收方id",name="sharingReceiverId") @io.swagger.annotations.ApiModelProperty(value="分账接收方id",name="sharingReceiverId")
private String sharingReceiverId;
private Long sharingReceiverId;
/*分账金额(分)**/ /*分账金额(分)**/
@io.swagger.annotations.ApiModelProperty(value="分账金额(分)",name="payAmount") @io.swagger.annotations.ApiModelProperty(value="分账金额(分)",name="payAmount")
private Integer payAmount; private Integer payAmount;
@@ -66,16 +66,16 @@ public class WxProfitSharingResult implements Serializable {
/*微信返回的失败原因**/ /*微信返回的失败原因**/
@io.swagger.annotations.ApiModelProperty(value="微信返回的失败原因",name="failedReason") @io.swagger.annotations.ApiModelProperty(value="微信返回的失败原因",name="failedReason")
private String failedReason; private String failedReason;
public String getSharingOrderId() {
public Long getSharingOrderId() {
return sharingOrderId; return sharingOrderId;
} }
public void setSharingOrderId(String _sharingOrderId) {
public void setSharingOrderId(Long _sharingOrderId) {
sharingOrderId = _sharingOrderId; sharingOrderId = _sharingOrderId;
} }
public String getSharingReceiverId() {
public Long getSharingReceiverId() {
return sharingReceiverId; return sharingReceiverId;
} }
public void setSharingReceiverId(String _sharingReceiverId) {
public void setSharingReceiverId(Long _sharingReceiverId) {
sharingReceiverId = _sharingReceiverId; sharingReceiverId = _sharingReceiverId;
} }
public Integer getPayAmount() { public Integer getPayAmount() {


+ 9
- 9
mallinkService/src/main/java/com/simple/service/impl/WxProfitSharingOrderServiceImpl.java Просмотреть файл

@@ -151,7 +151,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ


//是否已创建分账订单 //是否已创建分账订单
WxProfitSharingOrder record = new WxProfitSharingOrder(); WxProfitSharingOrder record = new WxProfitSharingOrder();
record.setOrderId(wxPayOrder.getId().toString());
record.setOrderId(wxPayOrder.getId());
record = wxProfitSharingOrderMapper.selectOne(record); record = wxProfitSharingOrderMapper.selectOne(record);
if (record == null) { if (record == null) {
//创建分账订单 //创建分账订单
@@ -160,9 +160,9 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ
record.setId(idworker.nextId()); record.setId(idworker.nextId());
record.setTenantId(wxPayOrder.getTenantId()); record.setTenantId(wxPayOrder.getTenantId());
record.setTransactionId(wxPayOrder.getTransactionId()); record.setTransactionId(wxPayOrder.getTransactionId());
record.setOrderId(wxPayOrder.getId().toString());
record.setOrderId(wxPayOrder.getId());
record.setPayAmount(wxPayOrder.getPayAmount()); record.setPayAmount(wxPayOrder.getPayAmount());
record.setMerchantId(wxOrder.getMerchantId().toString());
record.setMerchantId(wxOrder.getMerchantId());
record.setCreateTime(currentDate); record.setCreateTime(currentDate);
record.setUpdateTime(currentDate); record.setUpdateTime(currentDate);
record.setPayTimeStart(currentDate); record.setPayTimeStart(currentDate);
@@ -185,7 +185,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ


//添加分账接受方 //添加分账接受方
WxProfitSharingReceiver wxProfitSharingReceiver = new WxProfitSharingReceiver(); WxProfitSharingReceiver wxProfitSharingReceiver = new WxProfitSharingReceiver();
wxProfitSharingReceiver.setMerchantId(wxOrder.getMerchantId().toString());
wxProfitSharingReceiver.setMerchantId(wxOrder.getMerchantId());
wxProfitSharingReceiver.setSharingType(EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT.getCode()); wxProfitSharingReceiver.setSharingType(EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT.getCode());
List<WxProfitSharingReceiver> wxProfitSharingReceiverList = wxProfitSharingReceiverMapper.findList(wxProfitSharingReceiver); List<WxProfitSharingReceiver> wxProfitSharingReceiverList = wxProfitSharingReceiverMapper.findList(wxProfitSharingReceiver);
if (wxProfitSharingReceiverList.size()<=0 || wxProfitSharingReceiverList.size() > 50) { if (wxProfitSharingReceiverList.size()<=0 || wxProfitSharingReceiverList.size() > 50) {
@@ -206,8 +206,8 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ
WxProfitSharingResult result = new WxProfitSharingResult(); WxProfitSharingResult result = new WxProfitSharingResult();


result.setId(idworker.nextId()); result.setId(idworker.nextId());
result.setSharingOrderId(record.getSharingOrderId());
result.setSharingReceiverId(receiver.getId().toString());
result.setSharingOrderId(record.getId());
result.setSharingReceiverId(receiver.getId());
result.setCreateTime(currentDate); result.setCreateTime(currentDate);
result.setUpdateTime(currentDate); result.setUpdateTime(currentDate);
resultList.add(result); resultList.add(result);
@@ -239,7 +239,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ
return new ResultData(ErrorCode.PROFIT_SHARING_APPLY_FAILED.getCode(), returnMap.get("result_msg")); return new ResultData(ErrorCode.PROFIT_SHARING_APPLY_FAILED.getCode(), returnMap.get("result_msg"));
} }


record.setSharingOrderId(returnMap.get("order_id"));
record.setSharingOrderNo(returnMap.get("order_id"));
record.setSharingStatus(EnumProfitSharingStatus.PROFIT_SHARING_ACCEPTED.getCode()); record.setSharingStatus(EnumProfitSharingStatus.PROFIT_SHARING_ACCEPTED.getCode());
record.setUpdateTime(new Date()); record.setUpdateTime(new Date());
wxProfitSharingOrderMapper.updateByPrimaryKey(record); wxProfitSharingOrderMapper.updateByPrimaryKey(record);
@@ -263,7 +263,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ
WxOrder wxOrder = wxOrderMapper.selectByPrimaryKey(wxPayOrder.getOrderId()); WxOrder wxOrder = wxOrderMapper.selectByPrimaryKey(wxPayOrder.getOrderId());


//是否已创建分账订单 //是否已创建分账订单
record.setOrderId(wxPayOrder.getId().toString());
record.setOrderId(wxPayOrder.getId());
record = wxProfitSharingOrderMapper.selectOne(record); record = wxProfitSharingOrderMapper.selectOne(record);
if (record == null) if (record == null)
throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND.getCode(), ErrorCode.ORDER_IS_NOT_FIND.getMessage()); throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND.getCode(), ErrorCode.ORDER_IS_NOT_FIND.getMessage());
@@ -308,7 +308,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ
JSONArray jReceivers = JSONArray.parseArray(receivers); JSONArray jReceivers = JSONArray.parseArray(receivers);


WxProfitSharingResult result = new WxProfitSharingResult(); WxProfitSharingResult result = new WxProfitSharingResult();
result.setSharingOrderId(record.getId().toString());
result.setSharingOrderId(record.getId());
List <WxProfitSharingResult> wxProfitSharingResultList = wxProfitSharingResultMapper.findList(result); List <WxProfitSharingResult> wxProfitSharingResultList = wxProfitSharingResultMapper.findList(result);






+ 2
- 2
mallinkService/src/main/java/com/simple/service/impl/WxProfitSharingReceiverServiceImpl.java Просмотреть файл

@@ -96,7 +96,7 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv




WxProfitSharingReceiver receiver = new WxProfitSharingReceiver(); WxProfitSharingReceiver receiver = new WxProfitSharingReceiver();
receiver.setMerchantId(merchant.getId().toString());
receiver.setMerchantId(merchant.getId());
receiver.setSharingType(EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT.getCode()); receiver.setSharingType(EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT.getCode());
receiver.setId(IdWorker.get().nextId()); receiver.setId(IdWorker.get().nextId());
receiver.setCreateTime(new Date()); receiver.setCreateTime(new Date());
@@ -162,7 +162,7 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv




WxProfitSharingReceiver receiver = new WxProfitSharingReceiver(); WxProfitSharingReceiver receiver = new WxProfitSharingReceiver();
receiver.setMerchantId(merchant.getId().toString());
receiver.setMerchantId(merchant.getId());
receiver.setSharingType(EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT.getCode()); receiver.setSharingType(EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT.getCode());
//receiver.setReceiverAccount(merchant.getReceiverAccount().toString()); //receiver.setReceiverAccount(merchant.getReceiverAccount().toString());
receiver.setReceiverType(EnumProfitSharingReceiverType.PROFIT_SHARING_RECEIVER_MERCHANT_ID.getCode()); receiver.setReceiverType(EnumProfitSharingReceiverType.PROFIT_SHARING_RECEIVER_MERCHANT_ID.getCode());


+ 5
- 5
mallinkService/src/main/resources/mapper/WxProfitSharingOrderMapper.xml Просмотреть файл

@@ -4,13 +4,13 @@
<resultMap id="BaseResultMap" type="com.simple.domain.po.WxProfitSharingOrder"> <resultMap id="BaseResultMap" type="com.simple.domain.po.WxProfitSharingOrder">
<id column="id" jdbcType="BIGINT" property="id" /> <id column="id" jdbcType="BIGINT" property="id" />
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="merchant_id" jdbcType="VARCHAR" property="merchantId" />
<result column="order_id" jdbcType="VARCHAR" property="orderId" />
<result column="merchant_id" jdbcType="BIGINT" property="merchantId" />
<result column="order_id" jdbcType="BIGINT" property="orderId" />
<result column="pay_amount" jdbcType="INTEGER" property="payAmount" /> <result column="pay_amount" jdbcType="INTEGER" property="payAmount" />
<result column="pay_time_end" jdbcType="TIMESTAMP" property="payTimeEnd" /> <result column="pay_time_end" jdbcType="TIMESTAMP" property="payTimeEnd" />
<result column="pay_time_start" jdbcType="TIMESTAMP" property="payTimeStart" /> <result column="pay_time_start" jdbcType="TIMESTAMP" property="payTimeStart" />
<result column="transaction_id" jdbcType="VARCHAR" property="transactionId" /> <result column="transaction_id" jdbcType="VARCHAR" property="transactionId" />
<result column="sharing_order_id" jdbcType="VARCHAR" property="sharingOrderId" />
<result column="sharing_order_no" jdbcType="VARCHAR" property="sharingOrderId" />
<result column="error_msg" jdbcType="VARCHAR" property="errorMsg" /> <result column="error_msg" jdbcType="VARCHAR" property="errorMsg" />
<result column="sharing_status" jdbcType="INTEGER" property="sharingStatus" /> <result column="sharing_status" jdbcType="INTEGER" property="sharingStatus" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
@@ -18,7 +18,7 @@
</resultMap> </resultMap>
<sql id="allColumns"> <sql id="allColumns">
`id`,`tenant_id`,`merchant_id`,`order_id`,`pay_amount`,`pay_time_end`,`pay_time_start`,`transaction_id`,`sharing_order_id`,`error_msg`,`sharing_status`,`update_time`,`create_time`
`id`,`tenant_id`,`merchant_id`,`order_id`,`pay_amount`,`pay_time_end`,`pay_time_start`,`transaction_id`,`sharing_order_no`,`error_msg`,`sharing_status`,`update_time`,`create_time`
</sql> </sql>


<sql id="dynamicWhereConditions"> <sql id="dynamicWhereConditions">
@@ -64,7 +64,7 @@
</if> </if>
<if test=" null != sharingOrderId ">
<if test=" null != sharingOrderNo ">
and `sharing_order_id` like concat('%', #{sharingOrderId},'%') and `sharing_order_id` like concat('%', #{sharingOrderId},'%')
</if> </if>


+ 1
- 1
mallinkService/src/main/resources/mapper/WxProfitSharingReceiverMapper.xml Просмотреть файл

@@ -3,7 +3,7 @@
<mapper namespace="com.simple.mapper.WxProfitSharingReceiverMapper"> <mapper namespace="com.simple.mapper.WxProfitSharingReceiverMapper">
<resultMap id="BaseResultMap" type="com.simple.domain.po.WxProfitSharingReceiver"> <resultMap id="BaseResultMap" type="com.simple.domain.po.WxProfitSharingReceiver">
<id column="id" jdbcType="BIGINT" property="id" /> <id column="id" jdbcType="BIGINT" property="id" />
<result column="merchant_id" jdbcType="VARCHAR" property="merchantId" />
<result column="merchant_id" jdbcType="BIGINT" property="merchantId" />
<result column="receiver_type" jdbcType="INTEGER" property="receiverType" /> <result column="receiver_type" jdbcType="INTEGER" property="receiverType" />
<result column="receiver_account" jdbcType="VARCHAR" property="receiverAccount" /> <result column="receiver_account" jdbcType="VARCHAR" property="receiverAccount" />
<result column="receiver_comments" jdbcType="VARCHAR" property="receiverComments" /> <result column="receiver_comments" jdbcType="VARCHAR" property="receiverComments" />


+ 2
- 2
mallinkService/src/main/resources/mapper/WxProfitSharingResultMapper.xml Просмотреть файл

@@ -3,8 +3,8 @@
<mapper namespace="com.simple.mapper.WxProfitSharingResultMapper"> <mapper namespace="com.simple.mapper.WxProfitSharingResultMapper">
<resultMap id="BaseResultMap" type="com.simple.domain.po.WxProfitSharingResult"> <resultMap id="BaseResultMap" type="com.simple.domain.po.WxProfitSharingResult">
<id column="id" jdbcType="BIGINT" property="id" /> <id column="id" jdbcType="BIGINT" property="id" />
<result column="sharing_order_id" jdbcType="VARCHAR" property="sharingOrderId" />
<result column="sharing_receiver_id" jdbcType="VARCHAR" property="sharingReceiverId" />
<result column="sharing_order_id" jdbcType="BIGINT" property="sharingOrderId" />
<result column="sharing_receiver_id" jdbcType="BIGINT" property="sharingReceiverId" />
<result column="pay_amount" jdbcType="INTEGER" property="payAmount" /> <result column="pay_amount" jdbcType="INTEGER" property="payAmount" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />


Загрузка…
Отмена
Сохранить