Commit 76031b75 authored by DESKTOP-BQLVS7A\admin's avatar DESKTOP-BQLVS7A\admin

修改企业注册查询到多条数据bug

parent d14cb2fd
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.ugp.api.mapper;
import com.yeejoin.amos.boot.module.ugp.api.entity.UnitLicence;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* 单位许可信息表 Mapper 接口
......@@ -9,6 +10,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author duanwei
* @date 2022-11-30
*/
@Repository
public interface UnitLicenceMapper extends BaseMapper<UnitLicence> {
}
......@@ -15,6 +15,7 @@ import com.yeejoin.amos.boot.module.ugp.api.entity.SuperviseRule;
import com.yeejoin.amos.boot.module.ugp.api.entity.UnitLicence;
import com.yeejoin.amos.boot.module.ugp.api.mapper.CompanyMapper;
import com.yeejoin.amos.boot.module.ugp.api.mapper.SuperviseRuleMapper;
import com.yeejoin.amos.boot.module.ugp.api.mapper.UnitLicenceMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.ICompanyService;
import com.yeejoin.amos.boot.module.ugp.api.dto.CompanyDto;
import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify;
......@@ -73,6 +74,8 @@ public class CompanyServiceImpl extends BaseService<CompanyDto, Company, Company
@Autowired
CompanyServiceImpl companyServiceImpl;
@Autowired
UnitLicenceMapper unitLicenceMapper;
/**
* 列表查询 示例
*/
......@@ -298,9 +301,15 @@ public class CompanyServiceImpl extends BaseService<CompanyDto, Company, Company
model.setAdminLincensePic(JSON.toJSONString(adminLincensePic));
model.setRecDate(new Date());
SuperviseRule superviseRules = superviseRuleService.getOne(new LambdaQueryWrapper<SuperviseRule>().likeRight(SuperviseRule::getAdminRegionCode,model.getRegionCodeC()));
if (model.getType().equals(OrgEnum.监检机构.getKey())){
if (model.getRegionCode().equals(model.getRegionCodeD())){
model.setRegionCode(model.getRegionCodeC().concat("#").concat(model.getRegionCode()));
if (ValidationUtil.isEmpty(superviseRules)){
model.setRegionCode(model.getRegionCodeP().concat("#").concat(model.getRegionCode()));
}else {
model.setRegionCode(model.getRegionCodeC().concat("#").concat(model.getRegionCode()));
}
} else if (model.getRegionCode().equals(model.getRegionCodeC())) {
model.setRegionCode(model.getRegionCodeP().concat("#").concat(model.getRegionCode()));
}else {
......@@ -312,13 +321,20 @@ public class CompanyServiceImpl extends BaseService<CompanyDto, Company, Company
//添加许可证号和有效期
LambdaQueryWrapper<UnitLicence> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(UnitLicence::getUnitCode,model.getCreditCode());
if(!ValidationUtil.isEmpty(unitLicenceService.getOne(wrapper))){
List<UnitLicence> licencesLists = unitLicenceService.list(wrapper);
for (UnitLicence licencesList : licencesLists){
model.setLicenseNumber(licencesList.getCertNo());
model.setExpirationDate(licencesList.getExpiryDate());
List<UnitLicence> unitLicenceLists = unitLicenceMapper.selectList(wrapper);
for (UnitLicence unitLicencelist : unitLicenceLists){
int i = 1;
if(i == 1){
if(!ValidationUtil.isEmpty(unitLicencelist)){
model.setLicenseNumber(unitLicencelist.getCertNo());
model.setExpirationDate(unitLicencelist.getExpiryDate());
}
i =++i;
}
}
//存入数据
model = companyServiceImpl.createWithModel(model);
//浅拷贝
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment