parent
1a9f412f90
commit
bc5ce255b2
2
pom.xml
2
pom.xml
|
|
@ -13,6 +13,8 @@
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
</properties>
|
</properties>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,8 @@ package com.zcloud.certificate.web;
|
||||||
|
|
||||||
|
|
||||||
import com.zcloud.certificate.api.CorpCertificateServiceI;
|
import com.zcloud.certificate.api.CorpCertificateServiceI;
|
||||||
import com.zcloud.certificate.dto.CorpCertificateAddCmd;
|
import com.zcloud.certificate.dto.*;
|
||||||
import com.zcloud.certificate.dto.CorpCertificatePageQry;
|
import com.zcloud.certificate.dto.clientobject.CertificateStatisticsCO;
|
||||||
import com.zcloud.certificate.dto.CorpCertificateListQry;
|
|
||||||
import com.zcloud.certificate.dto.CorpCertificateUpdateCmd;
|
|
||||||
import com.zcloud.certificate.dto.CorpCertificateRemoveCmd;
|
|
||||||
import com.zcloud.certificate.dto.clientobject.CorpCertificateCO;
|
import com.zcloud.certificate.dto.clientobject.CorpCertificateCO;
|
||||||
import com.alibaba.cola.dto.MultiResponse;
|
import com.alibaba.cola.dto.MultiResponse;
|
||||||
import com.alibaba.cola.dto.PageResponse;
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
|
@ -79,5 +76,11 @@ public class CorpCertificateController {
|
||||||
return SingleResponse.buildSuccess();
|
return SingleResponse.buildSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("股份端查看分公司/相关方证照统计信息分页")
|
||||||
|
@PostMapping("/statPage")
|
||||||
|
public PageResponse<CertificateStatisticsCO> statPage(@RequestBody CorpCertificateStatPageQry qry) {
|
||||||
|
return corpCertificateService.statPage(qry);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,87 @@
|
||||||
|
package com.zcloud.certificate.web;
|
||||||
|
|
||||||
|
|
||||||
|
import com.zcloud.certificate.api.UserCertificateServiceI;
|
||||||
|
import com.zcloud.certificate.dto.CorpCertificateStatPageQry;
|
||||||
|
import com.zcloud.certificate.dto.UserCertificateAddCmd;
|
||||||
|
import com.zcloud.certificate.dto.UserCertificatePageQry;
|
||||||
|
import com.zcloud.certificate.dto.UserCertificateUpdateCmd;
|
||||||
|
import com.zcloud.certificate.dto.clientobject.UserCertificateCO;
|
||||||
|
import com.alibaba.cola.dto.MultiResponse;
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import com.alibaba.cola.dto.Response;
|
||||||
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
|
import com.jjb.saas.framework.auth.model.SSOUser;
|
||||||
|
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
/**
|
||||||
|
* web-adapter
|
||||||
|
* @Author makejava
|
||||||
|
* @Date 2026-01-06 08:47:20
|
||||||
|
*/
|
||||||
|
@Api(tags = "个人证照管理")
|
||||||
|
@RequestMapping("/${application.gateway}/userCertificate")
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UserCertificateController {
|
||||||
|
private final UserCertificateServiceI userCertificateService;
|
||||||
|
|
||||||
|
@ApiOperation("新增")
|
||||||
|
@PostMapping("/save")
|
||||||
|
public SingleResponse<UserCertificateCO> add(@Validated @RequestBody UserCertificateAddCmd cmd) {
|
||||||
|
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||||
|
return userCertificateService.add(cmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("分页")
|
||||||
|
@PostMapping("/list")
|
||||||
|
public PageResponse<UserCertificateCO> page(@RequestBody UserCertificatePageQry qry) {
|
||||||
|
return userCertificateService.listPage(qry);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("所有数据")
|
||||||
|
@GetMapping("/listAll")
|
||||||
|
public MultiResponse<UserCertificateCO> listAll() {
|
||||||
|
return MultiResponse.of(new ArrayList<UserCertificateCO>());
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("详情")
|
||||||
|
@GetMapping("/getInfoById/{id}")
|
||||||
|
public SingleResponse<UserCertificateCO> getInfoById(@PathVariable("id") Long id) {
|
||||||
|
return SingleResponse.of(userCertificateService.queryById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除")
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public Response remove(@PathVariable("id") Long id) {
|
||||||
|
userCertificateService.remove(id);
|
||||||
|
return SingleResponse.buildSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除多个")
|
||||||
|
@DeleteMapping("/deleteBatch/{ids}")
|
||||||
|
public Response removeBatch(@RequestParam Long[] ids) {
|
||||||
|
userCertificateService.removeBatch(ids);
|
||||||
|
return SingleResponse.buildSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改")
|
||||||
|
@PutMapping("/edit")
|
||||||
|
public SingleResponse edit(@Validated @RequestBody UserCertificateUpdateCmd userCertificateUpdateCmd) {
|
||||||
|
userCertificateService.edit(userCertificateUpdateCmd);
|
||||||
|
return SingleResponse.buildSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("股份端查询企业/相关方各类人员证书数量分页")
|
||||||
|
@PostMapping("/corpCertificateStatPage")
|
||||||
|
public PageResponse corpCertificateStatPage(@RequestBody CorpCertificateStatPageQry qry) {
|
||||||
|
return userCertificateService.corpCertificateStatPage(qry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,9 +1,12 @@
|
||||||
package com.zcloud.certificate.command;
|
package com.zcloud.certificate.command;
|
||||||
|
|
||||||
|
import cn.hutool.core.lang.UUID;
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.zcloud.certificate.domain.gateway.CorpCertificateGateway;
|
import com.zcloud.certificate.domain.gateway.CorpCertificateGateway;
|
||||||
import com.zcloud.certificate.domain.model.CorpCertificateE;
|
import com.zcloud.certificate.domain.model.CorpCertificateE;
|
||||||
import com.zcloud.certificate.dto.CorpCertificateAddCmd;
|
import com.zcloud.certificate.dto.CorpCertificateAddCmd;
|
||||||
import com.alibaba.cola.exception.BizException;
|
import com.alibaba.cola.exception.BizException;
|
||||||
|
import com.zcloud.certificate.persistence.dataobject.CorpCertificateDO;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
@ -25,8 +28,17 @@ public class CorpCertificateAddExe {
|
||||||
public boolean execute(CorpCertificateAddCmd cmd) {
|
public boolean execute(CorpCertificateAddCmd cmd) {
|
||||||
CorpCertificateE corpCertificateE = new CorpCertificateE();
|
CorpCertificateE corpCertificateE = new CorpCertificateE();
|
||||||
BeanUtils.copyProperties(cmd, corpCertificateE);
|
BeanUtils.copyProperties(cmd, corpCertificateE);
|
||||||
|
|
||||||
|
Boolean certificate = corpCertificateGateway.checkCertificateExist(corpCertificateE);
|
||||||
|
if (!certificate) {
|
||||||
|
throw new BizException("证照编号已存在");
|
||||||
|
}
|
||||||
|
|
||||||
boolean res = false;
|
boolean res = false;
|
||||||
try {
|
try {
|
||||||
|
if (corpCertificateE.getCorpCertificateId() == null) {
|
||||||
|
corpCertificateE.setCorpCertificateId(IdUtil.simpleUUID());
|
||||||
|
}
|
||||||
res = corpCertificateGateway.add(corpCertificateE);
|
res = corpCertificateGateway.add(corpCertificateE);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,11 @@ public class CorpCertificateUpdateExe {
|
||||||
public void execute(CorpCertificateUpdateCmd cmd) {
|
public void execute(CorpCertificateUpdateCmd cmd) {
|
||||||
CorpCertificateE corpCertificateE = new CorpCertificateE();
|
CorpCertificateE corpCertificateE = new CorpCertificateE();
|
||||||
BeanUtils.copyProperties(cmd, corpCertificateE);
|
BeanUtils.copyProperties(cmd, corpCertificateE);
|
||||||
|
|
||||||
|
Boolean certificate = corpCertificateGateway.checkCertificateExist(corpCertificateE);
|
||||||
|
if (!certificate) {
|
||||||
|
throw new BizException("证照编号已存在");
|
||||||
|
}
|
||||||
boolean res = corpCertificateGateway.update(corpCertificateE);
|
boolean res = corpCertificateGateway.update(corpCertificateE);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
throw new BizException("修改失败");
|
throw new BizException("修改失败");
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
package com.zcloud.certificate.command;
|
||||||
|
|
||||||
|
import com.zcloud.certificate.domain.gateway.UserCertificateGateway;
|
||||||
|
import com.zcloud.certificate.domain.model.UserCertificateE;
|
||||||
|
import com.zcloud.certificate.dto.UserCertificateAddCmd;
|
||||||
|
import com.alibaba.cola.exception.BizException;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-app
|
||||||
|
* @Author makejava
|
||||||
|
* @Date 2026-01-06 08:47:20
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UserCertificateAddExe {
|
||||||
|
private final UserCertificateGateway userCertificateGateway;
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public boolean execute(UserCertificateAddCmd cmd) {
|
||||||
|
UserCertificateE userCertificateE = new UserCertificateE();
|
||||||
|
BeanUtils.copyProperties(cmd, userCertificateE);
|
||||||
|
|
||||||
|
Boolean certificate = userCertificateGateway.checkCertificateExist(userCertificateE);
|
||||||
|
if (certificate) {
|
||||||
|
throw new BizException("证书编号已存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean res = false;
|
||||||
|
try {
|
||||||
|
res = userCertificateGateway.add(userCertificateE);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
if (!res) {
|
||||||
|
throw new BizException("保存失败");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.zcloud.certificate.command;
|
||||||
|
|
||||||
|
import com.zcloud.certificate.domain.gateway.UserCertificateGateway;
|
||||||
|
import com.alibaba.cola.exception.BizException;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-app
|
||||||
|
* @Author makejava
|
||||||
|
* @Date 2026-01-06 08:47:20
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UserCertificateRemoveExe {
|
||||||
|
private final UserCertificateGateway userCertificateGateway;
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public boolean execute(Long id) {
|
||||||
|
boolean res = userCertificateGateway.deletedUserCertificateById(id);
|
||||||
|
if(!res){
|
||||||
|
throw new BizException("删除失败");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public boolean execute(Long[] ids) {
|
||||||
|
boolean res = userCertificateGateway.deletedUserCertificateByIds(ids);
|
||||||
|
if(!res){
|
||||||
|
throw new BizException("删除失败");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
package com.zcloud.certificate.command;
|
||||||
|
|
||||||
|
import com.alibaba.cola.exception.BizException;
|
||||||
|
import com.zcloud.certificate.domain.gateway.UserCertificateGateway;
|
||||||
|
import com.zcloud.certificate.domain.model.UserCertificateE;
|
||||||
|
import com.zcloud.certificate.dto.UserCertificateUpdateCmd;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-app
|
||||||
|
* @Author makejava
|
||||||
|
* @Date 2026-01-06 08:47:20
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UserCertificateUpdateExe {
|
||||||
|
private final UserCertificateGateway userCertificateGateway;
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void execute(UserCertificateUpdateCmd userCertificateUpdateCmd) {
|
||||||
|
UserCertificateE userCertificateE = new UserCertificateE();
|
||||||
|
BeanUtils.copyProperties(userCertificateUpdateCmd, userCertificateE);
|
||||||
|
|
||||||
|
Boolean certificate = userCertificateGateway.checkCertificateExist(userCertificateE);
|
||||||
|
if (certificate) {
|
||||||
|
throw new BizException("证书编号已存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
boolean res = userCertificateGateway.update(userCertificateE);
|
||||||
|
if (!res) {
|
||||||
|
throw new BizException("修改失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.zcloud.certificate.command.convertor;
|
||||||
|
|
||||||
|
import com.zcloud.certificate.dto.clientobject.CertificateStatisticsCO;
|
||||||
|
import com.zcloud.certificate.persistence.dataobject.CorpInfoDO;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper(componentModel = "spring")
|
||||||
|
public interface CorpCertificateStatCoConvertor {
|
||||||
|
|
||||||
|
List<CertificateStatisticsCO> convertRowsToCOs(List<CorpInfoDO> rows);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
package com.zcloud.certificate.command.convertor;
|
||||||
|
|
||||||
|
import com.zcloud.certificate.dto.clientobject.UserCertificateCO;
|
||||||
|
import com.zcloud.certificate.dto.clientobject.UserCertificateStatCO;
|
||||||
|
import com.zcloud.certificate.persistence.dataobject.UserCertificateDO;
|
||||||
|
import com.zcloud.certificate.persistence.dataobject.UserCertificateStatDO;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-app
|
||||||
|
* @Author makejava
|
||||||
|
* @Date 2026-01-06 08:47:20
|
||||||
|
*/
|
||||||
|
@Mapper(componentModel = "spring")
|
||||||
|
public interface UserCertificateCoConvertor {
|
||||||
|
/**
|
||||||
|
* @param userCertificateDOs
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<UserCertificateCO> converDOsToCOs(List<UserCertificateDO> userCertificateDOs);
|
||||||
|
|
||||||
|
UserCertificateCO converDOToCO(UserCertificateDO userCertificateDO);
|
||||||
|
|
||||||
|
List<UserCertificateStatCO> converStatDOsToStatCOs(List<UserCertificateStatDO> userCertificateStatDOs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -2,10 +2,14 @@ package com.zcloud.certificate.command.query;
|
||||||
|
|
||||||
import com.alibaba.cola.dto.MultiResponse;
|
import com.alibaba.cola.dto.MultiResponse;
|
||||||
import com.zcloud.certificate.command.convertor.CorpCertificateCoConvertor;
|
import com.zcloud.certificate.command.convertor.CorpCertificateCoConvertor;
|
||||||
|
import com.zcloud.certificate.command.convertor.CorpCertificateStatCoConvertor;
|
||||||
import com.zcloud.certificate.dto.CorpCertificatePageQry;
|
import com.zcloud.certificate.dto.CorpCertificatePageQry;
|
||||||
import com.zcloud.certificate.dto.CorpCertificateListQry;
|
import com.zcloud.certificate.dto.CorpCertificateListQry;
|
||||||
|
import com.zcloud.certificate.dto.CorpCertificateStatPageQry;
|
||||||
|
import com.zcloud.certificate.dto.clientobject.CertificateStatisticsCO;
|
||||||
import com.zcloud.certificate.dto.clientobject.CorpCertificateCO;
|
import com.zcloud.certificate.dto.clientobject.CorpCertificateCO;
|
||||||
import com.zcloud.certificate.persistence.dataobject.CorpCertificateDO;
|
import com.zcloud.certificate.persistence.dataobject.CorpCertificateDO;
|
||||||
|
import com.zcloud.certificate.persistence.dataobject.CorpInfoDO;
|
||||||
import com.zcloud.certificate.persistence.repository.CorpCertificateRepository;
|
import com.zcloud.certificate.persistence.repository.CorpCertificateRepository;
|
||||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||||
import com.alibaba.cola.dto.PageResponse;
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
|
@ -29,6 +33,7 @@ import java.util.Map;
|
||||||
public class CorpCertificateQueryExe {
|
public class CorpCertificateQueryExe {
|
||||||
private final CorpCertificateRepository corpCertificateRepository;
|
private final CorpCertificateRepository corpCertificateRepository;
|
||||||
private final CorpCertificateCoConvertor corpCertificateCoConvertor;
|
private final CorpCertificateCoConvertor corpCertificateCoConvertor;
|
||||||
|
private final CorpCertificateStatCoConvertor corpCertificateStatCoConvertor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页
|
* 分页
|
||||||
|
|
@ -37,6 +42,7 @@ public class CorpCertificateQueryExe {
|
||||||
*/
|
*/
|
||||||
public PageResponse<CorpCertificateCO> execute(CorpCertificatePageQry qry) {
|
public PageResponse<CorpCertificateCO> execute(CorpCertificatePageQry qry) {
|
||||||
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
||||||
|
|
||||||
PageResponse<CorpCertificateDO> pageResponse = corpCertificateRepository.listPage(params);
|
PageResponse<CorpCertificateDO> pageResponse = corpCertificateRepository.listPage(params);
|
||||||
List<CorpCertificateCO> examCenterCOS = corpCertificateCoConvertor.converDOsToCOs(pageResponse.getData());
|
List<CorpCertificateCO> examCenterCOS = corpCertificateCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||||
|
|
@ -56,5 +62,24 @@ public class CorpCertificateQueryExe {
|
||||||
return SingleResponse.of(co);
|
return SingleResponse.of(co);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public PageResponse<CertificateStatisticsCO> statPage(CorpCertificateStatPageQry qry) {
|
||||||
|
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
||||||
|
|
||||||
|
PageResponse<CorpInfoDO> pageResponse =
|
||||||
|
corpCertificateRepository.statPage(params);
|
||||||
|
|
||||||
|
List<CertificateStatisticsCO> cos =
|
||||||
|
corpCertificateStatCoConvertor.convertRowsToCOs(pageResponse.getData());
|
||||||
|
|
||||||
|
return PageResponse.of(
|
||||||
|
cos,
|
||||||
|
pageResponse.getTotalCount(),
|
||||||
|
pageResponse.getPageSize(),
|
||||||
|
pageResponse.getPageIndex()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,108 @@
|
||||||
|
package com.zcloud.certificate.command.query;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.zcloud.certificate.command.convertor.UserCertificateCoConvertor;
|
||||||
|
import com.zcloud.certificate.dto.CorpCertificateStatPageQry;
|
||||||
|
import com.zcloud.certificate.dto.UserCertificatePageQry;
|
||||||
|
import com.zcloud.certificate.dto.clientobject.UserCertificateCO;
|
||||||
|
import com.zcloud.certificate.dto.clientobject.UserCertificateStatCO;
|
||||||
|
import com.zcloud.certificate.persistence.dataobject.UserCertificateDO;
|
||||||
|
import com.zcloud.certificate.persistence.dataobject.UserCertificateStatDO;
|
||||||
|
import com.zcloud.certificate.persistence.dataobject.UserDO;
|
||||||
|
import com.zcloud.certificate.persistence.repository.UserCertificateRepository;
|
||||||
|
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-app
|
||||||
|
* @Author makejava
|
||||||
|
* @Date 2026-01-06 08:47:20
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UserCertificateQueryExe {
|
||||||
|
private final UserCertificateRepository userCertificateRepository;
|
||||||
|
private final UserCertificateCoConvertor userCertificateCoConvertor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public UserCertificateCO queryById(Long id) {
|
||||||
|
UserCertificateCO userCertificateCO = userCertificateCoConvertor.converDOToCO(userCertificateRepository.getById(id));
|
||||||
|
if (userCertificateCO == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
// 查询用户名 在职状态并设置
|
||||||
|
UserDO userDO = userCertificateRepository.getUserNamesByUserIds(Collections.singletonList(userCertificateCO.getUserId())).stream().findFirst().orElse(null);
|
||||||
|
if (userDO != null) {
|
||||||
|
userCertificateCO.setUserName(userDO.getUserName());
|
||||||
|
userCertificateCO.setEmploymentStatus(userDO.getEmploymentStatus());
|
||||||
|
userCertificateCO.setPostName(userDO.getPostName());
|
||||||
|
userCertificateCO.setDepartmentName(userDO.getDepartmentName());
|
||||||
|
userCertificateCO.setCorpinfoName(userDO.getCorpinfoName());
|
||||||
|
}
|
||||||
|
return userCertificateCO;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 分页
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public PageResponse<UserCertificateCO> execute(UserCertificatePageQry qry) {
|
||||||
|
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
||||||
|
|
||||||
|
IPage<UserCertificateDO> iPage = userCertificateRepository.listPageWithUser(new Page<>(qry.getPageIndex(), qry.getPageSize()), params);
|
||||||
|
List<UserCertificateCO> cos = Optional.ofNullable(iPage.getRecords())
|
||||||
|
.orElse(Collections.emptyList())
|
||||||
|
.stream()
|
||||||
|
.map(userCertificateCoConvertor::converDOToCO)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
return PageResponse.of(
|
||||||
|
cos,
|
||||||
|
(int) iPage.getTotal(),
|
||||||
|
(int) iPage.getSize(),
|
||||||
|
(int) iPage.getCurrent()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据企业/相关方类型查询各企业/相关方各类人员证书数量分页
|
||||||
|
*/
|
||||||
|
public PageResponse<UserCertificateStatCO> execute(CorpCertificateStatPageQry qry) {
|
||||||
|
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
||||||
|
|
||||||
|
IPage<UserCertificateStatDO> page = new Page<>(
|
||||||
|
qry.getPageIndex(),
|
||||||
|
qry.getPageSize()
|
||||||
|
);
|
||||||
|
|
||||||
|
IPage<UserCertificateStatDO> result =
|
||||||
|
userCertificateRepository.selectCorpCertificateStatPage(page, params);
|
||||||
|
|
||||||
|
List<UserCertificateStatCO> cos = userCertificateCoConvertor.converStatDOsToStatCOs(
|
||||||
|
Optional.ofNullable(result.getRecords()).orElse(Collections.emptyList())
|
||||||
|
);
|
||||||
|
|
||||||
|
return PageResponse.of(
|
||||||
|
cos,
|
||||||
|
(int)result.getTotal(),
|
||||||
|
(int) result.getSize(),
|
||||||
|
(int) result.getCurrent()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -6,10 +6,8 @@ import com.zcloud.certificate.command.CorpCertificateAddExe;
|
||||||
import com.zcloud.certificate.command.CorpCertificateRemoveExe;
|
import com.zcloud.certificate.command.CorpCertificateRemoveExe;
|
||||||
import com.zcloud.certificate.command.CorpCertificateUpdateExe;
|
import com.zcloud.certificate.command.CorpCertificateUpdateExe;
|
||||||
import com.zcloud.certificate.command.query.CorpCertificateQueryExe;
|
import com.zcloud.certificate.command.query.CorpCertificateQueryExe;
|
||||||
import com.zcloud.certificate.dto.CorpCertificateAddCmd;
|
import com.zcloud.certificate.dto.*;
|
||||||
import com.zcloud.certificate.dto.CorpCertificatePageQry;
|
import com.zcloud.certificate.dto.clientobject.CertificateStatisticsCO;
|
||||||
import com.zcloud.certificate.dto.CorpCertificateListQry;
|
|
||||||
import com.zcloud.certificate.dto.CorpCertificateUpdateCmd;
|
|
||||||
import com.zcloud.certificate.dto.clientobject.CorpCertificateCO;
|
import com.zcloud.certificate.dto.clientobject.CorpCertificateCO;
|
||||||
|
|
||||||
import com.alibaba.cola.dto.PageResponse;
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
|
@ -66,5 +64,10 @@ public class CorpCertificateServiceImpl implements CorpCertificateServiceI {
|
||||||
public void removeBatch(Long[] ids) {
|
public void removeBatch(Long[] ids) {
|
||||||
corpCertificateRemoveExe.execute(ids);
|
corpCertificateRemoveExe.execute(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResponse<CertificateStatisticsCO> statPage(CorpCertificateStatPageQry qry) {
|
||||||
|
return corpCertificateQueryExe.statPage(qry);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,71 @@
|
||||||
|
package com.zcloud.certificate.service;
|
||||||
|
|
||||||
|
import com.zcloud.certificate.api.UserCertificateServiceI;
|
||||||
|
import com.zcloud.certificate.command.UserCertificateAddExe;
|
||||||
|
import com.zcloud.certificate.command.UserCertificateRemoveExe;
|
||||||
|
import com.zcloud.certificate.command.UserCertificateUpdateExe;
|
||||||
|
import com.zcloud.certificate.command.query.UserCertificateQueryExe;
|
||||||
|
import com.zcloud.certificate.dto.CorpCertificateStatPageQry;
|
||||||
|
import com.zcloud.certificate.dto.UserCertificateAddCmd;
|
||||||
|
import com.zcloud.certificate.dto.UserCertificatePageQry;
|
||||||
|
import com.zcloud.certificate.dto.UserCertificateUpdateCmd;
|
||||||
|
import com.zcloud.certificate.dto.clientobject.UserCertificateCO;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
|
import com.zcloud.certificate.dto.clientobject.UserCertificateStatCO;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-app
|
||||||
|
* @Author makejava
|
||||||
|
* @Date 2026-01-06 08:47:20
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UserCertificateServiceImpl implements UserCertificateServiceI {
|
||||||
|
private final UserCertificateAddExe userCertificateAddExe;
|
||||||
|
private final UserCertificateUpdateExe userCertificateUpdateExe;
|
||||||
|
private final UserCertificateRemoveExe userCertificateRemoveExe;
|
||||||
|
private final UserCertificateQueryExe userCertificateQueryExe;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserCertificateCO queryById(Long id){
|
||||||
|
return userCertificateQueryExe.queryById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResponse<UserCertificateCO> listPage(UserCertificatePageQry qry){
|
||||||
|
|
||||||
|
return userCertificateQueryExe.execute(qry);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SingleResponse add(UserCertificateAddCmd cmd) {
|
||||||
|
|
||||||
|
userCertificateAddExe.execute(cmd);
|
||||||
|
return SingleResponse.buildSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void edit(UserCertificateUpdateCmd userCertificateUpdateCmd) {
|
||||||
|
userCertificateUpdateExe.execute(userCertificateUpdateCmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void remove(Long id) {
|
||||||
|
userCertificateRemoveExe.execute(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removeBatch(Long[] ids) {
|
||||||
|
userCertificateRemoveExe.execute(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResponse<UserCertificateStatCO> corpCertificateStatPage(CorpCertificateStatPageQry qry) {
|
||||||
|
return userCertificateQueryExe.execute(qry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
package com.zcloud.certificate.api;
|
package com.zcloud.certificate.api;
|
||||||
|
|
||||||
import com.alibaba.cola.dto.MultiResponse;
|
import com.alibaba.cola.dto.MultiResponse;
|
||||||
import com.zcloud.certificate.dto.CorpCertificateAddCmd;
|
import com.zcloud.certificate.dto.*;
|
||||||
import com.zcloud.certificate.dto.CorpCertificatePageQry;
|
import com.zcloud.certificate.dto.clientobject.CertificateStatisticsCO;
|
||||||
import com.zcloud.certificate.dto.CorpCertificateListQry;
|
|
||||||
import com.zcloud.certificate.dto.CorpCertificateUpdateCmd;
|
|
||||||
import com.zcloud.certificate.dto.clientobject.CorpCertificateCO;
|
import com.zcloud.certificate.dto.clientobject.CorpCertificateCO;
|
||||||
|
|
||||||
import com.alibaba.cola.dto.PageResponse;
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
|
@ -30,5 +28,10 @@ public interface CorpCertificateServiceI {
|
||||||
void remove(Long id);
|
void remove(Long id);
|
||||||
|
|
||||||
void removeBatch(Long[] ids);
|
void removeBatch(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 股份端查看分公司证照统计信息
|
||||||
|
*/
|
||||||
|
PageResponse<CertificateStatisticsCO> statPage(CorpCertificateStatPageQry qry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.zcloud.certificate.api;
|
||||||
|
|
||||||
|
import com.zcloud.certificate.dto.CorpCertificateStatPageQry;
|
||||||
|
import com.zcloud.certificate.dto.UserCertificateAddCmd;
|
||||||
|
import com.zcloud.certificate.dto.UserCertificatePageQry;
|
||||||
|
import com.zcloud.certificate.dto.UserCertificateUpdateCmd;
|
||||||
|
import com.zcloud.certificate.dto.clientobject.UserCertificateCO;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
|
import com.zcloud.certificate.dto.clientobject.UserCertificateStatCO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
* @Author makejava
|
||||||
|
* @Date 2026-01-06 08:47:20
|
||||||
|
*/
|
||||||
|
public interface UserCertificateServiceI {
|
||||||
|
UserCertificateCO queryById(Long id);
|
||||||
|
|
||||||
|
PageResponse<UserCertificateCO> listPage(UserCertificatePageQry qry);
|
||||||
|
|
||||||
|
SingleResponse<UserCertificateCO> add(UserCertificateAddCmd cmd);
|
||||||
|
|
||||||
|
void edit(UserCertificateUpdateCmd cmd);
|
||||||
|
|
||||||
|
void remove(Long id);
|
||||||
|
|
||||||
|
void removeBatch(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据企业/相关方类型查询各企业/相关方各类人员证书数量
|
||||||
|
*/
|
||||||
|
PageResponse<UserCertificateStatCO> corpCertificateStatPage(CorpCertificateStatPageQry qry);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -23,6 +23,10 @@ import java.util.Date;
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class CorpCertificateAddCmd extends Command {
|
public class CorpCertificateAddCmd extends Command {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业业务ID", name = "corpCertificateId", required = true)
|
||||||
|
private String corpCertificateId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "企业id", name = "corpinfoId", required = true)
|
@ApiModelProperty(value = "企业id", name = "corpinfoId", required = true)
|
||||||
@NotNull(message = "企业id不能为空")
|
@NotNull(message = "企业id不能为空")
|
||||||
private Long corpinfoId;
|
private Long corpinfoId;
|
||||||
|
|
@ -46,7 +50,6 @@ public class CorpCertificateAddCmd extends Command {
|
||||||
private Date certificateDateEnd;
|
private Date certificateDateEnd;
|
||||||
|
|
||||||
@ApiModelProperty(value = "备注", name = "remark", required = true)
|
@ApiModelProperty(value = "备注", name = "remark", required = true)
|
||||||
@NotEmpty(message = "备注不能为空")
|
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,11 @@
|
||||||
package com.zcloud.certificate.dto;
|
package com.zcloud.certificate.dto;
|
||||||
|
|
||||||
import com.alibaba.cola.dto.PageQuery;
|
import com.alibaba.cola.dto.PageQuery;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web-client
|
* web-client
|
||||||
|
|
@ -24,5 +27,18 @@ public class CorpCertificatePageQry extends PageQuery {
|
||||||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||||
*/
|
*/
|
||||||
private String likeCorpCertificateId;
|
private String likeCorpCertificateId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "证书名称")
|
||||||
|
private String likeCertificateName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "证书有效期-开始时间")
|
||||||
|
private LocalDate geCertificateDateStart;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "证书有效期-结束时间")
|
||||||
|
private LocalDate leCertificateDateEnd;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业ID")
|
||||||
|
private Long eqCorpinfoId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.zcloud.certificate.dto;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.PageQuery;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CorpCertificateStatPageQry extends PageQuery {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "类型:0企业,1相关方,null全部")
|
||||||
|
private Integer corpType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业名称-模糊查询")
|
||||||
|
private String corpName;
|
||||||
|
}
|
||||||
|
|
@ -10,6 +10,7 @@ import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -41,13 +42,12 @@ public class CorpCertificateUpdateCmd extends Command {
|
||||||
@ApiModelProperty(value = "证书有效期-开始时间", name = "certificateDateStart", required = true)
|
@ApiModelProperty(value = "证书有效期-开始时间", name = "certificateDateStart", required = true)
|
||||||
@NotNull(message = "证书有效期-开始时间不能为空")
|
@NotNull(message = "证书有效期-开始时间不能为空")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
private Date certificateDateStart;
|
private LocalDate certificateDateStart;
|
||||||
@ApiModelProperty(value = "证书有效期-结束时间", name = "certificateDateEnd", required = true)
|
@ApiModelProperty(value = "证书有效期-结束时间", name = "certificateDateEnd", required = true)
|
||||||
@NotNull(message = "证书有效期-结束时间不能为空")
|
@NotNull(message = "证书有效期-结束时间不能为空")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
private Date certificateDateEnd;
|
private LocalDate certificateDateEnd;
|
||||||
@ApiModelProperty(value = "备注", name = "remark", required = true)
|
@ApiModelProperty(value = "备注", name = "remark", required = true)
|
||||||
@NotEmpty(message = "备注不能为空")
|
|
||||||
private String remark;
|
private String remark;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,105 @@
|
||||||
|
package com.zcloud.certificate.dto;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.Command;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
* @Author makejava
|
||||||
|
* @Date 2026-01-06 08:47:20
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UserCertificateAddCmd extends Command {
|
||||||
|
@ApiModelProperty(value = "企业id", name = "corpinfoId", required = true)
|
||||||
|
@NotNull(message = "企业id不能为空")
|
||||||
|
private Long corpinfoId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户id", name = "userId", required = true)
|
||||||
|
@NotNull(message = "用户id不能为空")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "1-特种作业,2-特种设备,3-主要负责人,4-安全生产管理人员", name = "type", required = true)
|
||||||
|
@NotNull(message = "1-特种作业,2-特种设备,3-主要负责人,4-安全生产管理人员不能为空")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "证书名称", name = "certificateName", required = true)
|
||||||
|
@NotEmpty(message = "证书名称不能为空")
|
||||||
|
private String certificateName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "证书编号", name = "certificateCode", required = true)
|
||||||
|
@NotEmpty(message = "证书编号不能为空")
|
||||||
|
private String certificateCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "发证机构", name = "issuingAuthority", required = true)
|
||||||
|
@NotEmpty(message = "发证机构不能为空")
|
||||||
|
private String issuingAuthority;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "行业类别code-特种作业使用", name = "industryCategoryCode", required = true)
|
||||||
|
// @NotEmpty(message = "行业类别code-特种作业使用不能为空")
|
||||||
|
private String industryCategoryCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "行业类别名称-特种作业使用", name = "industryCategoryName", required = true)
|
||||||
|
// @NotEmpty(message = "行业类别名称-特种作业使用不能为空")
|
||||||
|
private String industryCategoryName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "行业类别-操作项目code-特种作业使用", name = "industryOperatingItemsCode", required = true)
|
||||||
|
// @NotEmpty(message = "行业类别-操作项目code-特种作业使用不能为空")
|
||||||
|
private String industryOperatingItemsCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "行业类别-操作项目名称-特种作业使用", name = "industryOperatingItemsName", required = true)
|
||||||
|
// @NotEmpty(message = "行业类别-操作项目名称-特种作业使用不能为空")
|
||||||
|
private String industryOperatingItemsName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "作业类别code-特种设备使用", name = "assignmentCategoryCode", required = true)
|
||||||
|
// @NotEmpty(message = "作业类别code-特种设备使用不能为空")
|
||||||
|
private String assignmentCategoryCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "作业类别名称-特种设备使用", name = "assignmentCategoryName", required = true)
|
||||||
|
// @NotEmpty(message = "作业类别名称-特种设备使用不能为空")
|
||||||
|
private String assignmentCategoryName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "作业类别-操作项目code-特种设备使用", name = "assignmentOperatingItemsCode", required = true)
|
||||||
|
// @NotEmpty(message = "作业类别-操作项目code-特种设备使用不能为空")
|
||||||
|
private String assignmentOperatingItemsCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "作业类别-操作项目名称-特种设备使用", name = "assignmentOperatingItemsName", required = true)
|
||||||
|
// @NotEmpty(message = "作业类别-操作项目名称-特种设备使用不能为空")
|
||||||
|
private String assignmentOperatingItemsName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "岗位名称(未定)-主要负责人和安全生产使用", name = "postName", required = true)
|
||||||
|
// @NotEmpty(message = "岗位名称(未定)-主要负责人和安全生产使用不能为空")
|
||||||
|
private String postName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "发证日期", name = "dateIssue", required = true)
|
||||||
|
@NotNull(message = "发证日期不能为空")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private LocalDate dateIssue;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "证书有效期-开始时间", name = "certificateDateStart", required = true)
|
||||||
|
@NotNull(message = "证书有效期-开始时间不能为空")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private LocalDate certificateDateStart;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "证书有效期-结束时间", name = "certificateDateEnd", required = true)
|
||||||
|
@NotNull(message = "证书有效期-结束时间不能为空")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private LocalDate certificateDateEnd;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "复审日期", name = "reviewDate", required = true)
|
||||||
|
@NotNull(message = "复审日期不能为空")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private LocalDate reviewDate;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
package com.zcloud.certificate.dto;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.PageQuery;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
* @Author makejava
|
||||||
|
* @Date 2026-01-06 08:47:20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserCertificatePageQry extends PageQuery {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询条件操作前缀,支持以下几种数据库查询操作:
|
||||||
|
* - `like`: 模糊匹配查询,对应SQL的LIKE操作符
|
||||||
|
* - `eq`: 等值查询,对应SQL的=操作符
|
||||||
|
* - `gt`: 大于比较查询
|
||||||
|
* - `lt`: 小于比较查询
|
||||||
|
* - `ge`: 大于等于比较查询
|
||||||
|
* - `le`: 小于等于比较查询
|
||||||
|
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "业务ID", name = "likeUserCertificateId")
|
||||||
|
private String likeUserCertificateId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "姓名", name = "likeUserName")
|
||||||
|
private String likeUserName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作类别
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "操作类别code-特种作业使用", name = "eqIndustryCategoryCode")
|
||||||
|
private String eqIndustryCategoryCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作项目
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "操作项目code-特种作业使用", name = "eqIndustryOperatingItemsCode")
|
||||||
|
private String eqIndustryOperatingItemsCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员类型
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "人员类型 1-特种作业,2-特种设备,3-主要负责人,4-安全生产管理人员", name = "eqType")
|
||||||
|
private Integer eqType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业ID
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "企业ID", name = "eqCorpinfoId")
|
||||||
|
private Long eqCorpinfoId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,92 @@
|
||||||
|
package com.zcloud.certificate.dto;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.Command;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
* @Author makejava
|
||||||
|
* @Date 2026-01-06 08:47:20
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UserCertificateUpdateCmd extends Command {
|
||||||
|
@ApiModelProperty(value = "主键id", name = "id", required = true)
|
||||||
|
@NotNull(message = "主键id不能为空")
|
||||||
|
private Long id;
|
||||||
|
@ApiModelProperty(value = "业务主键id", name = "userCertificateId", required = true)
|
||||||
|
@NotEmpty(message = "业务主键id不能为空")
|
||||||
|
private String userCertificateId;
|
||||||
|
@ApiModelProperty(value = "企业id", name = "corpinfoId", required = true)
|
||||||
|
@NotNull(message = "企业id不能为空")
|
||||||
|
private Long corpinfoId;
|
||||||
|
@ApiModelProperty(value = "用户id", name = "userId", required = true)
|
||||||
|
@NotNull(message = "用户id不能为空")
|
||||||
|
private Long userId;
|
||||||
|
@ApiModelProperty(value = "1-特种作业,2-特种设备,3-主要负责人,4-安全生产管理人员", name = "type", required = true)
|
||||||
|
@NotNull(message = "1-特种作业,2-特种设备,3-主要负责人,4-安全生产管理人员不能为空")
|
||||||
|
private Integer type;
|
||||||
|
@ApiModelProperty(value = "证书名称", name = "certificateName", required = true)
|
||||||
|
@NotEmpty(message = "证书名称不能为空")
|
||||||
|
private String certificateName;
|
||||||
|
@ApiModelProperty(value = "证书编号", name = "certificateCode", required = true)
|
||||||
|
@NotEmpty(message = "证书编号不能为空")
|
||||||
|
private String certificateCode;
|
||||||
|
@ApiModelProperty(value = "发证机构", name = "issuingAuthority", required = true)
|
||||||
|
@NotEmpty(message = "发证机构不能为空")
|
||||||
|
private String issuingAuthority;
|
||||||
|
@ApiModelProperty(value = "行业类别code-特种作业使用", name = "industryCategoryCode", required = true)
|
||||||
|
// @NotEmpty(message = "行业类别code-特种作业使用不能为空")
|
||||||
|
private String industryCategoryCode;
|
||||||
|
@ApiModelProperty(value = "行业类别名称-特种作业使用", name = "industryCategoryName", required = true)
|
||||||
|
// @NotEmpty(message = "行业类别名称-特种作业使用不能为空")
|
||||||
|
private String industryCategoryName;
|
||||||
|
@ApiModelProperty(value = "行业类别-操作项目code-特种作业使用", name = "industryOperatingItemsCode", required = true)
|
||||||
|
// @NotEmpty(message = "行业类别-操作项目code-特种作业使用不能为空")
|
||||||
|
private String industryOperatingItemsCode;
|
||||||
|
@ApiModelProperty(value = "行业类别-操作项目名称-特种作业使用", name = "industryOperatingItemsName", required = true)
|
||||||
|
// @NotEmpty(message = "行业类别-操作项目名称-特种作业使用不能为空")
|
||||||
|
private String industryOperatingItemsName;
|
||||||
|
@ApiModelProperty(value = "作业类别code-特种设备使用", name = "assignmentCategoryCode", required = true)
|
||||||
|
// @NotEmpty(message = "作业类别code-特种设备使用不能为空")
|
||||||
|
private String assignmentCategoryCode;
|
||||||
|
@ApiModelProperty(value = "作业类别名称-特种设备使用", name = "assignmentCategoryName", required = true)
|
||||||
|
// @NotEmpty(message = "作业类别名称-特种设备使用不能为空")
|
||||||
|
private String assignmentCategoryName;
|
||||||
|
@ApiModelProperty(value = "作业类别-操作项目code-特种设备使用", name = "assignmentOperatingItemsCode", required = true)
|
||||||
|
// @NotEmpty(message = "作业类别-操作项目code-特种设备使用不能为空")
|
||||||
|
private String assignmentOperatingItemsCode;
|
||||||
|
@ApiModelProperty(value = "作业类别-操作项目名称-特种设备使用", name = "assignmentOperatingItemsName", required = true)
|
||||||
|
// @NotEmpty(message = "作业类别-操作项目名称-特种设备使用不能为空")
|
||||||
|
private String assignmentOperatingItemsName;
|
||||||
|
@ApiModelProperty(value = "岗位名称(未定)-主要负责人和安全生产使用", name = "postName", required = true)
|
||||||
|
// @NotEmpty(message = "岗位名称(未定)-主要负责人和安全生产使用不能为空")
|
||||||
|
private String postName;
|
||||||
|
@ApiModelProperty(value = "发证日期", name = "dateIssue", required = true)
|
||||||
|
@NotNull(message = "发证日期不能为空")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private LocalDate dateIssue;
|
||||||
|
@ApiModelProperty(value = "证书有效期-开始时间", name = "certificateDateStart", required = true)
|
||||||
|
@NotNull(message = "证书有效期-开始时间不能为空")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private LocalDate certificateDateStart;
|
||||||
|
@ApiModelProperty(value = "证书有效期-结束时间", name = "certificateDateEnd", required = true)
|
||||||
|
@NotNull(message = "证书有效期-结束时间不能为空")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private LocalDate certificateDateEnd;
|
||||||
|
@ApiModelProperty(value = "复审日期", name = "reviewDate", required = true)
|
||||||
|
@NotNull(message = "复审日期不能为空")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private LocalDate reviewDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.zcloud.certificate.dto.clientobject;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CertificateStatisticsCO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业ID", name = "corpId")
|
||||||
|
private Long corpId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业名称", name = "corpName")
|
||||||
|
private String corpName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业类型", name = "corpType")
|
||||||
|
private Integer corpType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "证照数量", name = "certCount")
|
||||||
|
private Long certCount;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,140 @@
|
||||||
|
package com.zcloud.certificate.dto.clientobject;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.ClientObject;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
* @Author makejava
|
||||||
|
* @Date 2026-01-06 08:47:20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserCertificateCO extends ClientObject {
|
||||||
|
//主键id
|
||||||
|
@ApiModelProperty(value = "主键id")
|
||||||
|
private Long id;
|
||||||
|
//业务主键id
|
||||||
|
@ApiModelProperty(value = "业务主键id")
|
||||||
|
private String userCertificateId;
|
||||||
|
//企业id
|
||||||
|
@ApiModelProperty(value = "企业id")
|
||||||
|
private Long corpinfoId;
|
||||||
|
//用户id
|
||||||
|
@ApiModelProperty(value = "用户id")
|
||||||
|
private Long userId;
|
||||||
|
@ApiModelProperty(value = "用户名称")
|
||||||
|
private String userName;
|
||||||
|
@ApiModelProperty(value = "在职状态 0-离职, 1-在职, 2-信息变更中, 3-未入职, 4-实习生, 5-实习结束, 6-退休, 7-劳务派遣, 8-劳务派遣结束, 11-入职待审核, 10-离职待审核")
|
||||||
|
private Integer employmentStatus;
|
||||||
|
//1-特种作业,2-特种设备,3-主要负责人,4-安全生产管理人员
|
||||||
|
@ApiModelProperty(value = "1-特种作业,2-特种设备,3-主要负责人,4-安全生产管理人员")
|
||||||
|
private Integer type;
|
||||||
|
//证书名称
|
||||||
|
@ApiModelProperty(value = "证书名称")
|
||||||
|
private String certificateName;
|
||||||
|
//证书编号
|
||||||
|
@ApiModelProperty(value = "证书编号")
|
||||||
|
private String certificateCode;
|
||||||
|
//发证机构
|
||||||
|
@ApiModelProperty(value = "发证机构")
|
||||||
|
private String issuingAuthority;
|
||||||
|
//行业类别code-特种作业使用
|
||||||
|
@ApiModelProperty(value = "行业类别code-特种作业使用")
|
||||||
|
private String industryCategoryCode;
|
||||||
|
//行业类别名称-特种作业使用
|
||||||
|
@ApiModelProperty(value = "行业类别名称-特种作业使用")
|
||||||
|
private String industryCategoryName;
|
||||||
|
//行业类别-操作项目code-特种作业使用
|
||||||
|
@ApiModelProperty(value = "行业类别-操作项目code-特种作业使用")
|
||||||
|
private String industryOperatingItemsCode;
|
||||||
|
//行业类别-操作项目名称-特种作业使用
|
||||||
|
@ApiModelProperty(value = "行业类别-操作项目名称-特种作业使用")
|
||||||
|
private String industryOperatingItemsName;
|
||||||
|
//作业类别code-特种设备使用
|
||||||
|
@ApiModelProperty(value = "作业类别code-特种设备使用")
|
||||||
|
private String assignmentCategoryCode;
|
||||||
|
//作业类别名称-特种设备使用
|
||||||
|
@ApiModelProperty(value = "作业类别名称-特种设备使用")
|
||||||
|
private String assignmentCategoryName;
|
||||||
|
//作业类别-操作项目code-特种设备使用
|
||||||
|
@ApiModelProperty(value = "作业类别-操作项目code-特种设备使用")
|
||||||
|
private String assignmentOperatingItemsCode;
|
||||||
|
//作业类别-操作项目名称-特种设备使用
|
||||||
|
@ApiModelProperty(value = "作业类别-操作项目名称-特种设备使用")
|
||||||
|
private String assignmentOperatingItemsName;
|
||||||
|
//岗位名称(未定)-主要负责人和安全生产使用
|
||||||
|
@ApiModelProperty(value = "岗位名称(未定)-主要负责人和安全生产使用")
|
||||||
|
private String postName;
|
||||||
|
//发证日期
|
||||||
|
@ApiModelProperty(value = "发证日期")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private LocalDate dateIssue;
|
||||||
|
//证书有效期-开始时间
|
||||||
|
@ApiModelProperty(value = "证书有效期-开始时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private LocalDate certificateDateStart;
|
||||||
|
//证书有效期-结束时间
|
||||||
|
@ApiModelProperty(value = "证书有效期-结束时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private LocalDate certificateDateEnd;
|
||||||
|
//复审日期
|
||||||
|
@ApiModelProperty(value = "复审日期")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private LocalDate reviewDate;
|
||||||
|
//删除标识true false
|
||||||
|
@ApiModelProperty(value = "删除标识true false")
|
||||||
|
private String deleteEnum;
|
||||||
|
//备注
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String remarks;
|
||||||
|
//创建人姓名
|
||||||
|
@ApiModelProperty(value = "创建人姓名")
|
||||||
|
private String createName;
|
||||||
|
//更新人姓名
|
||||||
|
@ApiModelProperty(value = "更新人姓名")
|
||||||
|
private String updateName;
|
||||||
|
//租户id
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Long tenantId;
|
||||||
|
//单位id
|
||||||
|
@ApiModelProperty(value = "单位id")
|
||||||
|
private Long orgId;
|
||||||
|
//版本
|
||||||
|
@ApiModelProperty(value = "版本")
|
||||||
|
private Integer version;
|
||||||
|
//创建时间
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date createTime;
|
||||||
|
//修改时间
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date updateTime;
|
||||||
|
//创建人id
|
||||||
|
@ApiModelProperty(value = "创建人id")
|
||||||
|
private Long createId;
|
||||||
|
//修改人id
|
||||||
|
@ApiModelProperty(value = "修改人id")
|
||||||
|
private Long updateId;
|
||||||
|
//环境
|
||||||
|
@ApiModelProperty(value = "环境")
|
||||||
|
private String env;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "部门名称")
|
||||||
|
private String departmentName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业名称")
|
||||||
|
private String corpinfoName;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.zcloud.certificate.dto.clientobject;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class UserCertificateStatCO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业/相关方ID")
|
||||||
|
private Long corpinfoId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业/相关方名称")
|
||||||
|
private String corpName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "特种作业人员证书数量")
|
||||||
|
private Integer specialWorkCertCount;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "特种设备人证书数量")
|
||||||
|
private Integer specialEquipmentCertCount;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主要负责人证书数量")
|
||||||
|
private Integer principalCertCount;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "安全管理人员证书数量")
|
||||||
|
private Integer safetyManagerCertCount;
|
||||||
|
}
|
||||||
|
|
@ -26,5 +26,10 @@ public interface CorpCertificateGateway {
|
||||||
Boolean deletedCorpCertificateById(Long id);
|
Boolean deletedCorpCertificateById(Long id);
|
||||||
|
|
||||||
Boolean deletedCorpCertificateByIds(Long[] id);
|
Boolean deletedCorpCertificateByIds(Long[] id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据证书编号校验证书是否存在
|
||||||
|
*/
|
||||||
|
Boolean checkCertificateExist(CorpCertificateE corpCertificateE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
package com.zcloud.certificate.domain.gateway;
|
||||||
|
|
||||||
|
import com.zcloud.certificate.domain.model.UserCertificateE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-domain
|
||||||
|
* @Author makejava
|
||||||
|
* @Date 2026-01-06 08:47:20
|
||||||
|
*/
|
||||||
|
public interface UserCertificateGateway {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
Boolean add(UserCertificateE userCertificateE) ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
Boolean update(UserCertificateE userCertificateE);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
Boolean deletedUserCertificateById(Long id);
|
||||||
|
Boolean deletedUserCertificateByIds(Long[] id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据证书编号校验证书是否存在
|
||||||
|
*/
|
||||||
|
Boolean checkCertificateExist(UserCertificateE userCertificateE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.zcloud.certificate.domain.model;
|
||||||
import com.jjb.saas.framework.domain.model.BaseE;
|
import com.jjb.saas.framework.domain.model.BaseE;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -24,9 +25,9 @@ public class CorpCertificateE extends BaseE {
|
||||||
//证书编号
|
//证书编号
|
||||||
private String certificateCode;
|
private String certificateCode;
|
||||||
//证书有效期-开始时间
|
//证书有效期-开始时间
|
||||||
private Date certificateDateStart;
|
private LocalDate certificateDateStart;
|
||||||
//证书有效期-结束时间
|
//证书有效期-结束时间
|
||||||
private Date certificateDateEnd;
|
private LocalDate certificateDateEnd;
|
||||||
//备注
|
//备注
|
||||||
private String remark;
|
private String remark;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,59 @@
|
||||||
|
package com.zcloud.certificate.domain.model;
|
||||||
|
|
||||||
|
import com.alibaba.cola.domain.Entity;
|
||||||
|
import com.jjb.saas.framework.domain.model.BaseE;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.sql.Date;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-domain
|
||||||
|
* @Author makejava
|
||||||
|
* @Date 2026-01-06 08:47:20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserCertificateE extends BaseE {
|
||||||
|
//业务主键id
|
||||||
|
private String userCertificateId;
|
||||||
|
//企业id
|
||||||
|
private Long corpinfoId;
|
||||||
|
//用户id
|
||||||
|
private Long userId;
|
||||||
|
//1-特种作业,2-特种设备,3-主要负责人,4-安全生产管理人员
|
||||||
|
private Integer type;
|
||||||
|
//证书名称
|
||||||
|
private String certificateName;
|
||||||
|
//证书编号
|
||||||
|
private String certificateCode;
|
||||||
|
//发证机构
|
||||||
|
private String issuingAuthority;
|
||||||
|
//行业类别code-特种作业使用
|
||||||
|
private String industryCategoryCode;
|
||||||
|
//行业类别名称-特种作业使用
|
||||||
|
private String industryCategoryName;
|
||||||
|
//行业类别-操作项目code-特种作业使用
|
||||||
|
private String industryOperatingItemsCode;
|
||||||
|
//行业类别-操作项目名称-特种作业使用
|
||||||
|
private String industryOperatingItemsName;
|
||||||
|
//作业类别code-特种设备使用
|
||||||
|
private String assignmentCategoryCode;
|
||||||
|
//作业类别名称-特种设备使用
|
||||||
|
private String assignmentCategoryName;
|
||||||
|
//作业类别-操作项目code-特种设备使用
|
||||||
|
private String assignmentOperatingItemsCode;
|
||||||
|
//作业类别-操作项目名称-特种设备使用
|
||||||
|
private String assignmentOperatingItemsName;
|
||||||
|
//岗位名称(未定)-主要负责人和安全生产使用
|
||||||
|
private String postName;
|
||||||
|
//发证日期
|
||||||
|
private LocalDate dateIssue;
|
||||||
|
//证书有效期-开始时间
|
||||||
|
private LocalDate certificateDateStart;
|
||||||
|
//证书有效期-结束时间
|
||||||
|
private LocalDate certificateDateEnd;
|
||||||
|
//复审日期
|
||||||
|
private LocalDate reviewDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.zcloud.certificate.gatewayimpl;
|
package com.zcloud.certificate.gatewayimpl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.zcloud.certificate.domain.gateway.CorpCertificateGateway;
|
import com.zcloud.certificate.domain.gateway.CorpCertificateGateway;
|
||||||
import com.zcloud.certificate.domain.model.CorpCertificateE;
|
import com.zcloud.certificate.domain.model.CorpCertificateE;
|
||||||
import com.zcloud.certificate.persistence.dataobject.CorpCertificateDO;
|
import com.zcloud.certificate.persistence.dataobject.CorpCertificateDO;
|
||||||
|
|
@ -8,6 +9,7 @@ import lombok.AllArgsConstructor;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -44,7 +46,17 @@ public class CorpCertificateGatewayImpl implements CorpCertificateGateway {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean deletedCorpCertificateByIds(Long[] ids) {
|
public Boolean deletedCorpCertificateByIds(Long[] ids) {
|
||||||
return corpCertificateRepository.removeByIds(Collections.singletonList(ids));
|
return corpCertificateRepository.removeByIds(Arrays.asList(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean checkCertificateExist(CorpCertificateE corpCertificateE) {
|
||||||
|
CorpCertificateDO d = new CorpCertificateDO();
|
||||||
|
BeanUtils.copyProperties(corpCertificateE, d);
|
||||||
|
CorpCertificateDO queryDO = corpCertificateRepository.getOne(new LambdaQueryWrapper<CorpCertificateDO>()
|
||||||
|
.eq(CorpCertificateDO::getCertificateCode, d.getCertificateCode())
|
||||||
|
);
|
||||||
|
return queryDO == null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,59 @@
|
||||||
|
package com.zcloud.certificate.gatewayimpl;
|
||||||
|
|
||||||
|
import com.zcloud.certificate.domain.gateway.UserCertificateGateway;
|
||||||
|
import com.zcloud.certificate.domain.model.UserCertificateE;
|
||||||
|
import com.zcloud.certificate.persistence.dataobject.UserCertificateDO;
|
||||||
|
import com.zcloud.certificate.persistence.repository.UserCertificateRepository;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import com.zcloud.gbscommon.utils.Tools;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-infrastructure
|
||||||
|
* @Author makejava
|
||||||
|
* @Date 2026-01-06 08:47:20
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UserCertificateGatewayImpl implements UserCertificateGateway {
|
||||||
|
private final UserCertificateRepository userCertificateRepository;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean add(UserCertificateE userCertificateE) {
|
||||||
|
UserCertificateDO d = new UserCertificateDO(Tools.get32UUID());
|
||||||
|
BeanUtils.copyProperties(userCertificateE, d,"userCertificateId");
|
||||||
|
userCertificateRepository.save(d);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean update(UserCertificateE userCertificateE) {
|
||||||
|
UserCertificateDO d = new UserCertificateDO();
|
||||||
|
BeanUtils.copyProperties(userCertificateE, d);
|
||||||
|
userCertificateRepository.updateById(d);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deletedUserCertificateById(Long id) {
|
||||||
|
return userCertificateRepository.removeById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deletedUserCertificateByIds(Long[] ids) {
|
||||||
|
return userCertificateRepository.removeByIds(Arrays.asList(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean checkCertificateExist(UserCertificateE userCertificateE) {
|
||||||
|
Long count = userCertificateRepository.lambdaQuery()
|
||||||
|
.eq(UserCertificateDO::getCertificateCode, userCertificateE.getCertificateCode())
|
||||||
|
.ne(userCertificateE.getUserCertificateId() != null, UserCertificateDO::getUserCertificateId, userCertificateE.getUserCertificateId())
|
||||||
|
.count();
|
||||||
|
return count > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -34,10 +35,10 @@ public class CorpCertificateDO extends BaseDO {
|
||||||
private String certificateCode;
|
private String certificateCode;
|
||||||
//证书有效期-开始时间
|
//证书有效期-开始时间
|
||||||
@ApiModelProperty(value = "证书有效期-开始时间")
|
@ApiModelProperty(value = "证书有效期-开始时间")
|
||||||
private Date certificateDateStart;
|
private LocalDate certificateDateStart;
|
||||||
//证书有效期-结束时间
|
//证书有效期-结束时间
|
||||||
@ApiModelProperty(value = "证书有效期-结束时间")
|
@ApiModelProperty(value = "证书有效期-结束时间")
|
||||||
private Date certificateDateEnd;
|
private LocalDate certificateDateEnd;
|
||||||
//备注
|
//备注
|
||||||
@ApiModelProperty(value = "备注")
|
@ApiModelProperty(value = "备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.zcloud.certificate.persistence.dataobject;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.jjb.saas.framework.repository.basedo.BaseDO;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName("corp_info")
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class CorpInfoDO extends BaseDO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业ID")
|
||||||
|
private Long corpId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业名称")
|
||||||
|
private String corpName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业类型")
|
||||||
|
private Integer corpType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "证照数量")
|
||||||
|
private Long certCount;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "总数量")
|
||||||
|
private Long totalCount;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,95 @@
|
||||||
|
package com.zcloud.certificate.persistence.dataobject;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.jjb.saas.framework.repository.basedo.BaseDO;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-infrastructure
|
||||||
|
* @Author makejava
|
||||||
|
* @Date 2026-01-06 08:47:20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("user_certificate")
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class UserCertificateDO extends BaseDO {
|
||||||
|
//业务主键id
|
||||||
|
@ApiModelProperty(value = "业务主键id")
|
||||||
|
private String userCertificateId;
|
||||||
|
//企业id
|
||||||
|
@ApiModelProperty(value = "企业id")
|
||||||
|
private Long corpinfoId;
|
||||||
|
//用户id
|
||||||
|
@ApiModelProperty(value = "用户id")
|
||||||
|
private Long userId;
|
||||||
|
//1-特种作业,2-特种设备,3-主要负责人,4-安全生产管理人员
|
||||||
|
@ApiModelProperty(value = "1-特种作业,2-特种设备,3-主要负责人,4-安全生产管理人员")
|
||||||
|
private Integer type;
|
||||||
|
//证书名称
|
||||||
|
@ApiModelProperty(value = "证书名称")
|
||||||
|
private String certificateName;
|
||||||
|
//证书编号
|
||||||
|
@ApiModelProperty(value = "证书编号")
|
||||||
|
private String certificateCode;
|
||||||
|
//发证机构
|
||||||
|
@ApiModelProperty(value = "发证机构")
|
||||||
|
private String issuingAuthority;
|
||||||
|
//行业类别code-特种作业使用
|
||||||
|
@ApiModelProperty(value = "行业类别code-特种作业使用")
|
||||||
|
private String industryCategoryCode;
|
||||||
|
//行业类别名称-特种作业使用
|
||||||
|
@ApiModelProperty(value = "行业类别名称-特种作业使用")
|
||||||
|
private String industryCategoryName;
|
||||||
|
//行业类别-操作项目code-特种作业使用
|
||||||
|
@ApiModelProperty(value = "行业类别-操作项目code-特种作业使用")
|
||||||
|
private String industryOperatingItemsCode;
|
||||||
|
//行业类别-操作项目名称-特种作业使用
|
||||||
|
@ApiModelProperty(value = "行业类别-操作项目名称-特种作业使用")
|
||||||
|
private String industryOperatingItemsName;
|
||||||
|
//作业类别code-特种设备使用
|
||||||
|
@ApiModelProperty(value = "作业类别code-特种设备使用")
|
||||||
|
private String assignmentCategoryCode;
|
||||||
|
//作业类别名称-特种设备使用
|
||||||
|
@ApiModelProperty(value = "作业类别名称-特种设备使用")
|
||||||
|
private String assignmentCategoryName;
|
||||||
|
//作业类别-操作项目code-特种设备使用
|
||||||
|
@ApiModelProperty(value = "作业类别-操作项目code-特种设备使用")
|
||||||
|
private String assignmentOperatingItemsCode;
|
||||||
|
//作业类别-操作项目名称-特种设备使用
|
||||||
|
@ApiModelProperty(value = "作业类别-操作项目名称-特种设备使用")
|
||||||
|
private String assignmentOperatingItemsName;
|
||||||
|
//岗位名称(未定)-主要负责人和安全生产使用
|
||||||
|
@ApiModelProperty(value = "岗位名称(未定)-主要负责人和安全生产使用")
|
||||||
|
private String postName;
|
||||||
|
//发证日期
|
||||||
|
@ApiModelProperty(value = "发证日期")
|
||||||
|
private LocalDate dateIssue;
|
||||||
|
//证书有效期-开始时间
|
||||||
|
@ApiModelProperty(value = "证书有效期-开始时间")
|
||||||
|
private LocalDate certificateDateStart;
|
||||||
|
//证书有效期-结束时间
|
||||||
|
@ApiModelProperty(value = "证书有效期-结束时间")
|
||||||
|
private LocalDate certificateDateEnd;
|
||||||
|
//复审日期
|
||||||
|
@ApiModelProperty(value = "复审日期")
|
||||||
|
private LocalDate reviewDate;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户名称")
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "在职状态 0-离职, 1-在职, 2-信息变更中, 3-未入职, 4-实习生, 5-实习结束, 6-退休, 7-劳务派遣, 8-劳务派遣结束, 11-入职待审核, 10-离职待审核")
|
||||||
|
private Integer employmentStatus;
|
||||||
|
|
||||||
|
public UserCertificateDO(String userCertificateId) {
|
||||||
|
this.userCertificateId = userCertificateId;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.zcloud.certificate.persistence.dataobject;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class UserCertificateStatDO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业/相关方ID")
|
||||||
|
private Long corpinfoId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业/相关方名称")
|
||||||
|
private String corpName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "特种作业人员证书数量")
|
||||||
|
private Integer specialWorkCertCount;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "特种设备人证书数量")
|
||||||
|
private Integer specialEquipmentCertCount;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主要负责人证书数量")
|
||||||
|
private Integer principalCertCount;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "安全管理人员证书数量")
|
||||||
|
private Integer safetyManagerCertCount;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.zcloud.certificate.persistence.dataobject;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class UserDO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户名称")
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "在职状态 0-离职, 1-在职, 2-信息变更中, 3-未入职, 4-实习生, 5-实习结束, 6-退休, 7-劳务派遣, 8-劳务派遣结束, 11-入职待审核, 10-离职待审核")
|
||||||
|
private Integer employmentStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "部门名称")
|
||||||
|
private String departmentName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业名称")
|
||||||
|
private String corpinfoName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "岗位名称")
|
||||||
|
private String postName;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -2,8 +2,12 @@ package com.zcloud.certificate.persistence.mapper;
|
||||||
|
|
||||||
import com.zcloud.certificate.persistence.dataobject.CorpCertificateDO;
|
import com.zcloud.certificate.persistence.dataobject.CorpCertificateDO;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.zcloud.certificate.persistence.dataobject.CorpInfoDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web-infrastructure
|
* web-infrastructure
|
||||||
*
|
*
|
||||||
|
|
@ -13,5 +17,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface CorpCertificateMapper extends BaseMapper<CorpCertificateDO> {
|
public interface CorpCertificateMapper extends BaseMapper<CorpCertificateDO> {
|
||||||
|
|
||||||
|
List<CorpInfoDO> selectCorpCertStatPage(Map<String, Object> params);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.zcloud.certificate.persistence.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.zcloud.certificate.persistence.dataobject.UserCertificateDO;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.zcloud.certificate.persistence.dataobject.UserCertificateStatDO;
|
||||||
|
import com.zcloud.certificate.persistence.dataobject.UserDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-infrastructure
|
||||||
|
* @Author makejava
|
||||||
|
* @Date 2026-01-06 08:47:20
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface UserCertificateMapper extends BaseMapper<UserCertificateDO> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据批量userId查询用户名称
|
||||||
|
*/
|
||||||
|
List<UserDO> selectUserNamesByUserIds(List<Long> userIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询用户证书信息,包含用户名称
|
||||||
|
*/
|
||||||
|
IPage<UserCertificateDO> selectPageWithUser(IPage<UserCertificateDO> page, @Param("params") Map<String, Object> params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据企业/相关方类型查询各企业/相关方各类人员证书数量
|
||||||
|
*/
|
||||||
|
IPage<UserCertificateStatDO> selectCorpCertificateStatPage(IPage<UserCertificateStatDO> page, @Param("params") Map<String, Object> params);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -4,6 +4,7 @@ import com.zcloud.certificate.persistence.dataobject.CorpCertificateDO;
|
||||||
import com.alibaba.cola.dto.SingleResponse;
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
import com.alibaba.cola.dto.PageResponse;
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
import com.jjb.saas.framework.repository.repo.BaseRepository;
|
import com.jjb.saas.framework.repository.repo.BaseRepository;
|
||||||
|
import com.zcloud.certificate.persistence.dataobject.CorpInfoDO;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -21,5 +22,7 @@ public interface CorpCertificateRepository extends BaseRepository<CorpCertificat
|
||||||
List<CorpCertificateDO> list(Map<String, Object> params);
|
List<CorpCertificateDO> list(Map<String, Object> params);
|
||||||
|
|
||||||
SingleResponse<CorpCertificateDO> getInfoById(Long id);
|
SingleResponse<CorpCertificateDO> getInfoById(Long id);
|
||||||
|
|
||||||
|
PageResponse<CorpInfoDO> statPage(Map<String, Object> params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.zcloud.certificate.persistence.repository;
|
||||||
|
|
||||||
|
import com.zcloud.certificate.persistence.dataobject.UserCertificateDO;
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.jjb.saas.framework.repository.repo.BaseRepository;
|
||||||
|
import com.zcloud.certificate.persistence.dataobject.UserCertificateStatDO;
|
||||||
|
import com.zcloud.certificate.persistence.dataobject.UserDO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-infrastructure
|
||||||
|
* @Author makejava
|
||||||
|
* @Date 2026-01-06 08:47:20
|
||||||
|
*/
|
||||||
|
public interface UserCertificateRepository extends BaseRepository<UserCertificateDO> {
|
||||||
|
PageResponse<UserCertificateDO> listPage(Map<String,Object> params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据批量userId查询用户名称
|
||||||
|
*/
|
||||||
|
List<UserDO> getUserNamesByUserIds(List<Long> userIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询包含用户信息
|
||||||
|
*/
|
||||||
|
IPage<UserCertificateDO> listPageWithUser(IPage<UserCertificateDO> page, Map<String, Object> params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据企业/相关方类型查询各企业/相关方各类人员证书数量
|
||||||
|
*/
|
||||||
|
IPage<UserCertificateStatDO> selectCorpCertificateStatPage(
|
||||||
|
IPage<UserCertificateStatDO> page,
|
||||||
|
@Param("params") Map<String, Object> params
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.zcloud.certificate.persistence.repository.impl;
|
||||||
|
|
||||||
import com.jjb.saas.framework.repository.common.PageHelper;
|
import com.jjb.saas.framework.repository.common.PageHelper;
|
||||||
import com.zcloud.certificate.persistence.dataobject.CorpCertificateDO;
|
import com.zcloud.certificate.persistence.dataobject.CorpCertificateDO;
|
||||||
|
import com.zcloud.certificate.persistence.dataobject.CorpInfoDO;
|
||||||
import com.zcloud.certificate.persistence.mapper.CorpCertificateMapper;
|
import com.zcloud.certificate.persistence.mapper.CorpCertificateMapper;
|
||||||
import com.zcloud.certificate.persistence.repository.CorpCertificateRepository;
|
import com.zcloud.certificate.persistence.repository.CorpCertificateRepository;
|
||||||
import com.alibaba.cola.dto.SingleResponse;
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
|
|
@ -51,5 +52,18 @@ public class CorpCertificateRepositoryImpl extends BaseRepositoryImpl<CorpCertif
|
||||||
public SingleResponse<CorpCertificateDO> getInfoById(Long id) {
|
public SingleResponse<CorpCertificateDO> getInfoById(Long id) {
|
||||||
return SingleResponse.of(corpCertificateMapper.selectById(id));
|
return SingleResponse.of(corpCertificateMapper.selectById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResponse<CorpInfoDO> statPage(Map<String, Object> params) {
|
||||||
|
Integer pageIndex = (Integer) params.get("pageIndex");
|
||||||
|
Integer pageSize = (Integer) params.get("pageSize");
|
||||||
|
params.put("offset", (pageIndex - 1) * pageSize);
|
||||||
|
|
||||||
|
List<CorpInfoDO> rows = corpCertificateMapper.selectCorpCertStatPage(params);
|
||||||
|
|
||||||
|
long total = rows.isEmpty() ? 0 : rows.get(0).getTotalCount();
|
||||||
|
|
||||||
|
return PageResponse.of(rows, (int)total, pageSize, pageIndex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
package com.zcloud.certificate.persistence.repository.impl;
|
||||||
|
|
||||||
|
import com.zcloud.certificate.persistence.dataobject.UserCertificateDO;
|
||||||
|
import com.zcloud.certificate.persistence.dataobject.UserCertificateStatDO;
|
||||||
|
import com.zcloud.certificate.persistence.dataobject.UserDO;
|
||||||
|
import com.zcloud.certificate.persistence.mapper.UserCertificateMapper;
|
||||||
|
import com.zcloud.certificate.persistence.repository.UserCertificateRepository;
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import com.jjb.saas.framework.repository.common.PageHelper;
|
||||||
|
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||||
|
import com.zcloud.gbscommon.utils.Query;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-infrastructure
|
||||||
|
* @Author makejava
|
||||||
|
* @Date 2026-01-06 08:47:20
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class UserCertificateRepositoryImpl extends BaseRepositoryImpl<UserCertificateMapper, UserCertificateDO> implements UserCertificateRepository {
|
||||||
|
private final UserCertificateMapper userCertificateMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResponse<UserCertificateDO> listPage(Map<String,Object> params) {
|
||||||
|
IPage<UserCertificateDO> iPage = new Query<UserCertificateDO>().getPage(params);
|
||||||
|
QueryWrapper<UserCertificateDO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
||||||
|
queryWrapper.orderByDesc("create_time");
|
||||||
|
IPage<UserCertificateDO> result = userCertificateMapper.selectPage(iPage, queryWrapper);
|
||||||
|
return PageHelper.pageToResponse(result, result.getRecords());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<UserDO> getUserNamesByUserIds(List<Long> userIds) {
|
||||||
|
return userCertificateMapper.selectUserNamesByUserIds(userIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<UserCertificateDO> listPageWithUser(IPage<UserCertificateDO> page, Map<String, Object> params) {
|
||||||
|
return userCertificateMapper.selectPageWithUser(page, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<UserCertificateStatDO> selectCorpCertificateStatPage(IPage<UserCertificateStatDO> page, Map<String, Object> params) {
|
||||||
|
return userCertificateMapper.selectCorpCertificateStatPage(page, params);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -3,5 +3,42 @@
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
<mapper namespace="com.zcloud.certificate.persistence.mapper.CorpCertificateMapper">
|
<mapper namespace="com.zcloud.certificate.persistence.mapper.CorpCertificateMapper">
|
||||||
</mapper>
|
|
||||||
|
|
||||||
|
<select id="selectCorpCertStatPage" resultType="com.zcloud.certificate.persistence.dataobject.CorpInfoDO">
|
||||||
|
SELECT
|
||||||
|
ci.id AS corpId,
|
||||||
|
ci.corp_name AS corpName,
|
||||||
|
ci.type AS corpType,
|
||||||
|
COUNT(cc.id) AS certCount,
|
||||||
|
COUNT(*) OVER() AS totalCount
|
||||||
|
FROM
|
||||||
|
corp_info ci
|
||||||
|
LEFT JOIN
|
||||||
|
corp_certificate cc
|
||||||
|
ON
|
||||||
|
cc.corpinfo_id = ci.id
|
||||||
|
AND
|
||||||
|
(cc.delete_enum IS NULL OR cc.delete_enum <> 'true')
|
||||||
|
WHERE
|
||||||
|
1 = 1
|
||||||
|
<if test="corpType != null">
|
||||||
|
AND (
|
||||||
|
(#{corpType} = 0 AND ci.type IN (0,1))
|
||||||
|
OR (#{corpType} = 1 AND ci.type IN (3,4,5))
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="corpName != null and corpName != ''">
|
||||||
|
AND ci.corp_name LIKE CONCAT('%', #{corpName}, '%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
GROUP BY
|
||||||
|
ci.id, ci.corp_name, ci.type
|
||||||
|
ORDER BY
|
||||||
|
ci.id DESC
|
||||||
|
LIMIT #{offset}, #{pageSize}
|
||||||
|
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,132 @@
|
||||||
|
<?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.zcloud.certificate.persistence.mapper.UserCertificateMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectPageWithUser" resultType="com.zcloud.certificate.persistence.dataobject.UserCertificateDO">
|
||||||
|
SELECT
|
||||||
|
uc.*,
|
||||||
|
u.username AS userName,
|
||||||
|
u.employment_flag AS employmentStatus,
|
||||||
|
d.name AS departmentName,
|
||||||
|
p.corpinfo_name AS corpinfoName,
|
||||||
|
p.post_name AS postName
|
||||||
|
FROM
|
||||||
|
user_certificate uc
|
||||||
|
LEFT JOIN
|
||||||
|
user u ON u.id = uc.user_id
|
||||||
|
LEFT JOIN
|
||||||
|
department d ON d.id = u.department_id
|
||||||
|
LEFT JOIN
|
||||||
|
post p ON p.id = u.post_id
|
||||||
|
WHERE 1=1
|
||||||
|
<if test="params.tenantId != null">
|
||||||
|
AND uc.tenant_id = #{params.tenantId}
|
||||||
|
</if>
|
||||||
|
<if test="params.orgId != null">
|
||||||
|
AND uc.org_id = #{params.orgId}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="params.likeUserName != null and params.likeUserName != ''">
|
||||||
|
AND u.username LIKE CONCAT('%', #{params.likeUserName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="params.eqIndustryCategoryCode != null and params.eqIndustryCategoryCode != ''">
|
||||||
|
AND uc.industry_category_code = #{params.eqIndustryCategoryCode}
|
||||||
|
</if>
|
||||||
|
<if test="params.eqIndustryOperatingItemsCode != null and params.eqIndustryOperatingItemsCode != ''">
|
||||||
|
AND uc.industry_operating_items_code = #{params.eqIndustryOperatingItemsCode}
|
||||||
|
</if>
|
||||||
|
<if test="params.eqType != null and params.eqType != ''">
|
||||||
|
AND uc.type = #{params.eqType}
|
||||||
|
</if>
|
||||||
|
<if test="params.eqCorpinfoId != null and params.eqCorpinfoId != ''">
|
||||||
|
AND uc.corpinfo_id = #{params.eqCorpinfoId}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
ORDER BY uc.create_time DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectUserNamesByUserIds" resultType="com.zcloud.certificate.persistence.dataobject.UserDO">
|
||||||
|
SELECT
|
||||||
|
u.id AS userId,
|
||||||
|
u.name AS userName,
|
||||||
|
d.name AS departmentName,
|
||||||
|
p.corpinfo_name AS corpinfoName,
|
||||||
|
p.post_name AS postName,
|
||||||
|
u.employment_flag AS employmentStatus
|
||||||
|
FROM
|
||||||
|
user u
|
||||||
|
LEFT JOIN
|
||||||
|
department d ON d.id = u.department_id
|
||||||
|
LEFT JOIN
|
||||||
|
post p ON p.id = u.post_id
|
||||||
|
WHERE
|
||||||
|
u.id IN
|
||||||
|
<foreach item="userId" index="index" collection="userIds" open="(" separator="," close=")">
|
||||||
|
#{userId}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectCorpCertificateStatPage"
|
||||||
|
resultType="com.zcloud.certificate.persistence.dataobject.UserCertificateStatDO">
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
ci.id AS corpinfoId,
|
||||||
|
ci.corp_name AS corpName,
|
||||||
|
COALESCE(SUM(CASE WHEN uc.type = 1 THEN 1 ELSE 0 END), 0) AS specialWorkCertCount,
|
||||||
|
COALESCE(SUM(CASE WHEN uc.type = 2 THEN 1 ELSE 0 END), 0) AS specialEquipmentCertCount,
|
||||||
|
COALESCE(SUM(CASE WHEN uc.type = 3 THEN 1 ELSE 0 END), 0) AS principalCertCount,
|
||||||
|
COALESCE(SUM(CASE WHEN uc.type = 4 THEN 1 ELSE 0 END), 0) AS safetyManagerCertCount
|
||||||
|
FROM
|
||||||
|
corp_info ci
|
||||||
|
LEFT JOIN
|
||||||
|
user_certificate uc
|
||||||
|
ON
|
||||||
|
uc.corpinfo_id = ci.id
|
||||||
|
AND
|
||||||
|
uc.delete_enum = 'false'
|
||||||
|
<if test="params.tenantId != null">
|
||||||
|
AND uc.tenant_id = #{params.tenantId}
|
||||||
|
</if>
|
||||||
|
<if test="params.orgId != null">
|
||||||
|
AND uc.org_id = #{params.orgId}
|
||||||
|
</if>
|
||||||
|
<if test="params.env != null and params.env != ''">
|
||||||
|
AND uc.env = #{params.env}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
WHERE 1 = 1
|
||||||
|
AND ci.delete_enum = 'false'
|
||||||
|
|
||||||
|
<if test="params.tenantId != null">
|
||||||
|
AND ci.tenant_id = #{params.tenantId}
|
||||||
|
</if>
|
||||||
|
<if test="params.orgId != null">
|
||||||
|
AND ci.org_id = #{params.orgId}
|
||||||
|
</if>
|
||||||
|
<if test="params.env != null and params.env != ''">
|
||||||
|
AND ci.env = #{params.env}
|
||||||
|
</if>
|
||||||
|
<if test="params.useFlag != null">
|
||||||
|
AND ci.use_flag = #{params.useFlag}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="params.corpType != null">
|
||||||
|
AND (
|
||||||
|
(#{params.corpType} = 0 AND ci.type IN (0,1))
|
||||||
|
OR (#{params.corpType} = 1 AND ci.type IN (3,4,5))
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="params.corpName != null and params.corpName != ''">
|
||||||
|
AND ci.corp_name LIKE CONCAT('%', #{params.corpName}, '%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
GROUP BY ci.id, ci.corp_name
|
||||||
|
ORDER BY ci.corp_order ASC, ci.id ASC
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
|
|
||||||
Loading…
Reference in New Issue