|
@@ -6,11 +6,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.gree.mall.manager.bean.admin.AdminCompanyPayConfigVO;
|
|
|
import com.gree.mall.manager.bean.admin.AdminUserCom;
|
|
|
import com.gree.mall.manager.commonmapper.CommonMapper;
|
|
|
+import com.gree.mall.manager.enums.admin.AdminWebsitTypeEnum;
|
|
|
import com.gree.mall.manager.exception.RemoteServiceException;
|
|
|
import com.gree.mall.manager.logic.common.CommonLogic;
|
|
|
import com.gree.mall.manager.plus.entity.AdminCompanyWechat;
|
|
|
import com.gree.mall.manager.plus.entity.AdminCompanyWechatPayConfig;
|
|
|
+import com.gree.mall.manager.plus.entity.AdminWebsit;
|
|
|
import com.gree.mall.manager.plus.service.AdminCompanyWechatPayConfigService;
|
|
|
+import com.gree.mall.manager.plus.service.AdminWebsitService;
|
|
|
import com.gree.mall.manager.zfire.bean.ZfireParamBean;
|
|
|
import com.gree.mall.manager.zfire.util.FieldUtils;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
@@ -29,6 +32,7 @@ public class AdminCompanyPayConfigLogic {
|
|
|
private final CommonMapper commonMapper;
|
|
|
private final CommonLogic commonLogic;
|
|
|
private final AdminCompanyWechatPayConfigService adminCompanyWechatPayConfigService;
|
|
|
+ private final AdminWebsitService adminWebsitService;
|
|
|
|
|
|
|
|
|
public IPage<AdminCompanyPayConfigVO> list(ZfireParamBean zfireParamBean) {
|
|
@@ -92,6 +96,27 @@ public class AdminCompanyPayConfigLogic {
|
|
|
throw new RemoteServiceException("小程序密钥不能为空");
|
|
|
}
|
|
|
|
|
|
+ if (StringUtils.isNotBlank(bean.getId())) {
|
|
|
+ final AdminCompanyWechatPayConfig old = adminCompanyWechatPayConfigService.getById(bean.getId());
|
|
|
+ if (!old.getAttr().equals(bean.getAttr())) {
|
|
|
+ // 商户属性有变动,清除网点已选的记录
|
|
|
+ if (!bean.getAttr().contains("电子支付")) {
|
|
|
+ adminWebsitService.lambdaUpdate()
|
|
|
+ .set(AdminWebsit::getPayWorkerCodeId, null)
|
|
|
+ .eq(AdminWebsit::getPayWorkerCodeId, bean.getId())
|
|
|
+ .eq(AdminWebsit::getType, AdminWebsitTypeEnum.C.getKey())
|
|
|
+ .update();
|
|
|
+ }
|
|
|
+ if (!bean.getAttr().contains("保险支付")) {
|
|
|
+ adminWebsitService.lambdaUpdate()
|
|
|
+ .set(AdminWebsit::getPayInsureCodeId, null)
|
|
|
+ .eq(AdminWebsit::getPayInsureCodeId, bean.getId())
|
|
|
+ .eq(AdminWebsit::getType, AdminWebsitTypeEnum.C.getKey())
|
|
|
+ .update();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (StringUtils.isBlank(bean.getId())) {
|
|
|
bean.setId(IdWorker.getIdStr());
|
|
|
}
|