Commit bb39ba80 authored by 鲁鸿波's avatar 鲁鸿波

承包商 人员台账所属承包商多选

parent 13ed50c2
......@@ -132,4 +132,7 @@ public class Constants
*/
public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
"org.springframework", "org.apache", "com.testor.common.core.utils.file" };
public static final String DBGK_ORG_ID = "1335dbc3f81b4919bf59014fede4819d";
}
......@@ -98,10 +98,11 @@ public class TContractorPersonController extends SuperController
TContractorPerson data= tContractorPersonService.getById(id);
data.setAge((long) IdcardUtil.getAgeByIdCard(data.getIdCardNo()));
TContractorPersonDto tContractorPersonDto = BeanConverUtil.conver(data, TContractorPersonDto.class);
TContractorInfo tContractorInfo = tContractorInfoService.getById(tContractorPersonDto.getInfoId());
/*TContractorInfo tContractorInfo = tContractorInfoService.getById(tContractorPersonDto.getInfoId());
if (tContractorInfo != null) {
tContractorPersonDto.setInfoName(tContractorInfo.getName());
}
}*/
tContractorPersonDto.setInfoName(tContractorInfoService.getName(tContractorPersonDto.getInfoId()));
List<TContractorPersonCertificate> tContractorPersonCertificates = tContractorPersonCertificateService.list(new LambdaQueryWrapper<TContractorPersonCertificate>().eq(TContractorPersonCertificate::getPersonId, id));
tContractorPersonDto.setTContractorPersonCertificates(tContractorPersonCertificates);
baseResponse.setData(tContractorPersonDto);
......
......@@ -38,5 +38,11 @@ public interface TContractorInfoService extends SuperService<TContractorInfo> {
* @return
*/
List<TContractorInfo> selectAll(TContractorInfoParam param);
/**
* 根据infoId获取承包商名称
* @param infoId
* @return
*/
String getName(String infoId);
}
package com.testor.module.contractor.ledger.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.testor.module.contractor.ledger.dao.TContractorInfoDao;
import com.testor.module.contractor.ledger.model.domain.TContractorInfo;
import com.testor.module.contractor.ledger.model.dto.TContractorInfoDelParam;
......@@ -11,6 +12,7 @@ import org.springframework.stereotype.Service;
import com.tongtech.tfw.backend.common.models.supers.SuperServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
......@@ -48,4 +50,22 @@ public class TContractorInfoServiceImpl extends SuperServiceImpl<TContractorInfo
public List<TContractorInfo> selectAll(TContractorInfoParam param) {
return this.baseMapper.selectAll(param);
}
@Override
public String getName(String infoId) {
// 处理每个ID
List<String> names = new ArrayList<>();
if (StringUtils.isNotBlank(infoId)) {
// 分割多个ID(如果有)
String[] ids = infoId.split(",");
for (String id : ids) {
TContractorInfo tContractorInfo = this.getById(id.trim());
if (tContractorInfo != null) {
names.add(tContractorInfo.getName());
}
}
}
return String.join(",", names);
}
}
......@@ -8,6 +8,7 @@ import com.testor.biz.sys.dict.data.model.domain.SysDictData;
import com.testor.biz.sys.dict.data.service.SysDictDataService;
import com.testor.biz.sys.user.model.domain.SysUser;
import com.testor.common.constant.StatusEnum;
import com.testor.common.core.constant.Constants;
import com.testor.common.core.utils.StringUtils;
import com.testor.common.excel.ExcelResult;
import com.testor.common.excel.SheetData;
......@@ -203,10 +204,11 @@ public class TContractorPersonServiceImpl extends SuperServiceImpl<TContractorPe
QueryWrapper<TContractorPerson> queryWrapper=this.createQuery(param);
Page<TContractorPerson> result = this.page(resultPage, queryWrapper);
for(TContractorPerson tContractorPerson:result.getRecords()){
TContractorInfo contractorInfo = tContractorInfoService.getById(tContractorPerson.getInfoId());
/*TContractorInfo contractorInfo = tContractorInfoService.getById(tContractorPerson.getInfoId());
if(null != contractorInfo){
tContractorPerson.setInfoDesignation(contractorInfo.getName());
}
}*/
tContractorPerson.setInfoDesignation(tContractorInfoService.getName(tContractorPerson.getInfoId()));
}
return result;
}
......@@ -242,7 +244,8 @@ public class TContractorPersonServiceImpl extends SuperServiceImpl<TContractorPe
}
// 获取当前组织的所有承包商台账信息
List<Object> infoIds = tContractorLedgerService.listObjs(new QueryWrapper<TContractorLedger>().select(TContractorLedger.INFO_ID).eq(TContractorLedger.ORG_ID, orgId).groupBy(TContractorLedger.INFO_ID));
//List<Object> infoIds = tContractorLedgerService.listObjs(new QueryWrapper<TContractorLedger>().select(TContractorLedger.INFO_ID).eq(TContractorLedger.ORG_ID, orgId).groupBy(TContractorLedger.INFO_ID));
List<Object> infoIds = tContractorLedgerService.listObjs(new QueryWrapper<TContractorLedger>().select(TContractorLedger.INFO_ID).like(TContractorLedger.ORG_ID, orgId).groupBy(TContractorLedger.INFO_ID));
List<NewTreeVo> children = new ArrayList<>(); // 创建一个空的子节点列表
......@@ -441,14 +444,27 @@ public class TContractorPersonServiceImpl extends SuperServiceImpl<TContractorPe
queryWrapper.in("id", queryParam.getIds());
}
}
NewSysOrg org = newSysOrgService.getById(orgId);
if (StringHelper.isNotEmpty(queryParam.getContractorId())){
TContractorLedger tContractorLedger = tContractorLedgerService.getById(queryParam.getContractorId());
if (tContractorLedger != null){
queryWrapper.eq(TContractorPerson.INFO_ID,tContractorLedger.getInfoId());
//如果是东北港口承包商人员台账所属承包商会有多选的情况
if(org.getParentIds().contains(Constants.DBGK_ORG_ID) || orgId.equals(Constants.DBGK_ORG_ID)){
queryWrapper.like(TContractorPerson.INFO_ID,tContractorLedger.getInfoId());
}else{
queryWrapper.eq(TContractorPerson.INFO_ID,tContractorLedger.getInfoId());
}
}
}
if(StringHelper.isNotEmpty(queryParam.getInfoId())){
queryWrapper.eq(TContractorPerson.INFO_ID,queryParam.getInfoId());
//如果是东北港口承包商人员台账所属承包商会有多选的情况
if(org.getParentIds().contains(Constants.DBGK_ORG_ID) || orgId.equals(Constants.DBGK_ORG_ID)){
queryWrapper.like(TContractorPerson.INFO_ID,queryParam.getInfoId());
}else{
queryWrapper.eq(TContractorPerson.INFO_ID,queryParam.getInfoId());
}
}
if(StringHelper.isNotEmpty(queryParam.getName())){
queryWrapper.like(TContractorPerson.NAME,queryParam.getName());
......
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