| @@ -6,6 +6,7 @@ import com.iformall.common.Result; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.po.WxProfitSharingReceiver; | |||||
| import com.iformall.domain.vo.WxMerchantVo; | import com.iformall.domain.vo.WxMerchantVo; | ||||
| import com.iformall.service.WxMerchantService; | import com.iformall.service.WxMerchantService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| @@ -187,4 +188,13 @@ public class WxMerchantController extends BaseController { | |||||
| return wxMerchantService.top(wxMerchant); | return wxMerchantService.top(wxMerchant); | ||||
| } | } | ||||
| @ApiOperation("更新收款账户状态") | |||||
| @PostMapping("useAccount") | |||||
| @SystemControllerLog(description = "商户-更新收款账户状态") | |||||
| public ResultData useAccount(@RequestBody WxProfitSharingReceiver wxProfitSharingReceiver) { | |||||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::useAccount"); | |||||
| wxProfitSharingReceiver.setTenantId(getTenantId()); | |||||
| return wxMerchantService.useAccount(wxProfitSharingReceiver); | |||||
| } | |||||
| } | } | ||||
| @@ -3,6 +3,7 @@ package com.iformall.service; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.po.WxProfitSharingReceiver; | |||||
| import com.iformall.domain.vo.WxMerchantSimpleVo; | import com.iformall.domain.vo.WxMerchantSimpleVo; | ||||
| import com.iformall.domain.vo.WxMerchantVo; | import com.iformall.domain.vo.WxMerchantVo; | ||||
| @@ -89,4 +90,6 @@ public interface WxMerchantService { | |||||
| ResultData top(WxMerchant wxMerchant); | ResultData top(WxMerchant wxMerchant); | ||||
| ResultData useAccount(WxProfitSharingReceiver wxProfitSharingReceiver); | |||||
| } | } | ||||
| @@ -46,4 +46,7 @@ public interface WxProfitSharingReceiverService { | |||||
| ResultData delReceiver(WxMerchant merchant); | ResultData delReceiver(WxMerchant merchant); | ||||
| ResultData updateReceiver(WxMerchant merchant, WxProfitSharingReceiver receiver); | ResultData updateReceiver(WxMerchant merchant, WxProfitSharingReceiver receiver); | ||||
| void sendMsg(String phone, String account, String merchant, String time, Integer modelType, String tenantId); | |||||
| } | } | ||||
| @@ -15,6 +15,7 @@ import com.iformall.exception.MallinkException; | |||||
| import com.iformall.mapper.*; | import com.iformall.mapper.*; | ||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.utils.BeanMapping; | import com.iformall.utils.BeanMapping; | ||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -90,6 +91,10 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| @Autowired | @Autowired | ||||
| WxPropertyContractMapper wxPropertyContractMapper; | WxPropertyContractMapper wxPropertyContractMapper; | ||||
| @Autowired | |||||
| WxProfitSharingReceiverMapper wxProfitSharingReceiverMapper; | |||||
| @Override | @Override | ||||
| public PageInfo<WxMerchant> listAsPage(WxMerchant record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxMerchant> listAsPage(WxMerchant record, Integer pageIndex, Integer pageSize) { | ||||
| @@ -644,4 +649,30 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| wxMerchantMapper.updateByPrimaryKeySelective(wxMerchant); | wxMerchantMapper.updateByPrimaryKeySelective(wxMerchant); | ||||
| return new ResultData(Result.SUCCESS, "操作成功"); | return new ResultData(Result.SUCCESS, "操作成功"); | ||||
| } | } | ||||
| @Override | |||||
| public ResultData useAccount(WxProfitSharingReceiver wxProfitSharingReceiver) { | |||||
| WxProfitSharingReceiver profitSharingReceiver = wxProfitSharingReceiverMapper.selectByPrimaryKey(wxProfitSharingReceiver.getId()); | |||||
| profitSharingReceiver.setIsUse(wxProfitSharingReceiver.getIsUse()); | |||||
| profitSharingReceiver.setUpdateTime(new Date()); | |||||
| wxProfitSharingReceiverMapper.updateByPrimaryKeySelective(profitSharingReceiver); | |||||
| Long merchantId = profitSharingReceiver.getMerchantId(); | |||||
| String accout = profitSharingReceiver.getReceiverAccount(); | |||||
| WxMerchant wxMerchant = wxMerchantMapper.selectByPrimaryKey(merchantId); | |||||
| String linkPhone = wxMerchant.getLinkPhone(); | |||||
| String merchantName = wxMerchant.getName(); | |||||
| String tenantId = wxProfitSharingReceiver.getTenantId(); | |||||
| if (StringUtils.isEmpty(linkPhone)) { | |||||
| return new ResultData(Result.SUCCESS, "操作成功"); | |||||
| } | |||||
| //发信息 | |||||
| Integer isUse = wxProfitSharingReceiver.getIsUse(); | |||||
| Integer type = EnumMsgModel.ACCEPT_SHARING_ACCOUNT_NOTIFY_MANAGER.getCode(); | |||||
| if (isUse.equals(EnumProfitSharingUse.NO.getCode())) { | |||||
| type = EnumMsgModel.ACCEPT_SHARING_ACCOUNT_NOTIFY_MANAGER.getCode(); | |||||
| } | |||||
| wxProfitSharingReceiverService.sendMsg(linkPhone, accout, merchantName, null, type, tenantId); | |||||
| return new ResultData(Result.SUCCESS, "操作成功"); | |||||
| } | |||||
| } | } | ||||
| @@ -215,7 +215,8 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv | |||||
| } | } | ||||
| } | } | ||||
| private void sendMsg(String phone, String account, String merchant, String time, Integer modelType, String tenantId) { | |||||
| @Override | |||||
| public void sendMsg(String phone, String account, String merchant, String time, Integer modelType, String tenantId) { | |||||
| // 发送短信 | // 发送短信 | ||||
| logger.info("》》》》》》》》》》》"); | logger.info("》》》》》》》》》》》"); | ||||
| logger.info("商户分账账户发送短信开始"); | logger.info("商户分账账户发送短信开始"); | ||||