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