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

[商户][修改[分账账户操作发信息]

release_toaliyun_real
gongbiao 7 лет назад
Родитель
Сommit
53ea12384e
5 измененных файлов: 49 добавлений и 1 удалений
  1. +10
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMerchantController.java
  2. +3
    -0
      mallinkService/src/main/java/com/iformall/service/WxMerchantService.java
  3. +3
    -0
      mallinkService/src/main/java/com/iformall/service/WxProfitSharingReceiverService.java
  4. +31
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java
  5. +2
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingReceiverServiceImpl.java

+ 10
- 0
mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMerchantController.java Просмотреть файл

@@ -6,6 +6,7 @@ import com.iformall.common.Result;
import com.iformall.common.ResultData;
import com.iformall.controller.base.BaseController;
import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.WxProfitSharingReceiver;
import com.iformall.domain.vo.WxMerchantVo;
import com.iformall.service.WxMerchantService;
import io.swagger.annotations.ApiImplicitParam;
@@ -187,4 +188,13 @@ public class WxMerchantController extends BaseController {
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
- 0
mallinkService/src/main/java/com/iformall/service/WxMerchantService.java Просмотреть файл

@@ -3,6 +3,7 @@ package com.iformall.service;
import com.github.pagehelper.PageInfo;
import com.iformall.common.ResultData;
import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.WxProfitSharingReceiver;
import com.iformall.domain.vo.WxMerchantSimpleVo;
import com.iformall.domain.vo.WxMerchantVo;

@@ -89,4 +90,6 @@ public interface WxMerchantService {

ResultData top(WxMerchant wxMerchant);

ResultData useAccount(WxProfitSharingReceiver wxProfitSharingReceiver);

}

+ 3
- 0
mallinkService/src/main/java/com/iformall/service/WxProfitSharingReceiverService.java Просмотреть файл

@@ -46,4 +46,7 @@ public interface WxProfitSharingReceiverService {
ResultData delReceiver(WxMerchant merchant);

ResultData updateReceiver(WxMerchant merchant, WxProfitSharingReceiver receiver);

void sendMsg(String phone, String account, String merchant, String time, Integer modelType, String tenantId);

}

+ 31
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java Просмотреть файл

@@ -15,6 +15,7 @@ import com.iformall.exception.MallinkException;
import com.iformall.mapper.*;
import com.iformall.service.*;
import com.iformall.utils.BeanMapping;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -90,6 +91,10 @@ public class WxMerchantServiceImpl implements WxMerchantService {
@Autowired
WxPropertyContractMapper wxPropertyContractMapper;

@Autowired
WxProfitSharingReceiverMapper wxProfitSharingReceiverMapper;


@Override
public PageInfo<WxMerchant> listAsPage(WxMerchant record, Integer pageIndex, Integer pageSize) {

@@ -644,4 +649,30 @@ public class WxMerchantServiceImpl implements WxMerchantService {
wxMerchantMapper.updateByPrimaryKeySelective(wxMerchant);
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, "操作成功");
}
}

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

@@ -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("商户分账账户发送短信开始");


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