|
@@ -32,6 +32,7 @@ import com.fjhx.tenant.entity.dict.dto.DictTenantDataSelectDto;
|
|
|
import com.fjhx.tenant.entity.dict.vo.DictTenantDataVo;
|
|
|
import com.fjhx.tenant.service.dict.DictTenantDataService;
|
|
|
import com.fjhx.tenant.utils.DeptUstil;
|
|
|
+import com.fjhx.tenant.utils.DictCodingService;
|
|
|
import com.fjhx.tenant.utils.DictUtils;
|
|
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
|
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
@@ -70,6 +71,8 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
|
|
|
private DictTenantDataService dictTenantDataService;
|
|
|
@Autowired
|
|
|
private ISysDeptService deptService;
|
|
|
+ @Autowired
|
|
|
+ private DictCodingService dictCodingService;
|
|
|
|
|
|
|
|
|
@Override
|
|
@@ -226,7 +229,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
|
|
|
//获取客户类型字典
|
|
|
DynamicDataSourceContextHolder.push(SourceConstant.BASE);
|
|
|
DictTenantDataSelectDto dictTenantDataSelectDto = new DictTenantDataSelectDto();
|
|
|
- dictTenantDataSelectDto.setDictCode("customer_status");
|
|
|
+ dictTenantDataSelectDto.setDictCode("customer_type");
|
|
|
List<DictTenantDataVo> dictTenantDataVoList = dictTenantDataService.getList(dictTenantDataSelectDto);
|
|
|
Map<String, String> customerStatusDic = dictTenantDataVoList.stream().collect(Collectors.toMap(DictTenantDataVo::getDictKey, DictTenantDataVo::getDictValue));
|
|
|
DynamicDataSourceContextHolder.poll();
|
|
@@ -306,6 +309,10 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
|
|
|
CustomizeAreaUtil.setAreaId(customerDto);
|
|
|
|
|
|
customerDto.setCode(CodeEnum.CUSTOMER.getCode());
|
|
|
+
|
|
|
+ //根据客户类型不同 使用对应规则生成编码
|
|
|
+ customerDto.setCustomerCode(dictCodingService.createCode("customer_type", customerDto.getStatus()));
|
|
|
+
|
|
|
this.save(customerDto);
|
|
|
//添加库户-联系人表的信息
|
|
|
saveCustomerUse(customerDto);
|
|
@@ -612,7 +619,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
|
|
|
for (CustomerVo customerVo : list) {
|
|
|
customerVo.setCompanySize(allDictMap.get("customer_scale").get(customerVo.getCompanySize()));
|
|
|
customerVo.setSettlementMode(allDictMap.get("settlement_way").get(customerVo.getSettlementMode()));
|
|
|
- customerVo.setStatus(allDictMap.get("customer_status").get(customerVo.getStatus()));
|
|
|
+ customerVo.setStatus(allDictMap.get("customer_type").get(customerVo.getStatus()));
|
|
|
customerVo.setLevel(allDictMap.get("customer_slevel").get(customerVo.getLevel()));
|
|
|
customerVo.setNewOld(allDictMap.get("newold_customer").get(customerVo.getNewOld()));
|
|
|
customerVo.setState(allDictMap.get("customer_state").get(customerVo.getState()));
|