|
@@ -19,8 +19,10 @@ import org.jeecg.common.aspect.annotation.NotDuplicate;
|
|
|
import org.jeecg.common.constant.CommonConstant;
|
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
|
+import org.jeecg.modules.basedata.entity.BaseCustomerIndustry;
|
|
|
import org.jeecg.modules.basedata.entity.FdCustomer;
|
|
|
import org.jeecg.modules.basedata.entity.FdCustomerContacts;
|
|
|
+import org.jeecg.modules.basedata.service.IBaseCustomerIndustryService;
|
|
|
import org.jeecg.modules.basedata.service.IFdCustomerContactsService;
|
|
|
import org.jeecg.modules.basedata.service.IFdCustomerService;
|
|
|
|
|
@@ -28,6 +30,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
|
|
|
+import org.jeecg.modules.system.service.ISysDictService;
|
|
|
import org.jeecg.modules.system.service.ISysSerialPatternService;
|
|
|
import org.jeecg.modules.system.vo.CallResult;
|
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
@@ -64,6 +67,11 @@ public class FdCustomerController {
|
|
|
@Autowired
|
|
|
private ISysSerialPatternService iSysSerialPatternService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ISysDictService iSysDictService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IBaseCustomerIndustryService iBaseCustomerIndustryService;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -393,10 +401,56 @@ public class FdCustomerController {
|
|
|
@GetMapping(value = "/queryById")
|
|
|
public Result<FdCustomer> queryById(@RequestParam(name="id",required=true) String id) {
|
|
|
Result<FdCustomer> result = new Result<FdCustomer>();
|
|
|
- FdCustomer fdCustomer = fdCustomerService.getById(id);
|
|
|
+ FdCustomer fdCustomer = fdCustomerService.getFdCustomerById(id);
|
|
|
if(fdCustomer==null) {
|
|
|
result.error500("未找到对应实体");
|
|
|
}else {
|
|
|
+ //根据数据字典中的值获取名称
|
|
|
+ //客商分类名称
|
|
|
+ if(StringUtils.isNotBlank(fdCustomer.getCustomerClassificationDictValue())){
|
|
|
+ fdCustomer.setCustomerClassificationDictName(iSysDictService.queryDictTextByKey("customer_classification", fdCustomer.getCustomerClassificationDictValue()));
|
|
|
+ }
|
|
|
+ //客商来源名称
|
|
|
+ if(StringUtils.isNotBlank(fdCustomer.getCustomerSourceDictValue())){
|
|
|
+ fdCustomer.setCustomerSourceDictName(iSysDictService.queryDictTextByKey("information_sources", fdCustomer.getCustomerSourceDictValue()));
|
|
|
+ }
|
|
|
+ //客商分组名称
|
|
|
+ if(StringUtils.isNotBlank(fdCustomer.getCustomerGroupingDictValue())){
|
|
|
+ fdCustomer.setCustomerGroupingDictName(iSysDictService.queryDictTextByKey("customer_grouping", fdCustomer.getCustomerGroupingDictValue()));
|
|
|
+ }
|
|
|
+ //商务关系名称
|
|
|
+ if(StringUtils.isNotBlank(fdCustomer.getBusinessRelationsDictValue())){
|
|
|
+ fdCustomer.setBusinessRelationsDictName(iSysDictService.queryDictTextByKey("business_relations", fdCustomer.getBusinessRelationsDictValue()));
|
|
|
+ }
|
|
|
+ //使用状态名称
|
|
|
+ if(StringUtils.isNotBlank(fdCustomer.getUseStatusDictValue())){
|
|
|
+ fdCustomer.setUseStatusDictName(iSysDictService.queryDictTextByKey("use_status", fdCustomer.getUseStatusDictValue()));
|
|
|
+ }
|
|
|
+ //休眠类型名称
|
|
|
+ if(StringUtils.isNotBlank(fdCustomer.getSleepTypeDictValue())){
|
|
|
+ fdCustomer.setSleepTypeDictName(iSysDictService.queryDictTextByKey("sleep_type", fdCustomer.getSleepTypeDictValue()));
|
|
|
+ }
|
|
|
+ //单位规模名称
|
|
|
+ if(StringUtils.isNotBlank(fdCustomer.getUnitSizeDictValue())){
|
|
|
+ fdCustomer.setUnitSizeDictName(iSysDictService.queryDictTextByKey("unit_size", fdCustomer.getUnitSizeDictValue()));
|
|
|
+ }
|
|
|
+ //人员规模名称
|
|
|
+ if(StringUtils.isNotBlank(fdCustomer.getPersonnelSizeDictValue())){
|
|
|
+ fdCustomer.setPersonnelSizeDictName(iSysDictService.queryDictTextByKey("personnel_size", fdCustomer.getPersonnelSizeDictValue()));
|
|
|
+ }
|
|
|
+ //注册资金名称
|
|
|
+ if(StringUtils.isNotBlank(fdCustomer.getRegisteredCapitalDictValue())){
|
|
|
+ fdCustomer.setRegisteredCapitalDictName(iSysDictService.queryDictTextByKey("registered_capital", fdCustomer.getRegisteredCapitalDictValue()));
|
|
|
+ }
|
|
|
+ //客户关系名称
|
|
|
+ if(StringUtils.isNotBlank(fdCustomer.getCustomerRelationshipDictValue())){
|
|
|
+ fdCustomer.setCustomerRelationshipDictName(iSysDictService.queryDictTextByKey("customer-relationship", fdCustomer.getCustomerRelationshipDictValue()));
|
|
|
+ }
|
|
|
+ //价值级别名称
|
|
|
+ if(StringUtils.isNotBlank(fdCustomer.getValueLevelDictValue())){
|
|
|
+ fdCustomer.setValueLevelDictName(iSysDictService.queryDictTextByKey("value_level", fdCustomer.getValueLevelDictValue()));
|
|
|
+ }
|
|
|
+
|
|
|
LambdaQueryWrapper<FdCustomerContacts> query = new LambdaQueryWrapper<>();
|
|
|
query.eq(FdCustomerContacts::getPkCustomerId,id);
|
|
|
query.eq(FdCustomerContacts::getIsDefault,"1").eq(FdCustomerContacts::getDelFlag,"0");
|