Conflicts:
	src/main/java/com/chinaunicom/zyhy/ebtp/supplier/coscoCategory/service/impl/CoscoCategoryServiceImpl.java
This commit is contained in:
YY
2025-07-24 08:47:16 +08:00
36 changed files with 106 additions and 1090 deletions

View File

@ -45,4 +45,11 @@ public interface ICoscoCategoryService {
* @return * @return
*/ */
String getCategoryNameById(String id); String getCategoryNameById(String id);
/**
* 通过品类id集合查询品类名集合
*/
List<String> getCategoryNameListByIds(List<String> categoryIds);
} }

View File

@ -95,6 +95,27 @@ public class CoscoCategoryServiceImpl implements ICoscoCategoryService {
} }
@Override
public List<String> getCategoryNameListByIds(List<String> categoryIds) {
List<String> categoryNameList = new ArrayList<>();
for (String id : categoryIds) {
BaseResponse<CoscoCategoryMaintenance> info = categoryClient.getInfo(id);
if (info.isSuccess()) {
CoscoCategoryMaintenance data = info.getData();
categoryNameList.add(data.getCategoryName());
}else{
categoryNameList.add(coscoCategoryMapper.selectCategoryNameById(id));
}
}
return categoryNameList;
}
private List<CoscoCategoryVO> buildTree(List<CoscoCategoryVO> categories) {
// 获取所有顶级节点 (parentId = "0")
List<CoscoCategoryVO> rootNodes = categories.stream()
.filter(c -> CoscoCategoryConstant.LEVEL_TOP.equals(c.getParentId()))
.map(this::convertToTreeDto)
.collect(Collectors.toList());

View File

@ -20,7 +20,6 @@ import java.util.*;
/** /**
* 中远海运_供应商_银行账户Controller
* *
* @author ruoyi * @author ruoyi
* @date 2025-06-16 * @date 2025-06-16
@ -32,7 +31,7 @@ public class CoscoAccessSupplierController extends BaseController {
private ICoscoAccessSupplierService coscoAccessSupplierService; private ICoscoAccessSupplierService coscoAccessSupplierService;
/** /**
* 分组查询工作任务下的评审项 * 供应商准入情况统计查询
*/ */
@ApiOperation("查询分页数据") @ApiOperation("查询分页数据")
@PostMapping("/getPage") @PostMapping("/getPage")
@ -43,6 +42,11 @@ public class CoscoAccessSupplierController extends BaseController {
return BaseResponse.success(coscoAccessSupplierService.selectCoscoAccessSupplierAndWorkPageList(coscoAccessSupplier)); return BaseResponse.success(coscoAccessSupplierService.selectCoscoAccessSupplierAndWorkPageList(coscoAccessSupplier));
} }
/**
* 供应商准入情况统计导出
* @param response
* @param coscoAccessSupplier
*/
@GetMapping("/getPageExport") @GetMapping("/getPageExport")
public void getPageExport(HttpServletResponse response, CoscoAccessSupplier coscoAccessSupplier){ public void getPageExport(HttpServletResponse response, CoscoAccessSupplier coscoAccessSupplier){
try{ try{

View File

@ -183,7 +183,6 @@ public class CoscoSupplierBaseController extends BaseController {
coscoSupplierBase.setAccessStatus(CoscoType.ACCESS_STATUS_YZR); coscoSupplierBase.setAccessStatus(CoscoType.ACCESS_STATUS_YZR);
List<CoscoSupplierBase> list = coscoSupplierBaseService.getMySupplierBaseList(coscoSupplierBase); List<CoscoSupplierBase> list = coscoSupplierBaseService.getMySupplierBaseList(coscoSupplierBase);
// 动态设置导出字段(忽略未标注字段)
Set<String> includeFields = new HashSet<>(Arrays.asList( Set<String> includeFields = new HashSet<>(Arrays.asList(
"name","supplierTypeCn", "enterpriseTypeCn","categoryName","updateTime","accessStatusCn" // 指定要导出的字段名 "name","supplierTypeCn", "enterpriseTypeCn","categoryName","updateTime","accessStatusCn" // 指定要导出的字段名
)); ));

View File

@ -64,8 +64,6 @@ public interface CoscoAccessSupplierCategoryMapper {
public Integer selectBySupplierIdAndCategoryId(CoscoAccessSupplierCategory coscoAccessSupplierCategory); public Integer selectBySupplierIdAndCategoryId(CoscoAccessSupplierCategory coscoAccessSupplierCategory);
public List<CoscoAccessSupplierCategory> selectCategoryNameList(CoscoAccessSupplierCategory coscoAccessSupplierCategory);
/** /**
* 新增供应商准入_供应商已准入品类 * 新增供应商准入_供应商已准入品类

View File

@ -75,6 +75,9 @@ public class CoscoAccessSupplier extends CoscoBaseEntity {
private List<String> deptIdList; private List<String> deptIdList;
//品类id
private List<String> categoryIdList;
//品类名称 //品类名称
@ExcelProperty(value = "准入品类", converter = ListToStringConverter.class) @ExcelProperty(value = "准入品类", converter = ListToStringConverter.class)
private List<String> categoryNameList; private List<String> categoryNameList;

View File

@ -100,6 +100,10 @@ public class CoscoAccessWork extends CoscoBaseEntity {
//品类名集合 //品类名集合
private List<String> categoryNameList; private List<String> categoryNameList;
//品类id集合
private List<String> categoryIdList;
//单位名称 //单位名称
private String orgName; private String orgName;

View File

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chinaunicom.zyhy.ebtp.supplier.base.constant.CoscoType; import com.chinaunicom.zyhy.ebtp.supplier.base.constant.CoscoType;
import com.chinaunicom.zyhy.ebtp.supplier.base.constant.MessageType; import com.chinaunicom.zyhy.ebtp.supplier.base.constant.MessageType;
import com.chinaunicom.zyhy.ebtp.supplier.common.aop.MessageLog; import com.chinaunicom.zyhy.ebtp.supplier.common.aop.MessageLog;
import com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.service.ICoscoCategoryService;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.dao.mapper.CoscoAccessSupplierMapper; import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.dao.mapper.CoscoAccessSupplierMapper;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.dao.mapper.CoscoAccessUserItemMapper; import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.dao.mapper.CoscoAccessUserItemMapper;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.dao.mapper.CoscoAccessUserMapper; import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.dao.mapper.CoscoAccessUserMapper;
@ -33,7 +34,8 @@ public class CoscoAccessSupplierServiceImpl implements ICoscoAccessSupplierServi
private CoscoAccessUserItemMapper coscoAccessUserItemMapper; private CoscoAccessUserItemMapper coscoAccessUserItemMapper;
@Autowired @Autowired
private CoscoAccessUserMapper coscoAccessUserMapper; private CoscoAccessUserMapper coscoAccessUserMapper;
@Autowired
private ICoscoCategoryService coscoCategoryService;
/** /**
* 查询供应商准入_关联供应商 * 查询供应商准入_关联供应商
@ -49,12 +51,20 @@ public class CoscoAccessSupplierServiceImpl implements ICoscoAccessSupplierServi
@Override @Override
public IPage<CoscoAccessSupplier> selectCoscoAccessSupplierAndWorkPageList(CoscoAccessSupplier coscoAccessSupplier) { public IPage<CoscoAccessSupplier> selectCoscoAccessSupplierAndWorkPageList(CoscoAccessSupplier coscoAccessSupplier) {
IPage<CoscoAccessSupplier> accessSupplierIPage = new Page<>(coscoAccessSupplier.getPageNo(), coscoAccessSupplier.getPageSize()); IPage<CoscoAccessSupplier> accessSupplierIPage = new Page<>(coscoAccessSupplier.getPageNo(), coscoAccessSupplier.getPageSize());
return coscoAccessSupplierMapper.selectCoscoAccessSupplierAndWorkPageList(accessSupplierIPage,coscoAccessSupplier); IPage<CoscoAccessSupplier> pageData = coscoAccessSupplierMapper.selectCoscoAccessSupplierAndWorkPageList(accessSupplierIPage,coscoAccessSupplier);
for(CoscoAccessSupplier accessSupplier : pageData.getRecords()){
accessSupplier.setCategoryNameList(coscoCategoryService.getCategoryNameListByIds(accessSupplier.getCategoryIdList()));
}
return pageData;
} }
@Override @Override
public List<CoscoAccessSupplier> selectCoscoAccessSupplierAndWorkExecList(CoscoAccessSupplier coscoAccessSupplier) { public List<CoscoAccessSupplier> selectCoscoAccessSupplierAndWorkExecList(CoscoAccessSupplier coscoAccessSupplier) {
return coscoAccessSupplierMapper.selectCoscoAccessSupplierAndWorkExecList(coscoAccessSupplier); List<CoscoAccessSupplier> coscoAccessSupplierList = coscoAccessSupplierMapper.selectCoscoAccessSupplierAndWorkExecList(coscoAccessSupplier);
for(CoscoAccessSupplier accessSupplier : coscoAccessSupplierList){
accessSupplier.setCategoryNameList(coscoCategoryService.getCategoryNameListByIds(accessSupplier.getCategoryIdList()));
}
return coscoAccessSupplierList;
} }
/** /**

View File

@ -67,7 +67,6 @@ public class CoscoAccessWorkCategoryServiceImpl implements ICoscoAccessWorkCateg
IPage<CoscoAccessWork> page = new Page<>(data.getPageNo(), data.getPageSize()); IPage<CoscoAccessWork> page = new Page<>(data.getPageNo(), data.getPageSize());
data.setApplyType(CoscoType.APPLY_TYPE_PLZR); data.setApplyType(CoscoType.APPLY_TYPE_PLZR);
IPage<CoscoAccessWork> pageData = coscoAccessWorkMapper.selectPageList(page, data); IPage<CoscoAccessWork> pageData = coscoAccessWorkMapper.selectPageList(page, data);
//TODO 暂时先这么写后续如果准入主表添加单位id与部门id就通过2个id查询对应的名称然后set进去
for(CoscoAccessWork coscoAccessWork : pageData.getRecords()){ for(CoscoAccessWork coscoAccessWork : pageData.getRecords()){
OrgDeptVo orgDeptVo = orgService.getOrgDeptInfo(coscoAccessWork.getDeptId()); OrgDeptVo orgDeptVo = orgService.getOrgDeptInfo(coscoAccessWork.getDeptId());
coscoAccessWork.setOrgName(orgDeptVo.getOrgName()); coscoAccessWork.setOrgName(orgDeptVo.getOrgName());
@ -139,7 +138,6 @@ public class CoscoAccessWorkCategoryServiceImpl implements ICoscoAccessWorkCateg
//准入基础信息 //准入基础信息
CoscoAccessWork coscoAccessWork = coscoAccessWorkMapper.selectCoscoAccessWorkById(id); CoscoAccessWork coscoAccessWork = coscoAccessWorkMapper.selectCoscoAccessWorkById(id);
//TODO 获取准入任务的部门id 通过部门id查询部门名称等完善单位数据后 ,再确认一下
OrgDeptVo orgDeptVo = orgService.getOrgDeptInfo(coscoAccessWork.getDeptId()); OrgDeptVo orgDeptVo = orgService.getOrgDeptInfo(coscoAccessWork.getDeptId());
coscoAccessWork.setDeptName(orgDeptVo.getDeptName()); coscoAccessWork.setDeptName(orgDeptVo.getDeptName());
vo.setCoscoAccessWork(coscoAccessWork); vo.setCoscoAccessWork(coscoAccessWork);
@ -255,6 +253,9 @@ public class CoscoAccessWorkCategoryServiceImpl implements ICoscoAccessWorkCateg
coscoAccessSupplierCategory.setUpdateTime(date); coscoAccessSupplierCategory.setUpdateTime(date);
coscoAccessSupplierCategory.setLastUpdateTime(date); coscoAccessSupplierCategory.setLastUpdateTime(date);
coscoAccessSupplierCategoryList.add(coscoAccessSupplierCategory); coscoAccessSupplierCategoryList.add(coscoAccessSupplierCategory);
//消息用
accessCategory.setCategoryName(coscoCategoryService.getCategoryNameById(accessCategory.getCategoryId()));
supplierAndCateGoryList.add(accessCategory); supplierAndCateGoryList.add(accessCategory);
} }
if (!CollectionUtils.isEmpty(coscoAccessSupplierCategoryList)) { if (!CollectionUtils.isEmpty(coscoAccessSupplierCategoryList)) {

View File

@ -80,7 +80,6 @@ public class CoscoAccessWorkServiceImpl implements ICoscoAccessWorkService {
//只查询供应商准入 //只查询供应商准入
data.setApplyType(CoscoType.APPLY_TYPE_GYSZR); data.setApplyType(CoscoType.APPLY_TYPE_GYSZR);
IPage<CoscoAccessWork> pageData = coscoAccessWorkMapper.selectPageList(page, data); IPage<CoscoAccessWork> pageData = coscoAccessWorkMapper.selectPageList(page, data);
//TODO 暂时先这么写后续如果准入主表添加单位id与部门id就通过2个id查询对应的名称然后set进去
for(CoscoAccessWork coscoAccessWork : pageData.getRecords()){ for(CoscoAccessWork coscoAccessWork : pageData.getRecords()){
OrgDeptVo orgDeptVo = orgService.getOrgDeptInfo(coscoAccessWork.getDeptId()); OrgDeptVo orgDeptVo = orgService.getOrgDeptInfo(coscoAccessWork.getDeptId());
coscoAccessWork.setOrgName(orgDeptVo.getOrgName()); coscoAccessWork.setOrgName(orgDeptVo.getOrgName());
@ -95,11 +94,11 @@ public class CoscoAccessWorkServiceImpl implements ICoscoAccessWorkService {
//只查询供应商准入 //只查询供应商准入
data.setApplyType(CoscoType.APPLY_TYPE_GYSZR); data.setApplyType(CoscoType.APPLY_TYPE_GYSZR);
IPage<CoscoAccessWork> pageData = coscoAccessWorkMapper.selectCoscoAccessWorkUserReviewPage(page, data); IPage<CoscoAccessWork> pageData = coscoAccessWorkMapper.selectCoscoAccessWorkUserReviewPage(page, data);
//TODO 暂时先这么写后续如果准入主表添加单位id与部门id就通过2个id查询对应的名称然后set进去
for(CoscoAccessWork coscoAccessWork : pageData.getRecords()){ for(CoscoAccessWork coscoAccessWork : pageData.getRecords()){
OrgDeptVo orgDeptVo = orgService.getOrgDeptInfo(coscoAccessWork.getDeptId()); OrgDeptVo orgDeptVo = orgService.getOrgDeptInfo(coscoAccessWork.getDeptId());
coscoAccessWork.setOrgName(orgDeptVo.getOrgName()); coscoAccessWork.setOrgName(orgDeptVo.getOrgName());
coscoAccessWork.setDeptName(orgDeptVo.getDeptName()); coscoAccessWork.setDeptName(orgDeptVo.getDeptName());
coscoAccessWork.setCategoryNameList(coscoCategoryService.getCategoryNameListByIds(coscoAccessWork.getCategoryIdList()));
} }
return pageData; return pageData;
} }
@ -110,11 +109,11 @@ public class CoscoAccessWorkServiceImpl implements ICoscoAccessWorkService {
IPage<CoscoAccessWork> page = new Page<>(data.getPageNo(), data.getPageSize()); IPage<CoscoAccessWork> page = new Page<>(data.getPageNo(), data.getPageSize());
data.setApplyType(CoscoType.APPLY_TYPE_GYSZR); data.setApplyType(CoscoType.APPLY_TYPE_GYSZR);
IPage<CoscoAccessWork> pageData = coscoAccessWorkMapper.selectPageList(page, data); IPage<CoscoAccessWork> pageData = coscoAccessWorkMapper.selectPageList(page, data);
//TODO 暂时先这么写后续如果准入主表添加单位id与部门id就通过2个id查询对应的名称然后set进去
for(CoscoAccessWork coscoAccessWork : pageData.getRecords()){ for(CoscoAccessWork coscoAccessWork : pageData.getRecords()){
OrgDeptVo orgDeptVo = orgService.getOrgDeptInfo(coscoAccessWork.getDeptId()); OrgDeptVo orgDeptVo = orgService.getOrgDeptInfo(coscoAccessWork.getDeptId());
coscoAccessWork.setOrgName(orgDeptVo.getOrgName()); coscoAccessWork.setOrgName(orgDeptVo.getOrgName());
coscoAccessWork.setDeptName(orgDeptVo.getDeptName()); coscoAccessWork.setDeptName(orgDeptVo.getDeptName());
coscoAccessWork.setCategoryNameList(coscoCategoryService.getCategoryNameListByIds(coscoAccessWork.getCategoryIdList()));
} }
return pageData; return pageData;
} }
@ -131,7 +130,6 @@ public class CoscoAccessWorkServiceImpl implements ICoscoAccessWorkService {
//准入基础信息 //准入基础信息
CoscoAccessWork coscoAccessWork = coscoAccessWorkMapper.selectCoscoAccessWorkById(id); CoscoAccessWork coscoAccessWork = coscoAccessWorkMapper.selectCoscoAccessWorkById(id);
//TODO 获取准入任务的部门id 通过部门id查询部门名称等完善单位数据后 ,再确认一下
OrgDeptVo dept = orgService.getOrgDeptInfo(coscoAccessWork.getDeptId()); OrgDeptVo dept = orgService.getOrgDeptInfo(coscoAccessWork.getDeptId());
coscoAccessWork.setDeptName(dept.getOrgName());//准入部门 coscoAccessWork.setDeptName(dept.getOrgName());//准入部门
vo.setCoscoAccessWork(coscoAccessWork); vo.setCoscoAccessWork(coscoAccessWork);

View File

@ -17,6 +17,7 @@ import com.chinaunicom.zyhy.ebtp.supplier.common.CoscoDateUtils;
import com.chinaunicom.zyhy.ebtp.supplier.base.constant.CoscoType; import com.chinaunicom.zyhy.ebtp.supplier.base.constant.CoscoType;
import com.chinaunicom.zyhy.ebtp.supplier.base.constant.MessageType; import com.chinaunicom.zyhy.ebtp.supplier.base.constant.MessageType;
import com.chinaunicom.zyhy.ebtp.supplier.common.aop.MessageLog; import com.chinaunicom.zyhy.ebtp.supplier.common.aop.MessageLog;
import com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.service.ICoscoCategoryService;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.dao.mapper.CoscoSupplierBaseMapper; import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.dao.mapper.CoscoSupplierBaseMapper;
import com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.dao.CoscoCategoryLibraryContainMapper; import com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.dao.CoscoCategoryLibraryContainMapper;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.dao.mapper.*; import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.dao.mapper.*;
@ -90,6 +91,8 @@ public class CoscoSupplierBaseServiceImpl extends BaseServiceImpl<CoscoSupplierB
private CoscoAccessSupplierMapper coscoAccessSupplierMapper; private CoscoAccessSupplierMapper coscoAccessSupplierMapper;
@Autowired
private ICoscoCategoryService coscoCategoryService;
@Autowired @Autowired
private IOrgService orgService; private IOrgService orgService;
@ -155,7 +158,14 @@ public class CoscoSupplierBaseServiceImpl extends BaseServiceImpl<CoscoSupplierB
@Override @Override
public IPage<CoscoSupplierBase> getMySupplierBasePage(CoscoSupplierBase coscoSupplierBase) { public IPage<CoscoSupplierBase> getMySupplierBasePage(CoscoSupplierBase coscoSupplierBase) {
IPage<CoscoSupplierBase> page = new Page<>(coscoSupplierBase.getPageNo(), coscoSupplierBase.getPageSize()); IPage<CoscoSupplierBase> page = new Page<>(coscoSupplierBase.getPageNo(), coscoSupplierBase.getPageSize());
return coscoSupplierBaseMapper.getMySupplierBasePage(page, coscoSupplierBase); IPage<CoscoSupplierBase> pageData = coscoSupplierBaseMapper.getMySupplierBasePage(page, coscoSupplierBase);
for (CoscoSupplierBase supplierBase : pageData.getRecords()){
String[] categoryIds = supplierBase.getCategoryId().split(",");
List<String> categoryIdList = Arrays.asList(categoryIds);
List<String> categoryNameList = coscoCategoryService.getCategoryNameListByIds(categoryIdList);
supplierBase.setCategoryName(String.join(",", categoryNameList));
}
return pageData;
} }
/** /**
@ -173,13 +183,23 @@ public class CoscoSupplierBaseServiceImpl extends BaseServiceImpl<CoscoSupplierB
if(!ObjectUtils.isEmpty(dept)){ if(!ObjectUtils.isEmpty(dept)){
category.setDeptName(dept.getOrgName()); category.setDeptName(dept.getOrgName());
} }
category.setCategoryName(coscoCategoryService.getCategoryNameById(category.getCategoryId()));
} }
return pageData; return pageData;
} }
@Override @Override
public List<CoscoSupplierBase> getMySupplierBaseList(CoscoSupplierBase coscoSupplierBase) { public List<CoscoSupplierBase> getMySupplierBaseList(CoscoSupplierBase coscoSupplierBase) {
return coscoSupplierBaseMapper.getMySupplierBaseList(coscoSupplierBase);
List<CoscoSupplierBase> coscoSupplierBaseList = coscoSupplierBaseMapper.getMySupplierBaseList(coscoSupplierBase);
for (CoscoSupplierBase supplierBase : coscoSupplierBaseList){
//TODO enterpriseType 转中文
String[] categoryIds = supplierBase.getCategoryId().split(",");
List<String> categoryIdList = Arrays.asList(categoryIds);
List<String> categoryNameList = coscoCategoryService.getCategoryNameListByIds(categoryIdList);
supplierBase.setCategoryName(String.join(",", categoryNameList));
}
return coscoSupplierBaseList;
} }
@Override @Override
@ -189,6 +209,7 @@ public class CoscoSupplierBaseServiceImpl extends BaseServiceImpl<CoscoSupplierB
OrgDeptVo orgDeptVo = orgService.getOrgDeptInfo(supplierBase.getDeptId()); OrgDeptVo orgDeptVo = orgService.getOrgDeptInfo(supplierBase.getDeptId());
supplierBase.setOrgName(orgDeptVo.getOrgName()); supplierBase.setOrgName(orgDeptVo.getOrgName());
supplierBase.setDeptName(orgDeptVo.getDeptName()); supplierBase.setDeptName(orgDeptVo.getDeptName());
//TODO enterpriseType 转中文
} }
return list; return list;
} }

View File

@ -49,7 +49,6 @@ public class CoscoSupplierUserServiceImpl implements ICoscoSupplierUserService {
private IUserService userService; private IUserService userService;
/** /**
* 查询中远海运_供应商_供应商联系人 * 查询中远海运_供应商_供应商联系人
* *
@ -94,7 +93,15 @@ public class CoscoSupplierUserServiceImpl implements ICoscoSupplierUserService {
@Override @Override
public IPage<CoscoSupplierUser> getPage(CoscoSupplierUser coscoSupplierUser) { public IPage<CoscoSupplierUser> getPage(CoscoSupplierUser coscoSupplierUser) {
IPage<CoscoSupplierUser> page = new Page<>(coscoSupplierUser.getPageNo(), coscoSupplierUser.getPageSize()); IPage<CoscoSupplierUser> page = new Page<>(coscoSupplierUser.getPageNo(), coscoSupplierUser.getPageSize());
return coscoSupplierUserMapper.selectCoscoSupplierUserPage(page,coscoSupplierUser); IPage<CoscoSupplierUser> pageData = coscoSupplierUserMapper.selectCoscoSupplierUserPage(page,coscoSupplierUser);
for(CoscoSupplierUser user : pageData.getRecords()){
List<CoscoSupplierUserCategory> coscoSupplierUserCategoryList = user.getCoscoSupplierUserCategoryList();
for(CoscoSupplierUserCategory coscoSupplierUserCategory : coscoSupplierUserCategoryList){
coscoSupplierUserCategory.setCategoryName(coscoCategoryService.getCategoryNameById(coscoSupplierUserCategory.getCategoryId()));
}
}
return pageData;
} }
/** /**

View File

@ -9,6 +9,7 @@ import com.chinaunicom.zyhy.ebtp.supplier.base.constant.CoscoType;
import com.chinaunicom.zyhy.ebtp.supplier.base.constant.MessageType; import com.chinaunicom.zyhy.ebtp.supplier.base.constant.MessageType;
import com.chinaunicom.zyhy.ebtp.supplier.base.service.IOrgService; import com.chinaunicom.zyhy.ebtp.supplier.base.service.IOrgService;
import com.chinaunicom.zyhy.ebtp.supplier.common.aop.MessageLog; import com.chinaunicom.zyhy.ebtp.supplier.common.aop.MessageLog;
import com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.service.ICoscoCategoryService;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.dao.mapper.CoscoSupplierBaseMapper; import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.dao.mapper.CoscoSupplierBaseMapper;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.dao.mapper.*; import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.dao.mapper.*;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.*; import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.*;
@ -52,6 +53,9 @@ public class CoscoSupplierexitServiceImpl implements ICoscoSupplierexitService {
@Autowired @Autowired
private IOrgService orgService; private IOrgService orgService;
@Autowired
private ICoscoCategoryService coscoCategoryService;
@Override @Override
public IPage<CoscoSupplierexit> getPage(CoscoSupplierexit data) { public IPage<CoscoSupplierexit> getPage(CoscoSupplierexit data) {
IPage<CoscoSupplierexit> page = new Page<>(data.getPageNo(), data.getPageSize()); IPage<CoscoSupplierexit> page = new Page<>(data.getPageNo(), data.getPageSize());
@ -77,6 +81,8 @@ public class CoscoSupplierexitServiceImpl implements ICoscoSupplierexitService {
for(CoscoAccessSupplierCategory category : pageData.getRecords()){ for(CoscoAccessSupplierCategory category : pageData.getRecords()){
OrgDeptVo orgDeptVo = orgService.getOrgDeptInfo(category.getDeptId()); OrgDeptVo orgDeptVo = orgService.getOrgDeptInfo(category.getDeptId());
category.setDeptName(orgDeptVo.getDeptName()); category.setDeptName(orgDeptVo.getDeptName());
category.setCategoryName(coscoCategoryService.getCategoryNameById(category.getCategoryId()));
} }
return pageData; return pageData;
} }
@ -90,6 +96,7 @@ public class CoscoSupplierexitServiceImpl implements ICoscoSupplierexitService {
OrgDeptVo orgDeptVo = orgService.getOrgDeptInfo(category.getDeptId()); OrgDeptVo orgDeptVo = orgService.getOrgDeptInfo(category.getDeptId());
category.setOrgName(orgDeptVo.getOrgName()); category.setOrgName(orgDeptVo.getOrgName());
category.setDeptName(orgDeptVo.getDeptName()); category.setDeptName(orgDeptVo.getDeptName());
category.setCategoryName(coscoCategoryService.getCategoryNameById(category.getCategoryId()));
} }
return pageData; return pageData;
} }
@ -104,7 +111,6 @@ public class CoscoSupplierexitServiceImpl implements ICoscoSupplierexitService {
public CoscoSupplierexitVo selectCoscoSupplierexitById(String id) { public CoscoSupplierexitVo selectCoscoSupplierexitById(String id) {
CoscoSupplierexitVo vo = new CoscoSupplierexitVo(); CoscoSupplierexitVo vo = new CoscoSupplierexitVo();
CoscoSupplierexit coscoSupplierexit = coscoSupplierexitMapper.selectCoscoSupplierexitById(id); CoscoSupplierexit coscoSupplierexit = coscoSupplierexitMapper.selectCoscoSupplierexitById(id);
//TODO 获取准入任务的部门id 通过部门id查询部门名称等完善单位数据后 ,再确认一下
OrgDeptVo orgDeptVo = orgService.getOrgDeptInfo(coscoSupplierexit.getDeptId()); OrgDeptVo orgDeptVo = orgService.getOrgDeptInfo(coscoSupplierexit.getDeptId());
coscoSupplierexit.setDeptName(orgDeptVo.getDeptName()); coscoSupplierexit.setDeptName(orgDeptVo.getDeptName());

View File

@ -1,95 +0,0 @@
package com.chinaunicom.zyhy.ebtp.supplier.dict.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.chinaunicom.mall.ebtp.common.base.controller.BaseController;
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
import com.chinaunicom.zyhy.ebtp.supplier.coscoEvaluate.vo.TaskPageVo;
import com.chinaunicom.zyhy.ebtp.supplier.dict.entity.DictProject;
import com.chinaunicom.zyhy.ebtp.supplier.dict.service.IDictProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 项目字典Controller
*
* @author ruoyi
* @date 2025-06-23
*/
@RestController
@RequestMapping("/cosco/dictProject")
public class DictProjectController extends BaseController {
@Autowired
private IDictProjectService dictProjectService;
/**
* 顶级列表查询
* @param dictProject
* @return
*/
@PostMapping("/getTopLevelList")
public BaseResponse<IPage<DictProject>> getTopLevelList(@RequestBody DictProject dictProject){
dictProject.setParentCode("/");
return BaseResponse.success(dictProjectService.getPage(dictProject));
}
/**
* 二级列表查询
* @param dictProject
* @return
*/
@PostMapping("/getSecondaryList")
public BaseResponse<IPage<DictProject>> getSecondaryList(@RequestBody DictProject dictProject){
return BaseResponse.success(dictProjectService.getPage(dictProject));
}
/**
* 获取所有列表
* @param parentCode
* @return
*/
@GetMapping("/getAllList/{parentCode}")
public BaseResponse getAllList(@PathVariable String parentCode) {
DictProject dictProject = new DictProject();
dictProject.setParentCode(parentCode);
List<DictProject> list = dictProjectService.selectDictProjectList(dictProject);
return BaseResponse.success(list);
}
/**
* 获取项目字典详细信息
*/
@GetMapping(value = "/{id}")
public BaseResponse getInfo(@PathVariable("id") Long id) {
return BaseResponse.success(dictProjectService.selectDictProjectById(id));
}
/**
* 新增项目字典
*/
@PostMapping
public BaseResponse add(@RequestBody DictProject dictProject) {
return BaseResponse.success(dictProjectService.insertDictProject(dictProject));
}
/**
* 修改项目字典
*/
@PutMapping
public BaseResponse edit(@RequestBody DictProject dictProject) {
return BaseResponse.success(dictProjectService.updateDictProject(dictProject));
}
/**
* 删除项目字典
*/
@DeleteMapping("/{ids}")
public BaseResponse remove(@PathVariable Long[] ids) {
return BaseResponse.success(dictProjectService.deleteDictProjectByIds(ids));
}
}

View File

@ -1,74 +0,0 @@
package com.chinaunicom.zyhy.ebtp.supplier.dict.controller;
import com.chinaunicom.mall.ebtp.common.base.controller.BaseController;
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
import com.chinaunicom.zyhy.ebtp.supplier.dict.entity.DictRegion;
import com.chinaunicom.zyhy.ebtp.supplier.dict.service.IDictRegionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
/**
* 项目字典Controller
*
* @author ruoyi
* @date 2025-06-23
*/
@RestController
@RequestMapping("/cosco/dictRegion")
public class DictRegionController extends BaseController {
@Autowired
private IDictRegionService regionService;
/**
* 获取所有省级行政区划列表
* @apiNote 获取中国所有省级行政区划(省份、直辖市、自治区等)
* @return 省级行政区划列表
* @example GET /api/regions/provinces
*/
@GetMapping("/region")
public BaseResponse<List<DictRegion>> listRegion() {
return BaseResponse.success(regionService.getProvinces());
}
/**
* 获取指定地区的所有下级行政区划
* @apiNote 递归获取某个地区的所有下级地区(包括子级、孙级等)
* @param cityId 地区ID
* @return 下级行政区划列表
* @example GET /api/regions/110000/children
*/
@GetMapping("/children/{cityId}")
public List<DictRegion> listChildren(@PathVariable Long cityId) {
return regionService.getDistrictsByCity(cityId);
}
/**
* 获取指定地区的完整行政区划路径
* @apiNote 获取从省级到当前地区的完整路径
* @param regionId 地区ID
* @return 完整路径字符串,各级之间用"/"分隔
* @example GET /api/regions/110108/path
* @response 北京市/市辖区/海淀区
*/
@GetMapping("/path/{regionId}")
public String getPath(@PathVariable Integer regionId) {
return regionService.getFullPath(regionId);
}
/**
* 获取所有省级行政区划列表
* @apiNote 获取中国所有省级行政区划(省份、直辖市、自治区等)
* @return 省级行政区划列表
* @example GET /api/regions/provinces
*/
@GetMapping("/regionInternational")
public BaseResponse<List<DictRegion>> listRegionInternational() {
return BaseResponse.success(regionService.listRegionInternational());
}
}

View File

@ -1,71 +0,0 @@
package com.chinaunicom.zyhy.ebtp.supplier.dict.dao;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.chinaunicom.zyhy.ebtp.supplier.dict.entity.DictProject;
import org.springframework.data.repository.query.Param;
import java.util.List;
/**
* 项目字典Mapper接口
*
* @author ruoyi
* @date 2025-06-23
*/
public interface DictProjectMapper {
/**
* 查询项目字典
*
* @param id 项目字典主键
* @return 项目字典
*/
public DictProject selectDictProjectById(Long id);
/**
* 查询项目字典列表
*
* @param dictProject 项目字典
* @return 项目字典集合
*/
public List<DictProject> selectDictProjectList(DictProject dictProject);
/**
* 新增项目字典
*
* @param dictProject 项目字典
* @return 结果
*/
public int insertDictProject(DictProject dictProject);
/**
* 修改项目字典
*
* @param dictProject 项目字典
* @return 结果
*/
public int updateDictProject(DictProject dictProject);
/**
* 删除项目字典
*
* @param id 项目字典主键
* @return 结果
*/
public int deleteDictProjectById(Long id);
/**
* 批量删除项目字典
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteDictProjectByIds(Long[] ids);
/**
* 列表信息
* @param p
* @param vo
* @return
*/
IPage<DictProject> selectPage(IPage<DictProject> p,@Param("vo") DictProject vo);
}

View File

@ -1,54 +0,0 @@
package com.chinaunicom.zyhy.ebtp.supplier.dict.dao;
import com.chinaunicom.zyhy.ebtp.supplier.dict.entity.DictRegion;
import java.util.List;
/**
* 地市
*/
public interface DictRegionMapper {
/**
* 根据ID查询地市信息
*/
DictRegion selectById(Integer id);
/**
* 根据父ID查询子地市列表
*/
List<DictRegion> selectByParentId(Long parentId);
/**
* 根据级别查询地市列表
*/
List<DictRegion> selectByList();
/**
* 根据级别查询全球地市列表
*/
List<DictRegion> selectInternationalLevel(Integer level);
/**
* 根据名称模糊查询地市列表
*/
List<DictRegion> searchByName(String name);
/**
* 查询所有地市信息
*/
List<DictRegion> selectAll();
List<DictRegion> selectAllChildren(Long id);
List<DictRegion> selectAllParents(Long id);
}

View File

@ -1,180 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.chinaunicom.zyhy.ebtp.supplier.dict.dao.DictProjectMapper">
<resultMap type="com.chinaunicom.zyhy.ebtp.supplier.dict.entity.DictProject" id="DictProjectResult">
<result property="id" column="id"/>
<result property="code" column="code"/>
<result property="dicName" column="dic_name"/>
<result property="parentCode" column="parent_code"/>
<result property="parentType" column="parent_type"/>
<result property="defaultFlag" column="default_flag"/>
<result property="useFlag" column="use_flag"/>
<result property="orderFlag" column="order_flag"/>
<result property="description" column="description"/>
<result property="dictTypeCode" column="dict_type_code"/>
<result property="dictTypeName" column="dict_type_name"/>
</resultMap>
<sql id="selectDictProjectVo">
select id,
code,
dic_name,
parent_code,
parent_type,
default_flag,
use_flag,
order_flag,
description,
dict_type_code,
dict_type_name
from dict_project
</sql>
<select id="selectPage" parameterType="map"
resultMap="DictProjectResult">
<include refid="selectDictProjectVo"/>
<where>
<if test="vo.dicName != null and vo.dicName != ''">
and dic_name like concat('%', #{vo.dicName}, '%')
</if>
<if test="vo.parentCode != null and vo.parentCode != ''">
and parent_code = #{vo.parentCode}
</if>
</where>
</select>
<select id="selectDictProjectList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.dict.entity.DictProject"
resultMap="DictProjectResult">
<include refid="selectDictProjectVo"/>
<where>
<if test="code != null and code != ''">
and code = #{code}
</if>
<if test="dicName != null and dicName != ''">
and dic_name like concat('%', #{dicName}, '%')
</if>
<if test="parentCode != null and parentCode != ''">
and parent_code = #{parentCode}
</if>
<if test="parentType != null and parentType != ''">
and parent_type = #{parentType}
</if>
<if test="defaultFlag != null and defaultFlag != ''">
and default_flag = #{defaultFlag}
</if>
<if test="useFlag != null and useFlag != ''">
and use_flag = #{useFlag}
</if>
<if test="orderFlag != null ">
and order_flag = #{orderFlag}
</if>
<if test="description != null and description != ''">
and description = #{description}
</if>
<if test="dictTypeCode != null and dictTypeCode != ''">
and dict_type_code = #{dictTypeCode}
</if>
<if test="dictTypeName != null and dictTypeName != ''">
and dict_type_name like concat('%', #{dictTypeName}, '%')
</if>
</where>
</select>
<select id="selectDictProjectById" parameterType="Long"
resultMap="DictProjectResult">
<include refid="selectDictProjectVo"/>
where id = #{id}
</select>
<insert id="insertDictProject" parameterType="com.chinaunicom.zyhy.ebtp.supplier.dict.entity.DictProject"
useGeneratedKeys="true"
keyProperty="id">
insert into dict_project
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="code != null">code,</if>
<if test="dicName != null">dic_name,</if>
<if test="parentCode != null">parent_code,</if>
<if test="parentType != null">parent_type,</if>
<if test="defaultFlag != null">default_flag,</if>
<if test="useFlag != null">use_flag,</if>
<if test="orderFlag != null">order_flag,</if>
<if test="description != null">description,</if>
<if test="dictTypeCode != null">dict_type_code,</if>
<if test="dictTypeName != null">dict_type_name,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="code != null">#{code},</if>
<if test="dicName != null">#{dicName},</if>
<if test="parentCode != null">#{parentCode},</if>
<if test="parentType != null">#{parentType},</if>
<if test="defaultFlag != null">#{defaultFlag},</if>
<if test="useFlag != null">#{useFlag},</if>
<if test="orderFlag != null">#{orderFlag},</if>
<if test="description != null">#{description},</if>
<if test="dictTypeCode != null">#{dictTypeCode},</if>
<if test="dictTypeName != null">#{dictTypeName},</if>
</trim>
</insert>
<insert id="batchDictProject" parameterType="java.util.List">
insert into dict_project
( id, code, dic_name, parent_code, parent_type, default_flag, use_flag, order_flag, description, dict_type_code,
dict_type_name)
values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.id}, #{item.code}, #{item.dicName}, #{item.parentCode}, #{item.parentType}, #{item.defaultFlag},
#{item.useFlag}, #{item.orderFlag}, #{item.description}, #{item.dictTypeCode}, #{item.dictTypeName})
</foreach>
</insert>
<update id="updateDictProject" parameterType="com.chinaunicom.zyhy.ebtp.supplier.dict.entity.DictProject">
update dict_project
<trim prefix="SET" suffixOverrides=",">
<if test="code != null">code =
#{code},
</if>
<if test="dicName != null">dic_name =
#{dicName},
</if>
<if test="parentCode != null">parent_code =
#{parentCode},
</if>
<if test="parentType != null">parent_type =
#{parentType},
</if>
<if test="defaultFlag != null">default_flag =
#{defaultFlag},
</if>
<if test="useFlag != null">use_flag =
#{useFlag},
</if>
<if test="orderFlag != null">order_flag =
#{orderFlag},
</if>
<if test="description != null">description =
#{description},
</if>
<if test="dictTypeCode != null">dict_type_code =
#{dictTypeCode},
</if>
<if test="dictTypeName != null">dict_type_name =
#{dictTypeName},
</if>
</trim>
where id = #{id}
</update>
<update id="deleteDictProjectById" parameterType="Long">
update dict_project
set del_flag = 2
where id = #{id}
</update>
<update id="deleteDictProjectByIds" parameterType="String">
update dict_project set del_flag = 2 where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

View File

@ -1,86 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.chinaunicom.zyhy.ebtp.supplier.dict.dao.DictRegionMapper">
<resultMap id="BaseResultMap" type="com.chinaunicom.zyhy.ebtp.supplier.dict.entity.DictRegion">
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="p_id" property="parentId" jdbcType="INTEGER"/>
<result column="name" property="name" jdbcType="VARCHAR"/>
<result column="level" property="level" jdbcType="INTEGER"/>
<result column="ab" property="abbr" jdbcType="VARCHAR"/>
<result column="en_name" property="enName" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
id, p_id, name, level, ab
</sql>
<select id="selectById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"/>
FROM dict_region
WHERE id = #{id}
</select>
<select id="selectByParentId" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"/>
FROM dict_region
WHERE p_id = #{parentId}
ORDER BY id
</select>
<select id="selectByList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"/>
FROM dict_region
ORDER BY id
</select>
<select id="selectInternationalLevel" resultMap="BaseResultMap">
SELECT id, p_id, name, level, ab,en_name
FROM dict_region_international
WHERE level = #{level}
ORDER BY id
</select>
<select id="searchByName" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"/>
FROM dict_region
WHERE name LIKE CONCAT('%', #{name}, '%')
ORDER BY id
</select>
<select id="selectAll" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"/>
FROM dict_region
ORDER BY id
</select>
<!-- 递归查询所有子地区 -->
<select id="selectAllChildren" resultMap="BaseResultMap">
WITH RECURSIVE children AS (
SELECT <include refid="Base_Column_List"/>
FROM dict_region
WHERE id = #{id}
UNION ALL
SELECT r.id, r.p_id, r.name, r.level, r.ab
FROM dict_region r
JOIN children c ON r.p_id = c.id
)
SELECT * FROM children WHERE id != #{id}
</select>
<!-- 递归查询所有父地区 -->
<select id="selectAllParents" resultMap="BaseResultMap">
WITH RECURSIVE parents AS (
SELECT <include refid="Base_Column_List"/>
FROM dict_region
WHERE id = #{id}
UNION ALL
SELECT r.id, r.p_id, r.name, r.level, r.ab
FROM dict_region r
JOIN parents p ON r.id = p.p_id
)
SELECT * FROM parents WHERE id != #{id}
</select>
</mapper>

View File

@ -1,53 +0,0 @@
package com.chinaunicom.zyhy.ebtp.supplier.dict.entity;
import com.chinaunicom.mall.ebtp.common.base.entity.BaseEntity;
import com.chinaunicom.mall.ebtp.common.base.entity.BasePageRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 项目字典对象 dict_project
*
* @author ruoyi
* @date 2025-06-23
*/
@Data
public class DictProject extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 编号 */
private Long id;
/** 字典code */
private String code;
/** 字典名称 */
private String dicName;
/** 父类code */
private String parentCode;
/** 父类类型 */
private String parentType;
/** 是否默认 */
private String defaultFlag;
/** 是否应用 */
private String useFlag;
/** 排序 */
private Long orderFlag;
/** 描述 */
private String description;
/** 分组编码 */
private String dictTypeCode;
/** 分组名称 */
private String dictTypeName;
@ApiModelProperty(value = "分页对象信息")
private BasePageRequest basePageRequest;
}

View File

@ -1,35 +0,0 @@
package com.chinaunicom.zyhy.ebtp.supplier.dict.entity;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
public class DictRegion {
private Integer id; // 地区ID
private Integer parentId; // 父地区ID
private String name; // 地区名称
private Integer level; // 地区级别(0-省,1-市,2-区县)
private String abbr; // 地区缩写(如BJ)
private String enName;
private List<DictRegion> children;
public DictRegion() {
this.children = new ArrayList<>();
}
// 修改addChild方法增加空检查
public void addChild(DictRegion child) {
if (child != null) {
if (this.children == null) {
this.children = new ArrayList<>();
}
this.children.add(child);
}
}
}

View File

@ -1,69 +0,0 @@
package com.chinaunicom.zyhy.ebtp.supplier.dict.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.chinaunicom.zyhy.ebtp.supplier.dict.entity.DictProject;
import java.util.List;
/**
* 项目字典Service接口
*
* @author ruoyi
* @date 2025-06-23
*/
public interface IDictProjectService {
/**
* 查询项目字典
*
* @param id 项目字典主键
* @return 项目字典
*/
public DictProject selectDictProjectById(Long id);
/**
* 查询项目字典列表
*
* @param dictProject 项目字典
* @return 项目字典集合
*/
public List<DictProject> selectDictProjectList(DictProject dictProject);
/**
* 新增项目字典
*
* @param dictProject 项目字典
* @return 结果
*/
public int insertDictProject(DictProject dictProject);
/**
* 修改项目字典
*
* @param dictProject 项目字典
* @return 结果
*/
public int updateDictProject(DictProject dictProject);
/**
* 批量删除项目字典
*
* @param ids 需要删除的项目字典主键集合
* @return 结果
*/
public int deleteDictProjectByIds(Long[] ids);
/**
* 删除项目字典信息
*
* @param id 项目字典主键
* @return 结果
*/
public int deleteDictProjectById(Long id);
/**
* 顶级列表
* @param dictProject
* @return
*/
IPage<DictProject> getPage(DictProject dictProject);
}

View File

@ -1,57 +0,0 @@
package com.chinaunicom.zyhy.ebtp.supplier.dict.service;
import com.chinaunicom.zyhy.ebtp.supplier.dict.entity.DictRegion;
import java.util.List;
/**
* 地市
*/
public interface IDictRegionService {
/**
* 获取省份列表
* @return 所有省份列表
*/
List<DictRegion> getProvinces();
/**
* 获取全球省份列表
* @return 所有省份列表
*/
List<DictRegion> listRegionInternational();
/**
* 获取指定城市下的区县列表
* @param cityId 城市ID
* @return 区县列表
*/
List<DictRegion> getDistrictsByCity(Long cityId);
/**
* 获取完整行政区划路径
* @param regionId 区县ID
* @return 完整路径(如"北京市/市辖区/海淀区")
*/
String getFullPath(Integer regionId);
/**
* 递归获取指定地区的所有下级地区(包括子级、孙级等所有后代)
* @param regionId 地区ID
* @return 所有下级地区列表
*/
List<DictRegion> getAllChildrenRegions(Long regionId);
/**
* 递归获取指定地区的所有上级地区(包括父级、祖父级等所有祖先)
* @param regionId 地区ID
* @return 所有上级地区列表
*/
List<DictRegion> getAllParentRegions(Long regionId);
}

View File

@ -1,98 +0,0 @@
package com.chinaunicom.zyhy.ebtp.supplier.dict.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chinaunicom.zyhy.ebtp.supplier.coscoEvaluate.vo.CoscoEvaluateTaskListVo;
import com.chinaunicom.zyhy.ebtp.supplier.dict.dao.DictProjectMapper;
import com.chinaunicom.zyhy.ebtp.supplier.dict.entity.DictProject;
import com.chinaunicom.zyhy.ebtp.supplier.dict.service.IDictProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 项目字典Service业务层处理
*
* @author ruoyi
* @date 2025-06-23
*/
@Service
public class DictProjectServiceImpl implements IDictProjectService {
@Autowired
private DictProjectMapper dictProjectMapper;
/**
* 查询项目字典
*
* @param id 项目字典主键
* @return 项目字典
*/
@Override
public DictProject selectDictProjectById(Long id) {
return dictProjectMapper.selectDictProjectById(id);
}
/**
* 查询项目字典列表
*
* @param dictProject 项目字典
* @return 项目字典
*/
@Override
public List<DictProject> selectDictProjectList(DictProject dictProject) {
return dictProjectMapper.selectDictProjectList(dictProject);
}
/**
* 新增项目字典
*
* @param dictProject 项目字典
* @return 结果
*/
@Override
public int insertDictProject(DictProject dictProject) {
return dictProjectMapper.insertDictProject(dictProject);
}
/**
* 修改项目字典
*
* @param dictProject 项目字典
* @return 结果
*/
@Override
public int updateDictProject(DictProject dictProject) {
return dictProjectMapper.updateDictProject(dictProject);
}
/**
* 批量删除项目字典
*
* @param ids 需要删除的项目字典主键
* @return 结果
*/
@Override
public int deleteDictProjectByIds(Long[] ids) {
return dictProjectMapper.deleteDictProjectByIds(ids);
}
/**
* 删除项目字典信息
*
* @param id 项目字典主键
* @return 结果
*/
@Override
public int deleteDictProjectById(Long id) {
return dictProjectMapper.deleteDictProjectById(id);
}
@Override
public IPage<DictProject> getPage(DictProject dictProject) {
IPage<DictProject> p = new Page<>(dictProject.getBasePageRequest().getPageNo(),
dictProject.getBasePageRequest().getPageSize());
return dictProjectMapper.selectPage(p, dictProject);
}
}

View File

@ -1,136 +0,0 @@
package com.chinaunicom.zyhy.ebtp.supplier.dict.service.impl;
import com.chinaunicom.zyhy.ebtp.supplier.dict.dao.DictRegionMapper;
import com.chinaunicom.zyhy.ebtp.supplier.dict.entity.DictRegion;
import com.chinaunicom.zyhy.ebtp.supplier.dict.service.IDictRegionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.*;
@Service
public class DictRegionServiceImpl implements IDictRegionService {
@Autowired
private DictRegionMapper regionMapper;
/**
* 获取所有省级行政区划列表
* @return 省级行政区划列表(level=0的地区)
*/
@Override
public List<DictRegion> getProvinces() {
List<DictRegion> dictRegions = regionMapper.selectByList();
return buildTree(dictRegions);
}
/**
* 将平面列表转换为树形结构
* @param regions 平面地区列表
* @return 树形结构的地区列表(只包含顶级节点)
*/
public List<DictRegion> buildTree(List<DictRegion> regions) {
// 创建ID到地区的映射
Map<Integer, DictRegion> regionMap = new HashMap<>();
for (DictRegion region : regions) {
if (region != null) {
regionMap.put(region.getId(), region);
}
}
// 构建树形结构
List<DictRegion> result = new ArrayList<>();
for (DictRegion region : regions) {
if (region == null) continue;
Integer parentId = region.getParentId();
if (parentId == null || parentId == 0) {
// 顶级节点(省份)
result.add(region);
} else {
// 子节点添加到父节点的children中
DictRegion parent = regionMap.get(parentId);
if (parent != null) {
parent.addChild(region);
} else {
// 可以记录日志或处理孤儿节点
}
}
}
return result;
}
@Override
public List<DictRegion> listRegionInternational() {
return regionMapper.selectInternationalLevel(0);
}
/**
* 根据城市ID获取该城市下的所有区县列表
* @param cityId 城市ID
* @return 区县列表(指定城市下的子地区)
*/
@Override
public List<DictRegion> getDistrictsByCity(Long cityId) {
return regionMapper.selectByParentId(cityId);
}
/**
* 获取指定地区的完整行政区划路径
* 例如:对于"海淀区",返回"北京市/市辖区/海淀区"
* @param regionId 地区ID
* @return 完整路径字符串,各级之间用"/"分隔
*/
@Override
public String getFullPath(Integer regionId) {
DictRegion region = regionMapper.selectById(regionId);
if (region == null) {
return null;
}
StringBuilder path = new StringBuilder(region.getName());
Integer parentId = region.getParentId();
while (parentId != null && parentId != 0) {
DictRegion parent = regionMapper.selectById(parentId);
if (parent != null) {
path.insert(0, parent.getName() + "/");
parentId = parent.getParentId();
} else {
break;
}
}
return path.toString();
}
/**
* 递归获取指定地区的所有下级地区(包括子级、孙级等所有后代)
* @param regionId 地区ID
* @return 所有下级地区列表
*/
@Override
public List<DictRegion> getAllChildrenRegions(Long regionId) {
return regionMapper.selectAllChildren(regionId);
}
/**
* 递归获取指定地区的所有上级地区(包括父级、祖父级等所有祖先)
* @param regionId 地区ID
* @return 所有上级地区列表
*/
@Override
public List<DictRegion> getAllParentRegions(Long regionId) {
return regionMapper.selectAllParents(regionId);
}
}

View File

@ -10,8 +10,7 @@
</resultMap> </resultMap>
<sql id="selectCoscoAccessCategoryVo"> <sql id="selectCoscoAccessCategoryVo">
select a.category_name as categoryName,c.access_work_id, c.category_id from cosco_access_category c select c.access_work_id, c.category_id from cosco_access_category c
left join cosco_category a on c.category_id = a.id
</sql> </sql>
<select id="selectCoscoAccessCategoryList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoAccessCategory" resultMap="CoscoAccessCategoryResult"> <select id="selectCoscoAccessCategoryList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoAccessCategory" resultMap="CoscoAccessCategoryResult">
@ -25,14 +24,12 @@
SELECT SELECT
cac.category_id, cac.category_id,
cas.supplier_id, cas.supplier_id,
cc.category_name as categoryName,
CASE CASE
WHEN csb.supplier_type = 'ovs' THEN WHEN csb.supplier_type = 'ovs' THEN
name_en ELSE name name_en ELSE name
END AS supplierName END AS supplierName
from cosco_access_work caw from cosco_access_work caw
left join cosco_access_category cac on caw.id = cac.access_work_id left join cosco_access_category cac on caw.id = cac.access_work_id
left join cosco_category cc on cc.id = cac.category_id and cc.del_flag = 'normal'
left join cosco_access_supplier cas on caw.id = cas.access_work_id left join cosco_access_supplier cas on caw.id = cas.access_work_id
LEFT JOIN cosco_supplier_base csb ON cas.supplier_id = csb.id and csb.del_flag = 'normal' LEFT JOIN cosco_supplier_base csb ON cas.supplier_id = csb.id and csb.del_flag = 'normal'
LEFT JOIN cosco_access_supplier_category casc ON casc.category_id = cac.category_id AND casc.dept_id = #{deptId} and cas.supplier_id = casc.supplier_id and casc.del_flag = 'normal' LEFT JOIN cosco_access_supplier_category casc ON casc.category_id = cac.category_id AND casc.dept_id = #{deptId} and cas.supplier_id = casc.supplier_id and casc.del_flag = 'normal'

View File

@ -23,7 +23,6 @@
<sql id="selectCoscoAccessSupplierCategoryVo"> <sql id="selectCoscoAccessSupplierCategoryVo">
SELECT SELECT
s.`name`, s.`name`,
ca.category_name,
c.id, c.id,
c.access_work_id, c.access_work_id,
c.supplier_id, c.supplier_id,
@ -42,7 +41,6 @@
FROM FROM
cosco_access_supplier_category c cosco_access_supplier_category c
left join cosco_supplier_base s on c.supplier_id = s.id and s.del_flag = 'normal' left join cosco_supplier_base s on c.supplier_id = s.id and s.del_flag = 'normal'
left join cosco_category ca on c.category_id = ca.id and ca.del_flag = 'normal'
left join cosco_supplierexit cse on c.supplierexit_id = cse.id and cse.del_flag = 'normal' left join cosco_supplierexit cse on c.supplierexit_id = cse.id and cse.del_flag = 'normal'
</sql> </sql>
@ -128,7 +126,6 @@
CASE CASE
WHEN s.supplier_type = 'ovs' THEN WHEN s.supplier_type = 'ovs' THEN
name_en ELSE name END AS supplierName, name_en ELSE name END AS supplierName,
ca.category_name as categoryName,
c.id, c.id,
c.access_work_id, c.access_work_id,
c.supplier_id, c.supplier_id,
@ -143,7 +140,6 @@
FROM FROM
cosco_access_supplier_category c cosco_access_supplier_category c
left join cosco_supplier_base s on c.supplier_id = s.id and s.del_flag = 'normal' left join cosco_supplier_base s on c.supplier_id = s.id and s.del_flag = 'normal'
left join cosco_category ca on c.category_id = ca.id and ca.del_flag = 'normal'
left join ( left join (
select cssc.category_id from cosco_supplierexit_supplier_category cssc select cssc.category_id from cosco_supplierexit_supplier_category cssc
left join cosco_supplierexit cs on cs.id = cssc.supplierexit_id left join cosco_supplierexit cs on cs.id = cssc.supplierexit_id
@ -161,20 +157,6 @@
</select> </select>
<select id="selectCategoryNameList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoAccessSupplierCategory" resultMap="CoscoAccessSupplierCategoryResult">
SELECT
c.id,
(
SELECT GROUP_CONCAT(p.category_name ORDER BY FIND_IN_SET(p.id, c.ancestors) SEPARATOR '-')
FROM cosco_category p
WHERE FIND_IN_SET(p.id, c.ancestors)
) AS categoryName
FROM cosco_category c
WHERE c.id IN
<foreach collection="categoryList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>

View File

@ -14,7 +14,7 @@
<result property="orgId" column="org_id"/> <result property="orgId" column="org_id"/>
<result property="deptId" column="dept_id"/> <result property="deptId" column="dept_id"/>
<result property="supplierexitId" column="supplierexit_id"/> <result property="supplierexitId" column="supplierexit_id"/>
<collection property="categoryNameList" <collection property="categoryIdList"
column="{supplierId=supplier_id}" column="{supplierId=supplier_id}"
ofType="string" ofType="string"
select="selectCoscoAccessCategoryList"> select="selectCoscoAccessCategoryList">
@ -90,8 +90,7 @@
<select id="selectCoscoAccessCategoryList" <select id="selectCoscoAccessCategoryList"
parameterType="map" parameterType="map"
resultType="string"> resultType="string">
select a.category_name as categoryName from cosco_access_supplier_category c select c.category_id from cosco_access_supplier_category c
left join cosco_category a on c.category_id = a.id and a.del_flag = 'normal'
where c.supplier_id = #{supplierId} and c.del_flag = 'normal' where c.supplier_id = #{supplierId} and c.del_flag = 'normal'
</select> </select>

View File

@ -23,7 +23,7 @@
<result property="updateBy" column="update_by"/> <result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
<result property="lastUpdateTime" column="last_update_time"/> <result property="lastUpdateTime" column="last_update_time"/>
<collection property="categoryNameList" <collection property="categoryIdList"
column="{accessWorkId=id}" column="{accessWorkId=id}"
ofType="string" ofType="string"
select="selectCoscoAccessCategoryList"> select="selectCoscoAccessCategoryList">
@ -123,8 +123,7 @@
<select id="selectCoscoAccessCategoryList" <select id="selectCoscoAccessCategoryList"
parameterType="map" parameterType="map"
resultType="string"> resultType="string">
select a.category_name as categoryName from cosco_access_category c select c.category_id from cosco_access_category c
left join cosco_category a on c.category_id = a.id and a.del_flag = 'normal'
where c.access_work_id = #{accessWorkId} where c.access_work_id = #{accessWorkId}
</select> </select>
<select id="selectPageList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoAccessWork" resultMap="CoscoAccessWorkResult"> <select id="selectPageList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoAccessWork" resultMap="CoscoAccessWorkResult">

View File

@ -21,12 +21,10 @@
m.content, m.content,
m.`read`, m.`read`,
m.type, m.type,
dp.dic_name as typeCn,
m.create_time, m.create_time,
m.update_time m.update_time
FROM FROM
cosco_message m cosco_message m
left join dict_project dp on m.type = dp.`code` and dp.parent_code = 'message_type'
</sql> </sql>
<select id="selectCoscoMessagePage" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoMessage" resultMap="CoscoMessageResult"> <select id="selectCoscoMessagePage" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoMessage" resultMap="CoscoMessageResult">

View File

@ -34,13 +34,9 @@
csb.account_name, csb.account_name,
csb.account, csb.account,
csb.currency, csb.currency,
dpbz.dic_name as currencyName,
csb.nation, csb.nation,
COALESCE(drn.`name`, dri.`name`) as nationName,
csb.province, csb.province,
drp.`name` as provinceName,
csb.city, csb.city,
drc.`name` as cityName,
csb.del_flag, csb.del_flag,
csb.create_by, csb.create_by,
csb.create_time, csb.create_time,
@ -49,11 +45,6 @@
csb.last_update_time csb.last_update_time
FROM FROM
cosco_supplier_bank csb cosco_supplier_bank csb
left join dict_project dpbz on csb.currency = dpbz.`code` and dpbz.parent_code = 'currency'
left join dict_region drn on csb.nation = drn.id
left join dict_region drp on csb.province = drp.id
left join dict_region drc on csb.city = drc.id
left join dict_region_international dri on csb.nation = dri.id
</sql> </sql>

View File

@ -76,7 +76,6 @@
csb.licence_accessory, csb.licence_accessory,
csb.licence_date, csb.licence_date,
csb.enterprise_type, csb.enterprise_type,
dp.dic_name as enterprise_type_cn,
csb.name, csb.name,
csb.name_en, csb.name_en,
csb.social_credit_code, csb.social_credit_code,
@ -90,15 +89,12 @@
csb.contacts_name, csb.contacts_name,
csb.contacts_phone, csb.contacts_phone,
csb.contacts_type, csb.contacts_type,
dpc.dic_name as contactsTypeName,
csb.contacts_email, csb.contacts_email,
csb.telephone, csb.telephone,
csb.nation, csb.nation,
dri.`name` as nationName,
csb.vat, csb.vat,
csb.taxpayer_id, csb.taxpayer_id,
csb.currency, csb.currency,
dpbz.dic_name as currency_cn,
csb.person_name, csb.person_name,
csb.person_phone, csb.person_phone,
csb.person_bank, csb.person_bank,
@ -137,16 +133,12 @@
csb.last_update_time csb.last_update_time
FROM FROM
cosco_supplier_base csb cosco_supplier_base csb
left join dict_project dp on csb.enterprise_type = dp.`code` and dp.parent_code = 'enterprise_type'
left join dict_project dpbz on csb.currency = dpbz.`code` and dpbz.parent_code = 'currency'
left join dict_project dpc on csb.contacts_type = dpc.`code` and dpc.parent_code = 'contacts_type'
left join dict_region_international dri on csb.nation = dri.id
</sql> </sql>
<!-- 我的供应商 --> <!-- 我的供应商 -->
<sql id="selectMySupplierBaseVo"> <sql id="selectMySupplierBaseVo">
SELECT SELECT
c.categoryName, c.categoryId,
CASE supplier_type CASE supplier_type
WHEN 'dvs' THEN '境内企业' WHEN 'dvs' THEN '境内企业'
WHEN 'ovs' THEN '境外企业' WHEN 'ovs' THEN '境外企业'
@ -159,7 +151,6 @@
ELSE NULL ELSE NULL
END AS unified_code, END AS unified_code,
csb.enterprise_type, csb.enterprise_type,
dp.dic_name as enterprise_type_cn,
csb.id, csb.id,
cas.access_work_id, cas.access_work_id,
cas.supplier_id, cas.supplier_id,
@ -179,12 +170,10 @@
left join ( left join (
SELECT SELECT
cac.access_work_id, cac.access_work_id,
GROUP_CONCAT(cc.category_name SEPARATOR ', ') AS categoryName GROUP_CONCAT(cac.category_id SEPARATOR ', ') AS categoryId
FROM cosco_access_category cac FROM cosco_access_category cac
INNER JOIN cosco_category cc ON cac.category_id = cc.id and cc.del_flag = 'normal'
GROUP BY cac.access_work_id GROUP BY cac.access_work_id
) as c on c.access_work_id = caw.id ) as c on c.access_work_id = caw.id
left join dict_project dp on csb.enterprise_type = dp.`code` and dp.parent_code = 'enterprise_type'
</sql> </sql>
<!-- 合格、个人的供应商 --> <!-- 合格、个人的供应商 -->
@ -203,7 +192,6 @@
END AS unified_code, END AS unified_code,
csb.supplier_type, csb.supplier_type,
csb.enterprise_type, csb.enterprise_type,
dp.dic_name as enterprise_type_cn,
csb.id, csb.id,
cas.access_work_id, cas.access_work_id,
cas.supplier_id, cas.supplier_id,
@ -233,7 +221,6 @@
cosco_access_supplier cas cosco_access_supplier cas
LEFT JOIN cosco_access_work caw ON cas.access_work_id = caw.id and caw.del_flag = 'normal' LEFT JOIN cosco_access_work caw ON cas.access_work_id = caw.id and caw.del_flag = 'normal'
LEFT JOIN cosco_supplier_base csb ON cas.supplier_id = csb.id and csb.del_flag = 'normal' LEFT JOIN cosco_supplier_base csb ON cas.supplier_id = csb.id and csb.del_flag = 'normal'
left join dict_project dp on csb.enterprise_type = dp.`code` and dp.parent_code = 'enterprise_type'
</sql> </sql>
<!--未准入的供应商 --> <!--未准入的供应商 -->

View File

@ -125,7 +125,6 @@
ELSE sb.`name` ELSE sb.`name`
END AS supplierName, END AS supplierName,
sb.enterprise_type, sb.enterprise_type,
dp.dic_name as enterprise_type_cn,
c.change_by, c.change_by,
c.change_time, c.change_time,
c.approve_status, c.approve_status,
@ -145,7 +144,6 @@
FROM FROM
cosco_supplier_change_apply c cosco_supplier_change_apply c
LEFT JOIN cosco_supplier_base sb ON c.supplier_id = sb.id LEFT JOIN cosco_supplier_base sb ON c.supplier_id = sb.id
left join dict_project dp on sb.enterprise_type = dp.`code` and dp.parent_code = 'enterprise_type'
left join ( left join (
SELECT SELECT
cas.supplier_id, cas.supplier_id,

View File

@ -29,7 +29,6 @@
csi.id, csi.id,
supplier_id, supplier_id,
taxpayer_type, taxpayer_type,
dp.dic_name as taxpayer_type_cn,
taxpayer_code, taxpayer_code,
phone, phone,
account, account,
@ -45,7 +44,6 @@
last_update_time last_update_time
FROM FROM
cosco_supplier_invoice csi cosco_supplier_invoice csi
left join dict_project dp on csi.taxpayer_type = dp.`code` and dp.parent_code = 'taxpayer_type'
</sql> </sql>

View File

@ -56,11 +56,9 @@
<select id="selectCoscoSupplierUserCategoryByCoscoSupplierUserId" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierUserCategory" resultMap="CoscoSupplierUserCategoryResult"> <select id="selectCoscoSupplierUserCategoryByCoscoSupplierUserId" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierUserCategory" resultMap="CoscoSupplierUserCategoryResult">
SELECT SELECT
csuc.supplier_user_id, csuc.supplier_user_id,
csuc.category_id, csuc.category_id
cc.category_name
FROM FROM
cosco_supplier_user_category csuc cosco_supplier_user_category csuc
left join cosco_category cc on csuc.category_id = cc.id and cc.del_flag = 'normal'
where supplier_user_id = #{supplierUserId} where supplier_user_id = #{supplierUserId}
</select> </select>

View File

@ -21,7 +21,6 @@
CASE CASE
WHEN s.supplier_type = 'ovs' THEN WHEN s.supplier_type = 'ovs' THEN
name_en ELSE name END AS supplierName, name_en ELSE name END AS supplierName,
ca.category_name as categoryName,
sc.supplierexit_id, sc.supplierexit_id,
sc.supplier_id, sc.supplier_id,
sc.category_id sc.category_id
@ -29,7 +28,6 @@
cosco_supplierexit_supplier_category sc cosco_supplierexit_supplier_category sc
left join cosco_supplierexit e on sc.supplierexit_id = e.id left join cosco_supplierexit e on sc.supplierexit_id = e.id
left join cosco_supplier_base s on sc.supplier_id = s.id and s.del_flag = 'normal' left join cosco_supplier_base s on sc.supplier_id = s.id and s.del_flag = 'normal'
left join cosco_category ca on sc.category_id = ca.id and ca.del_flag = 'normal'
</sql> </sql>
<select id="selectPageList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierexitSupplierCategory" resultMap="CoscoSupplierexitSupplierCategoryResult"> <select id="selectPageList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierexitSupplierCategory" resultMap="CoscoSupplierexitSupplierCategoryResult">