|
@@ -77,9 +77,6 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
|
|
|
corpsDescVO.setCorpsAddrList(corpsAddrService.list(new QueryWrapper<PjCorpsAddr>().eq("pid", corpsDesc.getId()).eq("is_deleted", 0)));
|
|
|
//获取客户附件
|
|
|
corpsDescVO.setCorpsFilesList(corpsFilesService.list(new QueryWrapper<PjCorpsFiles>().eq("pid", corpsDesc.getId()).eq("is_deleted", 0)));
|
|
|
- if (org.springframework.util.StringUtils.hasText(desc.getResourceWarehouse())) {
|
|
|
- corpsDescVO.setResourceWarehouseList(JSONArray.parseArray(desc.getResourceWarehouse(), Long.class));
|
|
|
- }
|
|
|
//获取客户类别
|
|
|
List<String> longs = corpsTypeDescService.selectTypeId(corpsDesc.getId());
|
|
|
corpsDescVO.setCorpsTypeId(String.join(",", longs));
|
|
@@ -176,9 +173,6 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
|
|
|
.eq(PjCorpsDesc::getSalesCompanyId, AuthUtil.getTenantId())
|
|
|
.eq(PjCorpsDesc::getCname, corpsDesc.getCname()));
|
|
|
//保存客户信息
|
|
|
- if (!org.springframework.util.CollectionUtils.isEmpty(corpsDescVO.getResourceWarehouseList())) {
|
|
|
- corpsDesc.setResourceWarehouse(JSONArray.toJSONString(corpsDescVO.getResourceWarehouseList()));
|
|
|
- }
|
|
|
if (corpsDesc.getId() == null) {
|
|
|
if (!pjCorpsDesc.isEmpty()) {
|
|
|
throw new RuntimeException("客户" + corpsDesc.getCname() + "已存在,请勿重复添加!");
|
|
@@ -199,51 +193,6 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
|
|
|
corpsDesc.setUpdateTime(date);
|
|
|
corpsDesc.setCreateDept(Long.valueOf(SecureUtil.getDeptId()));
|
|
|
corpsDesc.setUpdateUser(AuthUtil.getUserId());
|
|
|
-
|
|
|
- /*List<PjOrder> orderList = orderMapper.selectList(new LambdaQueryWrapper<PjOrder>()
|
|
|
- .eq(PjOrder::getTenantId, AuthUtil.getTenantId())
|
|
|
- .eq(PjOrder::getIsDeleted, 0)
|
|
|
- .eq(PjOrder::getCustomerId, corpsDesc.getId()));
|
|
|
- if (!orderList.isEmpty()) {
|
|
|
- List<PjOrder> orders = orderList.stream().filter(item -> !corpsDesc.getCname().equals(item.getCustomerName()))
|
|
|
- .collect(Collectors.toList());
|
|
|
- for (PjOrder item : orders) {
|
|
|
- item.setCustomerName(corpsDesc.getCname());
|
|
|
- item.setUpdateTime(new Date());
|
|
|
- item.setUpdateUser(AuthUtil.getUserId());
|
|
|
- item.setUpdateUserName(AuthUtil.getUserName());
|
|
|
- orderMapper.updateById(item);
|
|
|
- }
|
|
|
- }
|
|
|
- List<PjShip> shipList = shipMapper.selectList(new LambdaQueryWrapper<PjShip>()
|
|
|
- .eq(PjShip::getTenantId, AuthUtil.getTenantId())
|
|
|
- .eq(PjShip::getIsDeleted, 0)
|
|
|
- .eq(PjShip::getCustomerId, corpsDesc.getId()));
|
|
|
- if (!shipList.isEmpty()) {
|
|
|
- List<PjShip> ships = shipList.stream().filter(item -> !corpsDesc.getCname().equals(item.getCustomerName()))
|
|
|
- .collect(Collectors.toList());
|
|
|
- for (PjShip item : ships) {
|
|
|
- item.setCustomerName(corpsDesc.getCname());
|
|
|
- item.setUpdateTime(new Date());
|
|
|
- item.setUpdateUser(AuthUtil.getUserId());
|
|
|
- item.setUpdateUserName(AuthUtil.getUserName());
|
|
|
- shipMapper.updateById(item);
|
|
|
- }
|
|
|
- }
|
|
|
- List<PjSettlement> settlementList = settlementMapper.selectList(new LambdaQueryWrapper<PjSettlement>()
|
|
|
- .eq(PjSettlement::getTenantId, AuthUtil.getTenantId())
|
|
|
- .eq(PjSettlement::getIsDeleted, 0)
|
|
|
- .eq(PjSettlement::getCorpId, corpsDesc.getId()));
|
|
|
- if (!settlementList.isEmpty()) {
|
|
|
- List<PjSettlement> settlements = settlementList.stream().filter(item -> !corpsDesc.getCname().equals(item.getCorpName()))
|
|
|
- .collect(Collectors.toList());
|
|
|
- for (PjSettlement item : settlements) {
|
|
|
- item.setCorpName(corpsDesc.getCname());
|
|
|
- item.setUpdateTime(new Date());
|
|
|
- item.setUpdateUser(AuthUtil.getUserId());
|
|
|
- settlementMapper.updateById(item);
|
|
|
- }
|
|
|
- }*/
|
|
|
}
|
|
|
this.saveOrUpdate(corpsDesc);
|
|
|
Long pId = corpsDesc.getId();
|
|
@@ -342,7 +291,6 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
|
|
|
corpsDesc.setTel(e.getTel());
|
|
|
corpsDesc.setTenantId(AuthUtil.getTenantId());
|
|
|
corpsDesc.setPriceSystem(e.getPriceSystem());
|
|
|
- corpsDesc.setAccountPeriod(e.getAccountPeriod());
|
|
|
//获得业务员
|
|
|
if (StringUtils.isNotBlank(e.getSalesmanName())) {
|
|
|
User user1 = user.stream().filter(item -> item.getRealName().equals(e.getSalesmanName())).findFirst().orElse(null);
|
|
@@ -354,8 +302,6 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
|
|
|
}
|
|
|
corpsDesc.setSalesCompanyId(salesCompanyId);
|
|
|
corpsDesc.setSalesCompanyName(salesCompanyName);
|
|
|
- corpsDesc.setCreditLimit(e.getCreditLimit());
|
|
|
- corpsDesc.setUseCreditLimit(e.getUseCreditLimit());
|
|
|
corpsDesc.setCorpType("KH");
|
|
|
if (ObjectUtils.isNotNull(e.getBrandName())) {
|
|
|
List<String> list = Arrays.asList(e.getBrandName().split(","));
|
|
@@ -908,17 +854,11 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
|
|
|
return;
|
|
|
}
|
|
|
List<String> list = Arrays.asList(corpsDesc.getCorpsTypeId().split(","));
|
|
|
- if (!list.isEmpty()) {
|
|
|
- return;
|
|
|
- }
|
|
|
corpsTypeDescService.remove(new QueryWrapper<PjCorpsTypeDesc>().eq("corp_id", corpsDesc.getId()));
|
|
|
List<PjCorpsTypeDesc> typeDescList = corpsTypeDescService.list(new QueryWrapper<PjCorpsTypeDesc>().eq("corp_id", pId)
|
|
|
.in("corp_type_id", list));
|
|
|
List<PjCorpsTypeDesc> typeDescListNew = new ArrayList<>();
|
|
|
list.forEach(item -> {
|
|
|
- if (typeDescList.isEmpty()) {
|
|
|
- return;
|
|
|
- }
|
|
|
PjCorpsTypeDesc typeDesc = typeDescList.stream().filter(e -> item.equals(e.getCorpTypeId() + "")).findFirst().orElse(null);
|
|
|
if (typeDesc != null) {
|
|
|
typeDesc.setCorpTypeId(Long.valueOf(item));
|