调整 合同、运力、客商、项目

This commit is contained in:
2026-09-15 11:59:42 +08:00
parent 087d89b31a
commit 0d1f14f703
19 changed files with 285 additions and 49 deletions
@@ -189,12 +189,23 @@ public class DeptController extends BladeController {
return R.data(deptService.selectDept(deptId));
}
/**
* 平台公司下拉(是否平台公司=是)
*/
@PreAuth(AuthConstant.PERMIT_ALL)
@GetMapping("/platform-company-select")
@ApiOperationSupport(order = 9)
@Operation(summary = "平台公司下拉", description = "返回是否平台公司=是的部门列表")
public R<List<Dept>> platformCompanySelect() {
return R.data(deptService.listPlatformCompany());
}
/**
* 获取部门的主管信息
*/
@IsAdmin
@GetMapping("/dept-leader-info")
@ApiOperationSupport(order = 9)
@ApiOperationSupport(order = 10)
@Operation(summary = "获取部门的主管信息", description = "传入deptId")
public R<List<UserVO>> deptLeaderInfo(@Parameter(description = "部门id", required = true) @RequestParam Long deptId) {
List<UserVO> list = deptService.deptLeaderInfo(deptId);
@@ -16,6 +16,7 @@
<result column="pinyin_mnemonic" property="pinyinMnemonic"/>
<result column="mnemonic_code" property="mnemonicCode"/>
<result column="carrier_customer_id" property="carrierCustomerId"/>
<result column="is_platform_company" property="isPlatformCompany"/>
<result column="sort" property="sort"/>
<result column="remark" property="remark"/>
<result column="status" property="status"/>
@@ -35,6 +36,7 @@
<result column="pinyin_mnemonic" property="pinyinMnemonic"/>
<result column="mnemonic_code" property="mnemonicCode"/>
<result column="carrier_customer_id" property="carrierCustomerId"/>
<result column="is_platform_company" property="isPlatformCompany"/>
<result column="sort" property="sort"/>
<result column="remark" property="remark"/>
<result column="status" property="status"/>
@@ -97,6 +97,13 @@ public interface IDeptService extends IService<Dept> {
*/
List<Dept> selectDept(String deptId);
/**
* 平台公司下拉(是否平台公司=是)
*
* @return 平台公司部门列表
*/
List<Dept> listPlatformCompany();
/**
* 根据部门名称精确匹配获取部门ID集合
*
@@ -151,6 +151,18 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
return baseMapper.selectList(queryWrapper);
}
@Override
public List<Dept> listPlatformCompany() {
LambdaQueryWrapper<Dept> queryWrapper = Wrappers.<Dept>lambdaQuery()
.eq(Dept::getIsPlatformCompany, 1)
.orderByAsc(Dept::getSort)
.orderByAsc(Dept::getId);
if (!AuthUtil.isAdministrator()) {
queryWrapper.eq(Dept::getTenantId, AuthUtil.getTenantId());
}
return list(queryWrapper);
}
@Override
public String getDeptIds(String tenantId, String deptNames) {
List<Dept> deptList = baseMapper.selectList(Wrappers.<Dept>query().lambda().eq(Dept::getTenantId, tenantId).in(Dept::getDeptName, Func.toStrList(deptNames)));
@@ -232,6 +244,9 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
dept.setAncestors(parent.getAncestors() + StringPool.COMMA + dept.getParentId());
}
dept.setIsDeleted(BladeConstant.DB_NOT_DELETED);
if (dept.getIsPlatformCompany() == null) {
dept.setIsPlatformCompany(0);
}
if (Func.isEmpty(dept.getTenantId())) {
throw new ServiceException("租户ID不能为空");
}
@@ -264,8 +279,10 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
private void validateDeptCode(Dept dept, Dept parent) {
String deptCode = dept.getDeptCode();
// 组织编码非必填,为空时存 null,避免唯一索引冲突
if (StringUtil.isBlank(deptCode)) {
throw new ServiceException("组织编码不能为空");
dept.setDeptCode(null);
return;
}
deptCode = deptCode.trim();
if (deptCode.length() > 30) {