init
parent
f3930be134
commit
a12aefade8
|
|
@ -5,6 +5,7 @@ import io.swagger.annotations.ApiOperation;
|
|||
import io.swagger.annotations.ApiParam;
|
||||
import org.qinan.safetyeval.client.api.OrgPersonnelCertApi;
|
||||
import org.qinan.safetyeval.client.co.OrgPersonnelCertCO;
|
||||
import org.qinan.safetyeval.client.co.OrgPersonnelCertDetailCO;
|
||||
import org.qinan.safetyeval.client.dto.*;
|
||||
import org.qinan.safetyeval.infrastructure.dataobject.base.Req;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
|
@ -33,7 +34,7 @@ public class OrgPersonnelCertController {
|
|||
|
||||
@ApiOperation("查询人员证书详情")
|
||||
@GetMapping("/get")
|
||||
public SingleResponse<OrgPersonnelCertCO> get(@ApiParam("主键ID") @RequestParam Long id) {
|
||||
public SingleResponse<OrgPersonnelCertDetailCO> get(@ApiParam("主键ID") @RequestParam Long id) {
|
||||
return orgPersonnelCertApi.get(id);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import org.qinan.safetyeval.client.api.OrgPersonnelCertApi;
|
|||
import org.qinan.safetyeval.client.dto.PageResponse;
|
||||
import org.qinan.safetyeval.client.dto.SingleResponse;
|
||||
import org.qinan.safetyeval.client.co.OrgPersonnelCertCO;
|
||||
import org.qinan.safetyeval.client.co.OrgPersonnelCertDetailCO;
|
||||
import org.qinan.safetyeval.client.dto.OrgPersonnelCertAddCmd;
|
||||
import org.qinan.safetyeval.client.dto.OrgPersonnelCertModifyCmd;
|
||||
import org.qinan.safetyeval.client.dto.OrgPersonnelCertPageQuery;
|
||||
|
|
@ -14,7 +15,9 @@ import org.qinan.safetyeval.domain.service.OrgPersonnelCertDomainService;
|
|||
import org.qinan.safetyeval.infrastructure.adapter.ThreadLocalUserInfoAdapter;
|
||||
import org.qinan.safetyeval.infrastructure.adapter.auth.AuthUserContextAdapter;
|
||||
import org.qinan.safetyeval.infrastructure.convertor.OrgPersonnelCertConvertor;
|
||||
import org.qinan.safetyeval.infrastructure.mapper.OrgPersonnelCertMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cloud.commons.util.InetUtils;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
|
@ -33,6 +36,9 @@ public class OrgPersonnelCertExecutor implements OrgPersonnelCertApi {
|
|||
@Autowired
|
||||
private OrgPersonnelCertConvertor orgPersonnelCertConvertor;
|
||||
|
||||
@Autowired
|
||||
private OrgPersonnelCertMapper orgPersonnelCertMapper;
|
||||
|
||||
@Override
|
||||
public SingleResponse<OrgPersonnelCertCO> add(OrgPersonnelCertAddCmd cmd) {
|
||||
OrgPersonnelCertEntity entity = orgPersonnelCertConvertor.addCmdToEntity(cmd);
|
||||
|
|
@ -42,9 +48,9 @@ public class OrgPersonnelCertExecutor implements OrgPersonnelCertApi {
|
|||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse<OrgPersonnelCertCO> get(Long id) {
|
||||
OrgPersonnelCertEntity entity = orgPersonnelCertDomainService.get(id);
|
||||
return SingleResponse.success(orgPersonnelCertConvertor.entityToCO(entity));
|
||||
public SingleResponse<OrgPersonnelCertDetailCO> get(Long id) {
|
||||
OrgPersonnelCertDetailCO co = orgPersonnelCertMapper.selectDetailById(id);
|
||||
return SingleResponse.success(co);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package org.qinan.safetyeval.client.api;
|
||||
|
||||
import org.qinan.safetyeval.client.co.OrgPersonnelCertCO;
|
||||
import org.qinan.safetyeval.client.co.OrgPersonnelCertDetailCO;
|
||||
import org.qinan.safetyeval.client.dto.PageResponse;
|
||||
import org.qinan.safetyeval.client.dto.SingleResponse;
|
||||
import org.qinan.safetyeval.client.dto.OrgPersonnelCertAddCmd;
|
||||
|
|
@ -16,7 +17,7 @@ public interface OrgPersonnelCertApi {
|
|||
|
||||
SingleResponse<OrgPersonnelCertCO> add(OrgPersonnelCertAddCmd cmd);
|
||||
|
||||
SingleResponse<OrgPersonnelCertCO> get(Long id);
|
||||
SingleResponse<OrgPersonnelCertDetailCO> get(Long id);
|
||||
|
||||
SingleResponse<OrgPersonnelCertCO> modify(OrgPersonnelCertModifyCmd cmd);
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
package org.qinan.safetyeval.client.co;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 人员证书详情CO(包含专业能力名称)
|
||||
*
|
||||
* @author safety-eval
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class OrgPersonnelCertDetailCO extends OrgPersonnelCertCO {
|
||||
|
||||
@ApiModelProperty(value = "专业能力名称")
|
||||
private String professionalCapabilityName;
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@ package org.qinan.safetyeval.infrastructure.mapper;
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.qinan.safetyeval.client.co.OrgPersonnelCertDetailCO;
|
||||
import org.qinan.safetyeval.infrastructure.dataobject.OrgPersonnelCertDO;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -17,4 +18,12 @@ public interface OrgPersonnelCertMapper extends BaseMapper<OrgPersonnelCertDO> {
|
|||
* @return 证书专业能力列表
|
||||
*/
|
||||
List<org.qinan.safetyeval.client.co.OrgPersonnelCertCapabilityComplianceCheckCO> selectCapabilityByPersonnelIds(@Param("personnelIds") List<Long> personnelIds);
|
||||
|
||||
/**
|
||||
* 根据主键ID查询人员证书详情(关联industry_professional_standards获取专业能力名称)
|
||||
*
|
||||
* @param id 主键ID
|
||||
* @return 人员证书详情
|
||||
*/
|
||||
OrgPersonnelCertDetailCO selectDetailById(@Param("id") Long id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -431,7 +431,7 @@ public class ComplianceCheckUtil {
|
|||
int T = P + C + 1;
|
||||
int totalNodes = T + 1;
|
||||
|
||||
Dinic dinic = new Dinic(totalNodes);
|
||||
DinicUtil dinic = new DinicUtil(totalNodes);
|
||||
|
||||
// 建立人员ID到节点编号的映射
|
||||
Map<Long, Integer> personNode = new HashMap<>();
|
||||
|
|
@ -462,7 +462,7 @@ public class ComplianceCheckUtil {
|
|||
}
|
||||
|
||||
// 能力 → 汇点 (容量 = 需求人数),记录正向边引用以便后续读取实际流量
|
||||
Map<String, Dinic.Edge> capSinkEdgeMap = new HashMap<>();
|
||||
Map<String, DinicUtil.Edge> capSinkEdgeMap = new HashMap<>();
|
||||
for (Map.Entry<String, Long> entry : requiredMap.entrySet()) {
|
||||
String cap = entry.getKey();
|
||||
long req = entry.getValue() == null ? 0L : entry.getValue();
|
||||
|
|
@ -480,7 +480,7 @@ public class ComplianceCheckUtil {
|
|||
Map<String, Long> assignedMap = new LinkedHashMap<>();
|
||||
for (String capCode : capCodes) {
|
||||
long req = requiredMap.get(capCode) == null ? 0L : requiredMap.get(capCode);
|
||||
Dinic.Edge edge = capSinkEdgeMap.get(capCode);
|
||||
DinicUtil.Edge edge = capSinkEdgeMap.get(capCode);
|
||||
long assigned = edge == null ? 0L : req - edge.cap;
|
||||
assignedMap.put(capCode, assigned);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import java.util.*;
|
|||
/**
|
||||
* Dinic 算法实现
|
||||
*/
|
||||
public class Dinic {
|
||||
public class DinicUtil {
|
||||
static class Edge {
|
||||
int to, rev;
|
||||
long cap;
|
||||
|
|
@ -21,7 +21,7 @@ public class Dinic {
|
|||
int[] level, iter;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
Dinic(int n) {
|
||||
DinicUtil(int n) {
|
||||
graph = new ArrayList[n];
|
||||
for (int i = 0; i < n; i++) graph[i] = new ArrayList<>();
|
||||
level = new int[n];
|
||||
|
|
@ -56,4 +56,35 @@
|
|||
</foreach>
|
||||
</select>
|
||||
|
||||
<!-- 根据主键ID查询人员证书详情(关联industry_professional_standards获取专业能力名称) -->
|
||||
<select id="selectDetailById"
|
||||
resultType="org.qinan.safetyeval.client.co.OrgPersonnelCertDetailCO">
|
||||
SELECT opc.id,
|
||||
opc.personnel_id,
|
||||
opc.cert_name,
|
||||
opc.cert_type_code,
|
||||
opc.cert_type_name,
|
||||
opc.cert_category_code,
|
||||
opc.cert_category_name,
|
||||
opc.operation_category_code,
|
||||
opc.operation_category_name,
|
||||
opc.cert_no,
|
||||
opc.issue_org,
|
||||
opc.valid_start_date,
|
||||
opc.valid_end_date,
|
||||
opc.review_date,
|
||||
opc.cert_attachment_url,
|
||||
opc.business_scope,
|
||||
opc.professional_capability_code,
|
||||
opc.professional_capability_id,
|
||||
opc.tenant_id,
|
||||
ips.professional_capability_name
|
||||
FROM org_personnel_cert opc
|
||||
LEFT JOIN industry_professional_standards ips
|
||||
ON ips.id = opc.professional_capability_id
|
||||
AND ips.delete_enum = 'false'
|
||||
WHERE opc.delete_enum = 'false'
|
||||
AND opc.id = #{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue