|
@@ -26,7 +26,9 @@ import com.sckw.payment.request.KwpBizWalletQueryRequest;
|
|
|
import com.sckw.payment.request.KwpBizWalletSaveRequest;
|
|
import com.sckw.payment.request.KwpBizWalletSaveRequest;
|
|
|
import com.sckw.system.api.RemoteSystemService;
|
|
import com.sckw.system.api.RemoteSystemService;
|
|
|
import com.sckw.system.api.model.dto.res.EntCacheResDto;
|
|
import com.sckw.system.api.model.dto.res.EntCacheResDto;
|
|
|
|
|
+import com.sckw.system.api.model.dto.res.EntTypeResDto;
|
|
|
import com.sckw.system.api.model.dto.res.KwsEntDeptDto;
|
|
import com.sckw.system.api.model.dto.res.KwsEntDeptDto;
|
|
|
|
|
+import com.sckw.system.api.model.dto.res.KwsEnterpriseResDto;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -252,11 +254,11 @@ public class KwpBizWalletService {
|
|
|
if (entId == null) {
|
|
if (entId == null) {
|
|
|
return "";
|
|
return "";
|
|
|
}
|
|
}
|
|
|
- EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(entId);
|
|
|
|
|
- if (entCacheResDto == null) {
|
|
|
|
|
|
|
+ KwsEnterpriseResDto enterpriseResDto= remoteSystemService.queryEnterpriseByEntId(entId);
|
|
|
|
|
+ if (enterpriseResDto == null) {
|
|
|
return "";
|
|
return "";
|
|
|
}
|
|
}
|
|
|
- return entCacheResDto.getFirmName();
|
|
|
|
|
|
|
+ return enterpriseResDto.getFirmName();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -271,19 +273,31 @@ public class KwpBizWalletService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//查询当前登录企业
|
|
//查询当前登录企业
|
|
|
- EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(LoginUserHolder.getEntId());
|
|
|
|
|
- if (entCacheResDto == null) {
|
|
|
|
|
|
|
+ EntTypeResDto entTypeResDto = remoteSystemService.queryEntTypeById(LoginUserHolder.getEntId());
|
|
|
|
|
+ if (entTypeResDto == null) {
|
|
|
throw new RuntimeException("entId:" + LoginUserHolder.getEntId() + ", 企业信息不存在!");
|
|
throw new RuntimeException("entId:" + LoginUserHolder.getEntId() + ", 企业信息不存在!");
|
|
|
}
|
|
}
|
|
|
//校验
|
|
//校验
|
|
|
- int entType = Integer.parseInt(entCacheResDto.getEntTypes());
|
|
|
|
|
- if (entType != EntTypeEnum.SUPPLIER.getCode()) {
|
|
|
|
|
|
|
+ if (entTypeResDto.getType() != EntTypeEnum.SUPPLIER.getCode()) {
|
|
|
throw new RuntimeException("entId:" + LoginUserHolder.getEntId() + ", 非供应商企业不能新建钱包!");
|
|
throw new RuntimeException("entId:" + LoginUserHolder.getEntId() + ", 非供应商企业不能新建钱包!");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ //校验
|
|
|
|
|
+ LambdaQueryWrapper<KwpBizWallet> queryWrapper = Wrappers.<KwpBizWallet>lambdaQuery()
|
|
|
|
|
+ .eq(KwpBizWallet::getSupEntId, request.getSupEntId())
|
|
|
|
|
+ .eq(KwpBizWallet::getProEntId, request.getProEntId());
|
|
|
|
|
+
|
|
|
|
|
+ List<KwpBizWallet> bizWalletList = kwpBizWalletRepository.list(queryWrapper);
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(bizWalletList)) {
|
|
|
|
|
+ throw new RuntimeException("entId:" + LoginUserHolder.getEntId() + ", 已存在相同供应商企业和采购企业的钱包,不能重复创建!");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
KwpBizWallet kwpBizWallet = new KwpBizWallet();
|
|
KwpBizWallet kwpBizWallet = new KwpBizWallet();
|
|
|
kwpBizWallet.setSupEntId(request.getSupEntId());
|
|
kwpBizWallet.setSupEntId(request.getSupEntId());
|
|
|
kwpBizWallet.setProEntId(request.getProEntId());
|
|
kwpBizWallet.setProEntId(request.getProEntId());
|
|
|
|
|
+ kwpBizWallet.setCreateUser(LoginUserHolder.getUserName());
|
|
|
|
|
+ kwpBizWallet.setUpdateUser(LoginUserHolder.getUserName());
|
|
|
//采购商企业名称
|
|
//采购商企业名称
|
|
|
String entName = queryEntById(request.getProEntId());
|
|
String entName = queryEntById(request.getProEntId());
|
|
|
kwpBizWallet.setName(entName + StringConstant.HYPHEN + OFFLINE_WALLET);
|
|
kwpBizWallet.setName(entName + StringConstant.HYPHEN + OFFLINE_WALLET);
|