| @@ -72,6 +72,18 @@ 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; | ||||
| /*分账接收方状态 0,正常 1,停用**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="分账接收方状态 0,正常 1,停用",name="status") | |||||
| private Integer status; | |||||
| public Integer getStatus() { | |||||
| return status; | |||||
| } | |||||
| public void setStatus(Integer status) { | |||||
| this.status = status; | |||||
| } | |||||
| public Long getMerchantId() { | public Long getMerchantId() { | ||||
| return merchantId; | return merchantId; | ||||
| } | } | ||||
| @@ -0,0 +1,36 @@ | |||||
| package com.simple.enums; | |||||
| /** | |||||
| * Created by Stormeye on 2018/08/09. | |||||
| */ | |||||
| public enum EnumProfitSharingReceiverStatus { | |||||
| PROFIT_SHARING_RECEIVER_STATUS_VALID(0, "正常"), | |||||
| PROFIT_SHARING_RECEIVER_STATUS_INVALID(1, "停用"), | |||||
| ; | |||||
| public static EnumProfitSharingReceiverStatus getEnum(Integer code) { | |||||
| for (EnumProfitSharingReceiverStatus value : values()) { | |||||
| if (value.getCode().equals(code)) { | |||||
| return value; | |||||
| } | |||||
| } | |||||
| return null; | |||||
| } | |||||
| private Integer code; | |||||
| private String message; | |||||
| EnumProfitSharingReceiverStatus(Integer code, String message) { | |||||
| this.code = code; | |||||
| this.message = message; | |||||
| } | |||||
| public Integer getCode() { | |||||
| return code; | |||||
| } | |||||
| public String getMessage() { | |||||
| return message; | |||||
| } | |||||
| } | |||||
| @@ -185,6 +185,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ | |||||
| WxProfitSharingReceiver wxProfitSharingReceiver = new WxProfitSharingReceiver(); | WxProfitSharingReceiver wxProfitSharingReceiver = new WxProfitSharingReceiver(); | ||||
| wxProfitSharingReceiver.setMerchantId(wxOrder.getMerchantId()); | wxProfitSharingReceiver.setMerchantId(wxOrder.getMerchantId()); | ||||
| wxProfitSharingReceiver.setSharingType(EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT.getCode()); | wxProfitSharingReceiver.setSharingType(EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT.getCode()); | ||||
| wxProfitSharingReceiver.setStatus(EnumProfitSharingReceiverStatus.PROFIT_SHARING_RECEIVER_STATUS_VALID.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) { | ||||
| throw new MallinkException(ErrorCode.PROFIT_SHARING_RECEIVER_INVALID.getCode(), ErrorCode.PROFIT_SHARING_RECEIVER_INVALID.getMessage()); | throw new MallinkException(ErrorCode.PROFIT_SHARING_RECEIVER_INVALID.getCode(), ErrorCode.PROFIT_SHARING_RECEIVER_INVALID.getMessage()); | ||||
| @@ -12,10 +12,7 @@ import com.simple.domain.po.WxAppinfo; | |||||
| import com.simple.domain.po.WxMerchant; | import com.simple.domain.po.WxMerchant; | ||||
| import com.simple.domain.po.WxPayAccount; | import com.simple.domain.po.WxPayAccount; | ||||
| import com.simple.domain.po.WxProfitSharingReceiver; | import com.simple.domain.po.WxProfitSharingReceiver; | ||||
| import com.simple.enums.EnumAppType; | |||||
| import com.simple.enums.EnumProfitSharingReceiverType; | |||||
| import com.simple.enums.EnumProfitSharingStatus; | |||||
| import com.simple.enums.EnumProfitSharingType; | |||||
| import com.simple.enums.*; | |||||
| import com.simple.mapper.WxAppinfoMapper; | import com.simple.mapper.WxAppinfoMapper; | ||||
| import com.simple.mapper.WxPayAccountMapper; | import com.simple.mapper.WxPayAccountMapper; | ||||
| import com.simple.mapper.WxProfitSharingReceiverMapper; | import com.simple.mapper.WxProfitSharingReceiverMapper; | ||||
| @@ -97,6 +94,7 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv | |||||
| receiver.setId(IdWorker.get().nextId()); | receiver.setId(IdWorker.get().nextId()); | ||||
| receiver.setCreateTime(new Date()); | receiver.setCreateTime(new Date()); | ||||
| receiver.setUpdateTime(new Date()); | receiver.setUpdateTime(new Date()); | ||||
| receiver.setStatus(EnumProfitSharingReceiverStatus.PROFIT_SHARING_RECEIVER_STATUS_VALID.getCode()); | |||||
| //passed from uplevel | //passed from uplevel | ||||
| //receiver.setReceiverAccount(receiverParam.getReceiverAccount()); | //receiver.setReceiverAccount(receiverParam.getReceiverAccount()); | ||||
| @@ -157,6 +155,7 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv | |||||
| receiver.setMerchantId(merchant.getId()); | receiver.setMerchantId(merchant.getId()); | ||||
| receiver.setSharingType(EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT.getCode()); | receiver.setSharingType(EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT.getCode()); | ||||
| receiver.setStatus(EnumProfitSharingReceiverStatus.PROFIT_SHARING_RECEIVER_STATUS_VALID.getCode()); | |||||
| //receiver.setReceiverAccount(receiverParam.getReceiverAccount()); | //receiver.setReceiverAccount(receiverParam.getReceiverAccount()); | ||||
| //receiver.setReceiverType(receiverParam.getReceiverType()); | //receiver.setReceiverType(receiverParam.getReceiverType()); | ||||
| @@ -200,8 +199,8 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv | |||||
| if (!WxPayment.verifyNotifyHMAC(returnMap,payAccount.getApiKey())){ | if (!WxPayment.verifyNotifyHMAC(returnMap,payAccount.getApiKey())){ | ||||
| return new ResultData(ErrorCode.PROFIT_SHARING_RECEIVER_DEL_FAILED.getCode(), ErrorCode.PROFIT_SHARING_RECEIVER_DEL_FAILED.getMessage()); | return new ResultData(ErrorCode.PROFIT_SHARING_RECEIVER_DEL_FAILED.getCode(), ErrorCode.PROFIT_SHARING_RECEIVER_DEL_FAILED.getMessage()); | ||||
| } | } | ||||
| wxProfitSharingReceiverMapper.deleteByPrimaryKey(receiver); | |||||
| receiver.setStatus(EnumProfitSharingReceiverStatus.PROFIT_SHARING_RECEIVER_STATUS_INVALID.getCode()); | |||||
| wxProfitSharingReceiverMapper.updateByPrimaryKeySelective(receiver); | |||||
| return new ResultData(returnMap); | return new ResultData(returnMap); | ||||
| } | } | ||||
| @@ -13,10 +13,11 @@ | |||||
| <result column="bank_no" jdbcType="VARCHAR" property="bankNo" /> | <result column="bank_no" jdbcType="VARCHAR" property="bankNo" /> | ||||
| <result column="true_name" jdbcType="VARCHAR" property="trueName" /> | <result column="true_name" jdbcType="VARCHAR" property="trueName" /> | ||||
| <result column="bank_code" jdbcType="VARCHAR" property="bankCode" /> | <result column="bank_code" jdbcType="VARCHAR" property="bankCode" /> | ||||
| <result column="status" jdbcType="INTEGER" property="status" /> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`merchant_id`,`receiver_type`,`receiver_account`,`receiver_comments`,`create_time`,`update_time`,`sharing_type`,`bank_no`,`true_name`,`bank_code` | |||||
| `id`,`merchant_id`,`receiver_type`,`receiver_account`,`receiver_comments`,`create_time`,`update_time`,`sharing_type`,`bank_no`,`true_name`,`bank_code`,`status` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -75,7 +76,13 @@ | |||||
| <if test=" null != bankCode "> | <if test=" null != bankCode "> | ||||
| and `bank_code` like concat('%', #{bankCode},'%') | and `bank_code` like concat('%', #{bankCode},'%') | ||||
| </if> | |||||
| </if> | |||||
| <if test=" null != status "> | |||||
| and `status` = #{status} | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||