incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/controller/WorkInjuryDeclarationController.java
对比新文件 @@ -0,0 +1,68 @@ package com.gkhy.safePlatform.incidentManage.controller; import com.gkhy.safePlatform.commons.co.ContextCacheUser; import com.gkhy.safePlatform.commons.query.PageQuery; import com.gkhy.safePlatform.commons.utils.PageUtils; import com.gkhy.safePlatform.commons.vo.ResultVO; import com.gkhy.safePlatform.incidentManage.model.dto.req.WorkInjuryDeclarationReqDTO; import com.gkhy.safePlatform.incidentManage.model.dto.resp.WorkInjuryDeclarationDetailRespDTO; import com.gkhy.safePlatform.incidentManage.model.dto.resp.WorkInjuryDeclarationPageRespDTO; import com.gkhy.safePlatform.incidentManage.query.WorkInjuryDeclarationQuery; import com.gkhy.safePlatform.incidentManage.service.WorkInjuryDeclarationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.Authentication; import org.springframework.web.bind.annotation.*; import java.util.List; @RestController @RequestMapping("/workInjuryDeclaration") public class WorkInjuryDeclarationController { @Autowired private WorkInjuryDeclarationService workInjuryDeclarationService; /** * 工商报告列表 */ @RequestMapping(value = "/page/list" ,method = RequestMethod.POST) private ResultVO<List<WorkInjuryDeclarationPageRespDTO>> list (@RequestBody PageQuery<WorkInjuryDeclarationQuery> pageQuery){ PageUtils.checkCheck(pageQuery.getPageIndex(), pageQuery.getPageSize()); return workInjuryDeclarationService.selectWorkInjuryDeclarationList(pageQuery); } /** * 工商报告新增 */ @RequestMapping(value = "/add",method = RequestMethod.POST) public ResultVO addworkInjuryDeclaration(Authentication authentication, @RequestBody WorkInjuryDeclarationReqDTO workInjuryDeclarationReqDTO) { ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); return workInjuryDeclarationService.addWorkInjuryDeclaration(currentUser.getUid(), workInjuryDeclarationReqDTO); } /** * 工商报告详情 */ @RequestMapping(value = "/info/{id}",method = RequestMethod.GET) public ResultVO<WorkInjuryDeclarationDetailRespDTO> getworkInjuryDeclarationById(@PathVariable("id")Long id){ return workInjuryDeclarationService.getWorkInjuryDeclarationById(id); } /** * 工商报告修改 */ @RequestMapping(value = "/update",method = RequestMethod.POST) public ResultVO updateworkInjuryDeclaration(Authentication authentication, @RequestBody WorkInjuryDeclarationReqDTO workInjuryDeclarationReqDTO) { ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); return workInjuryDeclarationService.updateWorkInjuryDeclaration(currentUser.getUid(), workInjuryDeclarationReqDTO); } /** * 工商报告删除/批量删除 */ @RequestMapping(value = "/batchDelete/{ids}",method = RequestMethod.GET) public ResultVO batchDeleteworkInjuryDeclaration(@PathVariable("ids")String ids){ return workInjuryDeclarationService.batchDeleteWorkInjuryDeclaration(ids); } } incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/entity/WorkInjuryDeclarationFileInfo.java
对比新文件 @@ -0,0 +1,116 @@ package com.gkhy.safePlatform.incidentManage.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.util.Date; @TableName("work_injury_declaration_file") public class WorkInjuryDeclarationFileInfo { @TableId(type = IdType.AUTO) private Long id; private Boolean delFlag; private Date gmtCreate; private Date gmtModitify; private Long createUid; private Long updateUid; private Long workInjuryDeclarationId; private String fileUrl; private String fileName; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Boolean getDelFlag() { return delFlag; } public void setDelFlag(Boolean delFlag) { this.delFlag = delFlag; } public Date getGmtCreate() { return gmtCreate; } public void setGmtCreate(Date gmtCreate) { this.gmtCreate = gmtCreate; } public Date getGmtModitify() { return gmtModitify; } public void setGmtModitify(Date gmtModitify) { this.gmtModitify = gmtModitify; } public Long getCreateUid() { return createUid; } public void setCreateUid(Long createUid) { this.createUid = createUid; } public Long getUpdateUid() { return updateUid; } public void setUpdateUid(Long updateUid) { this.updateUid = updateUid; } public String getFileUrl() { return fileUrl; } public void setFileUrl(String fileUrl) { this.fileUrl = fileUrl; } public String getFileName() { return fileName; } public void setFileName(String fileName) { this.fileName = fileName; } public Long getWorkInjuryDeclarationId() { return workInjuryDeclarationId; } public void setWorkInjuryDeclarationId(Long workInjuryDeclarationId) { this.workInjuryDeclarationId = workInjuryDeclarationId; } @Override public String toString() { return "AccidentReportFileInfo{" + "id=" + id + ", delFlag=" + delFlag + ", gmtCreate=" + gmtCreate + ", gmtModitify=" + gmtModitify + ", createUid=" + createUid + ", updateUid=" + updateUid + ", fileUrl='" + fileUrl + '\'' + ", fileName='" + fileName + '\'' + '}'; } } incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/entity/WorkInjuryDeclarationFileInfoDO.java
对比新文件 @@ -0,0 +1,60 @@ package com.gkhy.safePlatform.incidentManage.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; @TableName("work_injury_declaration_file") public class WorkInjuryDeclarationFileInfoDO { @TableId(type = IdType.AUTO) private Long id; private Long workInjuryDeclarationId; private String fileUrl; private String fileName; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Long getWorkInjuryDeclarationId() { return workInjuryDeclarationId; } public void setWorkInjuryDeclarationId(Long workInjuryDeclarationId) { this.workInjuryDeclarationId = workInjuryDeclarationId; } public String getFileUrl() { return fileUrl; } public void setFileUrl(String fileUrl) { this.fileUrl = fileUrl; } public String getFileName() { return fileName; } public void setFileName(String fileName) { this.fileName = fileName; } @Override public String toString() { return "WorkInjuryDeclarationFileInfoDO{" + "id=" + id + ", workInjuryDeclarationId=" + workInjuryDeclarationId + ", fileUrl='" + fileUrl + '\'' + ", fileName='" + fileName + '\'' + '}'; } } incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/entity/WorkInjuryDeclarationInfo.java
对比新文件 @@ -0,0 +1,193 @@ package com.gkhy.safePlatform.incidentManage.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.math.BigDecimal; import java.util.Date; @TableName("work_injury_declaration") public class WorkInjuryDeclarationInfo { @TableId(type = IdType.AUTO) private Long id; private Boolean delFlag; private Date gmtCreate; private Date gmtModitify; private Long createUid; private Long updateUid; private String declareUserName; private Boolean declareUserGender ; private Long declareDepartmentId; private Long accidentExpressId; private String workInjuryType; private Date declareDate; private BigDecimal lostTime; private String visitHospital; private String visitResult; private String mattersNeedingAttention; private Boolean completeMaterials ; private String remark; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Boolean getDelFlag() { return delFlag; } public void setDelFlag(Boolean delFlag) { this.delFlag = delFlag; } public Date getGmtCreate() { return gmtCreate; } public void setGmtCreate(Date gmtCreate) { this.gmtCreate = gmtCreate; } public Date getGmtModitify() { return gmtModitify; } public void setGmtModitify(Date gmtModitify) { this.gmtModitify = gmtModitify; } public Long getCreateUid() { return createUid; } public void setCreateUid(Long createUid) { this.createUid = createUid; } public Long getUpdateUid() { return updateUid; } public void setUpdateUid(Long updateUid) { this.updateUid = updateUid; } public String getDeclareUserName() { return declareUserName; } public void setDeclareUserName(String declareUserName) { this.declareUserName = declareUserName; } public Boolean getDeclareUserGender() { return declareUserGender; } public void setDeclareUserGender(Boolean declareUserGender) { this.declareUserGender = declareUserGender; } public Long getDeclareDepartmentId() { return declareDepartmentId; } public void setDeclareDepartmentId(Long declareDepartmentId) { this.declareDepartmentId = declareDepartmentId; } public Long getAccidentExpressId() { return accidentExpressId; } public void setAccidentExpressId(Long accidentExpressId) { this.accidentExpressId = accidentExpressId; } public String getWorkInjuryType() { return workInjuryType; } public void setWorkInjuryType(String workInjuryType) { this.workInjuryType = workInjuryType; } public Date getDeclareDate() { return declareDate; } public void setDeclareDate(Date declareDate) { this.declareDate = declareDate; } public BigDecimal getLostTime() { return lostTime; } public void setLostTime(BigDecimal lostTime) { this.lostTime = lostTime; } public String getVisitHospital() { return visitHospital; } public void setVisitHospital(String visitHospital) { this.visitHospital = visitHospital; } public String getVisitResult() { return visitResult; } public void setVisitResult(String visitResult) { this.visitResult = visitResult; } public String getMattersNeedingAttention() { return mattersNeedingAttention; } public void setMattersNeedingAttention(String mattersNeedingAttention) { this.mattersNeedingAttention = mattersNeedingAttention; } public Boolean getCompleteMaterials() { return completeMaterials; } public void setCompleteMaterials(Boolean completeMaterials) { this.completeMaterials = completeMaterials; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } } incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/entity/WorkInjuryDeclarationInfoDetailDO.java
对比新文件 @@ -0,0 +1,144 @@ package com.gkhy.safePlatform.incidentManage.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.math.BigDecimal; import java.util.Date; import java.util.List; @TableName("work_injury_declaration") public class WorkInjuryDeclarationInfoDetailDO { @TableId(type = IdType.AUTO) private Long id; private String declareUserName; private Boolean declareUserGender ; private Long declareDepartmentId; private Long accidentExpressId; private String workInjuryType; private Date declareDate; private BigDecimal lostTime; private String visitHospital; private String visitResult; private String mattersNeedingAttention; private Boolean completeMaterials ; private String remark; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getDeclareUserName() { return declareUserName; } public void setDeclareUserName(String declareUserName) { this.declareUserName = declareUserName; } public Boolean getDeclareUserGender() { return declareUserGender; } public void setDeclareUserGender(Boolean declareUserGender) { this.declareUserGender = declareUserGender; } public Long getDeclareDepartmentId() { return declareDepartmentId; } public void setDeclareDepartmentId(Long declareDepartmentId) { this.declareDepartmentId = declareDepartmentId; } public Long getAccidentExpressId() { return accidentExpressId; } public void setAccidentExpressId(Long accidentExpressId) { this.accidentExpressId = accidentExpressId; } public String getWorkInjuryType() { return workInjuryType; } public void setWorkInjuryType(String workInjuryType) { this.workInjuryType = workInjuryType; } public Date getDeclareDate() { return declareDate; } public void setDeclareDate(Date declareDate) { this.declareDate = declareDate; } public BigDecimal getLostTime() { return lostTime; } public void setLostTime(BigDecimal lostTime) { this.lostTime = lostTime; } public String getVisitHospital() { return visitHospital; } public void setVisitHospital(String visitHospital) { this.visitHospital = visitHospital; } public String getVisitResult() { return visitResult; } public void setVisitResult(String visitResult) { this.visitResult = visitResult; } public String getMattersNeedingAttention() { return mattersNeedingAttention; } public void setMattersNeedingAttention(String mattersNeedingAttention) { this.mattersNeedingAttention = mattersNeedingAttention; } public Boolean getCompleteMaterials() { return completeMaterials; } public void setCompleteMaterials(Boolean completeMaterials) { this.completeMaterials = completeMaterials; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } } incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/entity/WorkInjuryDeclarationInfoPageDO.java
对比新文件 @@ -0,0 +1,83 @@ package com.gkhy.safePlatform.incidentManage.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.util.Date; @TableName("work_injury_declaration") public class WorkInjuryDeclarationInfoPageDO { @TableId(type = IdType.AUTO) private Long id; private String declareUserName; private Long declareDepartmentId; private Long accidentExpressId; private String workInjuryType; private Date declareDate; private String visitHospital; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getDeclareUserName() { return declareUserName; } public void setDeclareUserName(String declareUserName) { this.declareUserName = declareUserName; } public Long getDeclareDepartmentId() { return declareDepartmentId; } public void setDeclareDepartmentId(Long declareDepartmentId) { this.declareDepartmentId = declareDepartmentId; } public Long getAccidentExpressId() { return accidentExpressId; } public void setAccidentExpressId(Long accidentExpressId) { this.accidentExpressId = accidentExpressId; } public String getWorkInjuryType() { return workInjuryType; } public void setWorkInjuryType(String workInjuryType) { this.workInjuryType = workInjuryType; } public Date getDeclareDate() { return declareDate; } public void setDeclareDate(Date declareDate) { this.declareDate = declareDate; } public String getVisitHospital() { return visitHospital; } public void setVisitHospital(String visitHospital) { this.visitHospital = visitHospital; } } incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/model/dto/req/WorkInjuryDeclarationFileReqDTO.java
对比新文件 @@ -0,0 +1,54 @@ package com.gkhy.safePlatform.incidentManage.model.dto.req; public class WorkInjuryDeclarationFileReqDTO { private Long id; private Long workInjuryDeclarationId; private String fileUrl; private String fileName; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Long getWorkInjuryDeclarationId() { return workInjuryDeclarationId; } public void setWorkInjuryDeclarationId(Long workInjuryDeclarationId) { this.workInjuryDeclarationId = workInjuryDeclarationId; } public String getFileUrl() { return fileUrl; } public void setFileUrl(String fileUrl) { this.fileUrl = fileUrl; } public String getFileName() { return fileName; } public void setFileName(String fileName) { this.fileName = fileName; } @Override public String toString() { return "AccidentReportFileInfo{" + "id=" + id + ", fileUrl='" + fileUrl + '\'' + ", fileName='" + fileName + '\'' + '}'; } } incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/model/dto/req/WorkInjuryDeclarationReqDTO.java
对比新文件 @@ -0,0 +1,148 @@ package com.gkhy.safePlatform.incidentManage.model.dto.req; import java.math.BigDecimal; import java.util.Date; import java.util.List; public class WorkInjuryDeclarationReqDTO { private Long id; private String declareUserName; private Boolean declareUserGender ; private Long declareDepartmentId; private Long accidentExpressId; private String workInjuryType; private Date declareDate; private BigDecimal lostTime; private String visitHospital; private String visitResult; private String mattersNeedingAttention; private Boolean completeMaterials ; private String remark; private List<WorkInjuryDeclarationFileReqDTO> fileList; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getDeclareUserName() { return declareUserName; } public void setDeclareUserName(String declareUserName) { this.declareUserName = declareUserName; } public Boolean getDeclareUserGender() { return declareUserGender; } public void setDeclareUserGender(Boolean declareUserGender) { this.declareUserGender = declareUserGender; } public Long getDeclareDepartmentId() { return declareDepartmentId; } public void setDeclareDepartmentId(Long declareDepartmentId) { this.declareDepartmentId = declareDepartmentId; } public Long getAccidentExpressId() { return accidentExpressId; } public void setAccidentExpressId(Long accidentExpressId) { this.accidentExpressId = accidentExpressId; } public String getWorkInjuryType() { return workInjuryType; } public void setWorkInjuryType(String workInjuryType) { this.workInjuryType = workInjuryType; } public Date getDeclareDate() { return declareDate; } public void setDeclareDate(Date declareDate) { this.declareDate = declareDate; } public BigDecimal getLostTime() { return lostTime; } public void setLostTime(BigDecimal lostTime) { this.lostTime = lostTime; } public String getVisitHospital() { return visitHospital; } public void setVisitHospital(String visitHospital) { this.visitHospital = visitHospital; } public String getVisitResult() { return visitResult; } public void setVisitResult(String visitResult) { this.visitResult = visitResult; } public String getMattersNeedingAttention() { return mattersNeedingAttention; } public void setMattersNeedingAttention(String mattersNeedingAttention) { this.mattersNeedingAttention = mattersNeedingAttention; } public Boolean getCompleteMaterials() { return completeMaterials; } public void setCompleteMaterials(Boolean completeMaterials) { this.completeMaterials = completeMaterials; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } public List<WorkInjuryDeclarationFileReqDTO> getFileList() { return fileList; } public void setFileList(List<WorkInjuryDeclarationFileReqDTO> fileList) { this.fileList = fileList; } } incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/model/dto/resp/WorkInjuryDeclarationDetailRespDTO.java
对比新文件 @@ -0,0 +1,152 @@ package com.gkhy.safePlatform.incidentManage.model.dto.resp; import com.fasterxml.jackson.annotation.JsonFormat; import java.math.BigDecimal; import java.util.Date; import java.util.List; public class WorkInjuryDeclarationDetailRespDTO { private Long id; private String declareUserName; private Boolean declareUserGender ; private Long declareDepartmentId; private Long accidentExpressId; private String workInjuryType; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date declareDate; private BigDecimal lostTime; private String visitHospital; private String visitResult; private String mattersNeedingAttention; private Boolean completeMaterials ; private String remark; private List<WorkInjuryDeclarationFileRespDTO> fileList; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getDeclareUserName() { return declareUserName; } public void setDeclareUserName(String declareUserName) { this.declareUserName = declareUserName; } public Boolean getDeclareUserGender() { return declareUserGender; } public void setDeclareUserGender(Boolean declareUserGender) { this.declareUserGender = declareUserGender; } public Long getDeclareDepartmentId() { return declareDepartmentId; } public void setDeclareDepartmentId(Long declareDepartmentId) { this.declareDepartmentId = declareDepartmentId; } public Long getAccidentExpressId() { return accidentExpressId; } public void setAccidentExpressId(Long accidentExpressId) { this.accidentExpressId = accidentExpressId; } public String getWorkInjuryType() { return workInjuryType; } public void setWorkInjuryType(String workInjuryType) { this.workInjuryType = workInjuryType; } public Date getDeclareDate() { return declareDate; } public void setDeclareDate(Date declareDate) { this.declareDate = declareDate; } public BigDecimal getLostTime() { return lostTime; } public void setLostTime(BigDecimal lostTime) { this.lostTime = lostTime; } public String getVisitHospital() { return visitHospital; } public void setVisitHospital(String visitHospital) { this.visitHospital = visitHospital; } public String getVisitResult() { return visitResult; } public void setVisitResult(String visitResult) { this.visitResult = visitResult; } public String getMattersNeedingAttention() { return mattersNeedingAttention; } public void setMattersNeedingAttention(String mattersNeedingAttention) { this.mattersNeedingAttention = mattersNeedingAttention; } public Boolean getCompleteMaterials() { return completeMaterials; } public void setCompleteMaterials(Boolean completeMaterials) { this.completeMaterials = completeMaterials; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } public List<WorkInjuryDeclarationFileRespDTO> getFileList() { return fileList; } public void setFileList(List<WorkInjuryDeclarationFileRespDTO> fileList) { this.fileList = fileList; } } incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/model/dto/resp/WorkInjuryDeclarationFileRespDTO.java
对比新文件 @@ -0,0 +1,54 @@ package com.gkhy.safePlatform.incidentManage.model.dto.resp; public class WorkInjuryDeclarationFileRespDTO { private Long id; private Long workInjuryDeclarationId; private String fileUrl; private String fileName; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Long getWorkInjuryDeclarationId() { return workInjuryDeclarationId; } public void setWorkInjuryDeclarationId(Long workInjuryDeclarationId) { this.workInjuryDeclarationId = workInjuryDeclarationId; } public String getFileUrl() { return fileUrl; } public void setFileUrl(String fileUrl) { this.fileUrl = fileUrl; } public String getFileName() { return fileName; } public void setFileName(String fileName) { this.fileName = fileName; } @Override public String toString() { return "AccidentReportFileInfo{" + "id=" + id + ", fileUrl='" + fileUrl + '\'' + ", fileName='" + fileName + '\'' + '}'; } } incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/model/dto/resp/WorkInjuryDeclarationPageRespDTO.java
对比新文件 @@ -0,0 +1,80 @@ package com.gkhy.safePlatform.incidentManage.model.dto.resp; import com.fasterxml.jackson.annotation.JsonFormat; import java.util.Date; public class WorkInjuryDeclarationPageRespDTO { private Long id; private String declareUserName; private Long declareDepartmentId; private Long accidentExpressId; private String workInjuryType; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date declareDate; private String visitHospital; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getDeclareUserName() { return declareUserName; } public void setDeclareUserName(String declareUserName) { this.declareUserName = declareUserName; } public Long getDeclareDepartmentId() { return declareDepartmentId; } public void setDeclareDepartmentId(Long declareDepartmentId) { this.declareDepartmentId = declareDepartmentId; } public Long getAccidentExpressId() { return accidentExpressId; } public void setAccidentExpressId(Long accidentExpressId) { this.accidentExpressId = accidentExpressId; } public String getWorkInjuryType() { return workInjuryType; } public void setWorkInjuryType(String workInjuryType) { this.workInjuryType = workInjuryType; } public Date getDeclareDate() { return declareDate; } public void setDeclareDate(Date declareDate) { this.declareDate = declareDate; } public String getVisitHospital() { return visitHospital; } public void setVisitHospital(String visitHospital) { this.visitHospital = visitHospital; } } incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/query/WorkInjuryDeclarationQuery.java
对比新文件 @@ -0,0 +1,15 @@ package com.gkhy.safePlatform.incidentManage.query; public class WorkInjuryDeclarationQuery { private Long accidentExpressId; public Long getAccidentExpressId() { return accidentExpressId; } public void setAccidentExpressId(Long accidentExpressId) { this.accidentExpressId = accidentExpressId; } } incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/query/db/WorkInjuryDeclarationDBQuery.java
对比新文件 @@ -0,0 +1,14 @@ package com.gkhy.safePlatform.incidentManage.query.db; public class WorkInjuryDeclarationDBQuery { private Long accidentExpressId; public Long getAccidentExpressId() { return accidentExpressId; } public void setAccidentExpressId(Long accidentExpressId) { this.accidentExpressId = accidentExpressId; } } incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/repository/WorkInjuryDeclarationFileInfoRepository.java
对比新文件 @@ -0,0 +1,22 @@ package com.gkhy.safePlatform.incidentManage.repository; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.gkhy.safePlatform.incidentManage.entity.WorkInjuryDeclarationFileInfo; import com.gkhy.safePlatform.incidentManage.entity.WorkInjuryDeclarationFileInfoDO; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; import java.util.List; @Repository public interface WorkInjuryDeclarationFileInfoRepository extends BaseMapper<WorkInjuryDeclarationFileInfo> { List<WorkInjuryDeclarationFileInfoDO> selectByWorkInjuryDeclarationId(@Param("WorkInjuryDeclarationId") Long WorkInjuryDeclarationId); void addWorkInjuryDeclarationFile(WorkInjuryDeclarationFileInfo WorkInjuryDeclarationFileInfo); void deleteWorkInjuryDeclarationFileByWorkInjuryDeclarationId(@Param("WorkInjuryDeclarationId") Long WorkInjuryDeclarationId); void deleteWorkInjuryDeclarationFileByIds(List<Long> ids); } incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/repository/WorkInjuryDeclarationInfoRepository.java
对比新文件 @@ -0,0 +1,26 @@ package com.gkhy.safePlatform.incidentManage.repository; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.gkhy.safePlatform.incidentManage.entity.WorkInjuryDeclarationInfo; import com.gkhy.safePlatform.incidentManage.entity.WorkInjuryDeclarationInfoDetailDO; import com.gkhy.safePlatform.incidentManage.entity.WorkInjuryDeclarationInfoPageDO; import com.gkhy.safePlatform.incidentManage.query.db.WorkInjuryDeclarationDBQuery; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; import java.util.List; @Repository public interface WorkInjuryDeclarationInfoRepository extends BaseMapper<WorkInjuryDeclarationInfo> { List<WorkInjuryDeclarationInfoPageDO> selectWorkInjuryDeclarationList(Page<WorkInjuryDeclarationInfoPageDO> page, @Param("query") WorkInjuryDeclarationDBQuery WorkInjuryDeclarationDBQuery); void addWorkInjuryDeclaration(WorkInjuryDeclarationInfo WorkInjuryDeclarationInfo); WorkInjuryDeclarationInfoDetailDO selectWorkInjuryDeclarationById(@Param("id") Long id); void updateWorkInjuryDeclaration(WorkInjuryDeclarationInfo WorkInjuryDeclarationInfo); void deleteWorkInjuryDeclarationById(@Param("id") Long id); } incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/service/WorkInjuryDeclarationService.java
对比新文件 @@ -0,0 +1,24 @@ package com.gkhy.safePlatform.incidentManage.service; import com.gkhy.safePlatform.commons.query.PageQuery; import com.gkhy.safePlatform.commons.vo.ResultVO; import com.gkhy.safePlatform.commons.vo.SearchResultVO; import com.gkhy.safePlatform.incidentManage.model.dto.req.WorkInjuryDeclarationReqDTO; import com.gkhy.safePlatform.incidentManage.model.dto.resp.WorkInjuryDeclarationDetailRespDTO; import com.gkhy.safePlatform.incidentManage.model.dto.resp.WorkInjuryDeclarationPageRespDTO; import com.gkhy.safePlatform.incidentManage.query.WorkInjuryDeclarationQuery; import java.util.List; public interface WorkInjuryDeclarationService { SearchResultVO<List<WorkInjuryDeclarationPageRespDTO>> selectWorkInjuryDeclarationList(PageQuery<WorkInjuryDeclarationQuery> query); ResultVO addWorkInjuryDeclaration(Long valueOf, WorkInjuryDeclarationReqDTO WorkInjuryDeclarationReqDTO); ResultVO<WorkInjuryDeclarationDetailRespDTO> getWorkInjuryDeclarationById(Long id); ResultVO updateWorkInjuryDeclaration(Long uid, WorkInjuryDeclarationReqDTO WorkInjuryDeclarationReqDTO); ResultVO batchDeleteWorkInjuryDeclaration(String ids); } incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/service/baseService/WorkInjuryDeclarationFileInfoService.java
对比新文件 @@ -0,0 +1,19 @@ package com.gkhy.safePlatform.incidentManage.service.baseService; import com.baomidou.mybatisplus.extension.service.IService; import com.gkhy.safePlatform.incidentManage.entity.WorkInjuryDeclarationFileInfo; import com.gkhy.safePlatform.incidentManage.entity.WorkInjuryDeclarationFileInfoDO; import java.util.List; public interface WorkInjuryDeclarationFileInfoService extends IService<WorkInjuryDeclarationFileInfo> { List<WorkInjuryDeclarationFileInfoDO> selectByWorkInjuryDeclarationId(Long id); void addWorkInjuryDeclarationFile(WorkInjuryDeclarationFileInfo WorkInjuryDeclarationFileInfo); void deleteWorkInjuryDeclarationFileByWorkInjuryDeclarationId(Long WorkInjuryDeclarationId); void deleteWorkInjuryDeclarationFileByIds(List<Long> deleteList); } incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/service/baseService/WorkInjuryDeclarationInfoService.java
对比新文件 @@ -0,0 +1,24 @@ package com.gkhy.safePlatform.incidentManage.service.baseService; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.gkhy.safePlatform.incidentManage.entity.WorkInjuryDeclarationInfo; import com.gkhy.safePlatform.incidentManage.entity.WorkInjuryDeclarationInfoDetailDO; import com.gkhy.safePlatform.incidentManage.entity.WorkInjuryDeclarationInfoPageDO; import com.gkhy.safePlatform.incidentManage.query.db.WorkInjuryDeclarationDBQuery; import java.util.List; public interface WorkInjuryDeclarationInfoService extends IService<WorkInjuryDeclarationInfo> { List<WorkInjuryDeclarationInfoPageDO> selectWorkInjuryDeclarationList(Page<WorkInjuryDeclarationInfoPageDO> page, WorkInjuryDeclarationDBQuery WorkInjuryDeclarationDBQuery); void addWorkInjuryDeclaration(WorkInjuryDeclarationInfo WorkInjuryDeclarationInfo); WorkInjuryDeclarationInfoDetailDO selectWorkInjuryDeclarationById(Long id); void updateWorkInjuryDeclaration(WorkInjuryDeclarationInfo WorkInjuryDeclarationInfo); void deleteWorkInjuryDeclarationById(Long teamId); } incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/service/baseService/impl/WorkInjuryDeclarationFileInfoServiceImpl.java
对比新文件 @@ -0,0 +1,41 @@ package com.gkhy.safePlatform.incidentManage.service.baseService.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.gkhy.safePlatform.incidentManage.entity.WorkInjuryDeclarationFileInfo; import com.gkhy.safePlatform.incidentManage.entity.WorkInjuryDeclarationFileInfoDO; import com.gkhy.safePlatform.incidentManage.repository.WorkInjuryDeclarationFileInfoRepository; import com.gkhy.safePlatform.incidentManage.service.baseService.WorkInjuryDeclarationFileInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service("workInjuryDeclarationFileInfoService") public class WorkInjuryDeclarationFileInfoServiceImpl extends ServiceImpl<WorkInjuryDeclarationFileInfoRepository, WorkInjuryDeclarationFileInfo> implements WorkInjuryDeclarationFileInfoService { @Autowired private WorkInjuryDeclarationFileInfoRepository WorkInjuryDeclarationFileInfoRepository; @Override public List<WorkInjuryDeclarationFileInfoDO> selectByWorkInjuryDeclarationId(Long id) { return WorkInjuryDeclarationFileInfoRepository.selectByWorkInjuryDeclarationId(id); } @Override public void addWorkInjuryDeclarationFile(WorkInjuryDeclarationFileInfo WorkInjuryDeclarationFileInfo) { WorkInjuryDeclarationFileInfoRepository.addWorkInjuryDeclarationFile(WorkInjuryDeclarationFileInfo); } @Override public void deleteWorkInjuryDeclarationFileByWorkInjuryDeclarationId(Long WorkInjuryDeclarationId) { WorkInjuryDeclarationFileInfoRepository.deleteWorkInjuryDeclarationFileByWorkInjuryDeclarationId(WorkInjuryDeclarationId); } @Override public void deleteWorkInjuryDeclarationFileByIds(List<Long> ids) { WorkInjuryDeclarationFileInfoRepository.deleteWorkInjuryDeclarationFileByIds(ids); } } incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/service/baseService/impl/WorkInjuryDeclarationInfoServiceImpl.java
对比新文件 @@ -0,0 +1,48 @@ package com.gkhy.safePlatform.incidentManage.service.baseService.impl; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.gkhy.safePlatform.incidentManage.entity.WorkInjuryDeclarationInfo; import com.gkhy.safePlatform.incidentManage.entity.WorkInjuryDeclarationInfoDetailDO; import com.gkhy.safePlatform.incidentManage.entity.WorkInjuryDeclarationInfoPageDO; import com.gkhy.safePlatform.incidentManage.query.db.WorkInjuryDeclarationDBQuery; import com.gkhy.safePlatform.incidentManage.repository.WorkInjuryDeclarationInfoRepository; import com.gkhy.safePlatform.incidentManage.service.baseService.WorkInjuryDeclarationInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service("workInjuryDeclarationInfoService") public class WorkInjuryDeclarationInfoServiceImpl extends ServiceImpl<WorkInjuryDeclarationInfoRepository, WorkInjuryDeclarationInfo> implements WorkInjuryDeclarationInfoService { @Autowired private WorkInjuryDeclarationInfoRepository WorkInjuryDeclarationInfoRepository; @Override public List<WorkInjuryDeclarationInfoPageDO> selectWorkInjuryDeclarationList(Page<WorkInjuryDeclarationInfoPageDO> page, WorkInjuryDeclarationDBQuery WorkInjuryDeclarationDBQuery) { return WorkInjuryDeclarationInfoRepository.selectWorkInjuryDeclarationList(page,WorkInjuryDeclarationDBQuery); } @Override public void addWorkInjuryDeclaration(WorkInjuryDeclarationInfo WorkInjuryDeclarationInfo) { WorkInjuryDeclarationInfoRepository.addWorkInjuryDeclaration(WorkInjuryDeclarationInfo); } @Override public WorkInjuryDeclarationInfoDetailDO selectWorkInjuryDeclarationById(Long id) { return WorkInjuryDeclarationInfoRepository.selectWorkInjuryDeclarationById(id); } @Override public void updateWorkInjuryDeclaration(WorkInjuryDeclarationInfo WorkInjuryDeclarationInfo) { WorkInjuryDeclarationInfoRepository.updateWorkInjuryDeclaration(WorkInjuryDeclarationInfo); } @Override public void deleteWorkInjuryDeclarationById(Long teamId) { WorkInjuryDeclarationInfoRepository.deleteWorkInjuryDeclarationById(teamId); } } incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/service/impl/WorkInjuryDeclarationServiceImpl.java
对比新文件 @@ -0,0 +1,252 @@ package com.gkhy.safePlatform.incidentManage.service.impl; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.gkhy.safePlatform.commons.enums.ResultCodes; import com.gkhy.safePlatform.commons.query.PageQuery; import com.gkhy.safePlatform.commons.utils.BeanCopyUtils; import com.gkhy.safePlatform.commons.utils.StringUtils; import com.gkhy.safePlatform.commons.vo.ResultVO; import com.gkhy.safePlatform.commons.vo.SearchResultVO; import com.gkhy.safePlatform.incidentManage.entity.*; import com.gkhy.safePlatform.incidentManage.enums.AccidentResultCodes; import com.gkhy.safePlatform.incidentManage.exception.AccidentException; import com.gkhy.safePlatform.incidentManage.model.dto.req.WorkInjuryDeclarationFileReqDTO; import com.gkhy.safePlatform.incidentManage.model.dto.req.WorkInjuryDeclarationReqDTO; import com.gkhy.safePlatform.incidentManage.model.dto.resp.WorkInjuryDeclarationDetailRespDTO; import com.gkhy.safePlatform.incidentManage.model.dto.resp.WorkInjuryDeclarationFileRespDTO; import com.gkhy.safePlatform.incidentManage.model.dto.resp.WorkInjuryDeclarationPageRespDTO; import com.gkhy.safePlatform.incidentManage.query.WorkInjuryDeclarationQuery; import com.gkhy.safePlatform.incidentManage.query.db.WorkInjuryDeclarationDBQuery; import com.gkhy.safePlatform.incidentManage.service.WorkInjuryDeclarationService; import com.gkhy.safePlatform.incidentManage.service.baseService.WorkInjuryDeclarationFileInfoService; import com.gkhy.safePlatform.incidentManage.service.baseService.WorkInjuryDeclarationInfoService; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.stream.Collectors; @Service("workInjuryDeclarationService") public class WorkInjuryDeclarationServiceImpl implements WorkInjuryDeclarationService { @Autowired private WorkInjuryDeclarationInfoService workInjuryDeclarationInfoService; @Autowired private WorkInjuryDeclarationFileInfoService workInjuryDeclarationFileInfoService; @Override public SearchResultVO<List<WorkInjuryDeclarationPageRespDTO>> selectWorkInjuryDeclarationList(PageQuery<WorkInjuryDeclarationQuery> query) { Long pageIndex = query.getPageIndex(); Long pageSize = query.getPageSize(); Page<WorkInjuryDeclarationInfoPageDO> page = new Page<>(pageIndex, pageSize); WorkInjuryDeclarationDBQuery WorkInjuryDeclarationDBQuery = new WorkInjuryDeclarationDBQuery(); if (query.getSearchParams() != null) { BeanUtils.copyProperties(query.getSearchParams(), WorkInjuryDeclarationDBQuery); } List<WorkInjuryDeclarationInfoPageDO> WorkInjuryDeclarationInfoPageDOList = workInjuryDeclarationInfoService.selectWorkInjuryDeclarationList(page, WorkInjuryDeclarationDBQuery); List<WorkInjuryDeclarationPageRespDTO> respList = BeanCopyUtils.copyBeanList(WorkInjuryDeclarationInfoPageDOList, WorkInjuryDeclarationPageRespDTO.class); return new SearchResultVO<>( true, pageIndex, pageSize, page.getTotal(), respList, ResultCodes.OK ); } @Override public ResultVO addWorkInjuryDeclaration(Long uid, WorkInjuryDeclarationReqDTO WorkInjuryDeclarationReqDTO) { //必填项验证 checkRequired(WorkInjuryDeclarationReqDTO); Date nowDate = new Date(); //1.新增工伤申报 WorkInjuryDeclarationInfo WorkInjuryDeclarationInfo = new WorkInjuryDeclarationInfo(); BeanUtils.copyProperties(WorkInjuryDeclarationReqDTO, WorkInjuryDeclarationInfo); WorkInjuryDeclarationInfo.setDelFlag(false); WorkInjuryDeclarationInfo.setCreateUid(uid); WorkInjuryDeclarationInfo.setGmtCreate(nowDate); workInjuryDeclarationInfoService.addWorkInjuryDeclaration(WorkInjuryDeclarationInfo); //2.新增工伤申报附件 if (!CollectionUtils.isEmpty(WorkInjuryDeclarationReqDTO.getFileList())){ addWorkInjuryDeclarationFile(WorkInjuryDeclarationInfo.getId(),uid,nowDate,WorkInjuryDeclarationReqDTO.getFileList()); } return new ResultVO(ResultCodes.OK); } private void addWorkInjuryDeclarationFile(Long WorkInjuryDeclarationId ,Long uid , Date nowDate , List<WorkInjuryDeclarationFileReqDTO> WorkInjuryDeclarationFileReqDTOList){ List<WorkInjuryDeclarationFileInfo> fileInfoList = BeanCopyUtils.copyBeanList(WorkInjuryDeclarationFileReqDTOList, WorkInjuryDeclarationFileInfo.class); fileInfoList.forEach(WorkInjuryDeclarationFileInfo -> { WorkInjuryDeclarationFileInfo.setWorkInjuryDeclarationId(WorkInjuryDeclarationId); WorkInjuryDeclarationFileInfo.setDelFlag(false); WorkInjuryDeclarationFileInfo.setCreateUid(uid); WorkInjuryDeclarationFileInfo.setGmtCreate(nowDate); }); for (WorkInjuryDeclarationFileInfo WorkInjuryDeclarationFileInfo :fileInfoList){ workInjuryDeclarationFileInfoService.addWorkInjuryDeclarationFile(WorkInjuryDeclarationFileInfo); } } @Override public ResultVO<WorkInjuryDeclarationDetailRespDTO> getWorkInjuryDeclarationById(Long id) { WorkInjuryDeclarationDetailRespDTO WorkInjuryDeclarationDetailRespDTO = new WorkInjuryDeclarationDetailRespDTO(); //查询是否存在 WorkInjuryDeclarationInfoDetailDO WorkInjuryDeclarationInfoDetailDO = workInjuryDeclarationInfoService.selectWorkInjuryDeclarationById(id); if (WorkInjuryDeclarationInfoDetailDO==null){ throw new AccidentException(AccidentResultCodes.ACCIDENT_REPORT_NOT_EXIST); }else{ BeanUtils.copyProperties(WorkInjuryDeclarationInfoDetailDO,WorkInjuryDeclarationDetailRespDTO); //查找对应的附件 List<WorkInjuryDeclarationFileInfoDO> WorkInjuryDeclarationFileInfoDOList = workInjuryDeclarationFileInfoService.selectByWorkInjuryDeclarationId(id); if (!CollectionUtils.isEmpty(WorkInjuryDeclarationFileInfoDOList)){ List<WorkInjuryDeclarationFileRespDTO> WorkInjuryDeclarationFileRespDTOList = BeanCopyUtils.copyBeanList(WorkInjuryDeclarationFileInfoDOList , WorkInjuryDeclarationFileRespDTO.class); WorkInjuryDeclarationDetailRespDTO.setFileList(WorkInjuryDeclarationFileRespDTOList); } return new ResultVO<>(ResultCodes.OK ,WorkInjuryDeclarationDetailRespDTO); } } @Override public ResultVO updateWorkInjuryDeclaration(Long uid, WorkInjuryDeclarationReqDTO WorkInjuryDeclarationReqDTO) { Date nowDate = new Date(); //查询是否存在 WorkInjuryDeclarationInfoDetailDO WorkInjuryDeclarationInfoDetailDO = workInjuryDeclarationInfoService.selectWorkInjuryDeclarationById(WorkInjuryDeclarationReqDTO.getId()); if (WorkInjuryDeclarationInfoDetailDO==null){ throw new AccidentException(AccidentResultCodes.ACCIDENT_REPORT_NOT_EXIST); }else{ WorkInjuryDeclarationInfo WorkInjuryDeclarationInfo = new WorkInjuryDeclarationInfo(); BeanUtils.copyProperties(WorkInjuryDeclarationReqDTO,WorkInjuryDeclarationInfo); WorkInjuryDeclarationInfo.setUpdateUid(uid); WorkInjuryDeclarationInfo.setGmtModitify(nowDate); workInjuryDeclarationInfoService.updateWorkInjuryDeclaration(WorkInjuryDeclarationInfo); //修改工伤申报附件 updateWorkInjuryDeclarationFile(uid,WorkInjuryDeclarationReqDTO.getId(),nowDate,WorkInjuryDeclarationReqDTO.getFileList()); return new ResultVO(ResultCodes.OK); } } private void updateWorkInjuryDeclarationFile(Long uid ,Long WorkInjuryDeclarationId ,Date nowDate,List<WorkInjuryDeclarationFileReqDTO> WorkInjuryDeclarationFileReqDTOList){ List<WorkInjuryDeclarationFileInfoDO> WorkInjuryDeclarationFileInfoDOList = workInjuryDeclarationFileInfoService.selectByWorkInjuryDeclarationId(WorkInjuryDeclarationId); List<Long> oldIdsList = WorkInjuryDeclarationFileInfoDOList.stream().map(WorkInjuryDeclarationFileInfoDO::getId).collect(Collectors.toList()); List<Long> newIdsList = new ArrayList<>(); //新增的附件集合 List<WorkInjuryDeclarationFileInfo> addList = new ArrayList<>(); //删除的附件集合(id) List<Long> deleteList = new ArrayList<>(); for (WorkInjuryDeclarationFileReqDTO WorkInjuryDeclarationFileReqDTO : WorkInjuryDeclarationFileReqDTOList){ //如果不存在id则表示页面新增的附件 if (WorkInjuryDeclarationFileReqDTO.getId() == null){ WorkInjuryDeclarationFileInfo WorkInjuryDeclarationFileInfo = new WorkInjuryDeclarationFileInfo(); BeanUtils.copyProperties(WorkInjuryDeclarationFileReqDTO,WorkInjuryDeclarationFileInfo); WorkInjuryDeclarationFileInfo.setDelFlag(false); WorkInjuryDeclarationFileInfo.setGmtCreate(nowDate); WorkInjuryDeclarationFileInfo.setCreateUid(uid); WorkInjuryDeclarationFileInfo.setWorkInjuryDeclarationId(WorkInjuryDeclarationId); addList.add(WorkInjuryDeclarationFileInfo); } //如果存在id则判断页面是否删除 else{ newIdsList.add(WorkInjuryDeclarationFileReqDTO.getId()); } } for (Long oldId : oldIdsList){ if (!newIdsList.contains(oldId)){ deleteList.add(oldId); } } if (!CollectionUtils.isEmpty(addList)){ for (WorkInjuryDeclarationFileInfo WorkInjuryDeclarationFileInfo : addList){ workInjuryDeclarationFileInfoService.addWorkInjuryDeclarationFile(WorkInjuryDeclarationFileInfo); } } if (!CollectionUtils.isEmpty(deleteList)){ workInjuryDeclarationFileInfoService.deleteWorkInjuryDeclarationFileByIds(deleteList); } } @Override public ResultVO batchDeleteWorkInjuryDeclaration(String ids) { if (StringUtils.isBlank(ids)){ throw new AccidentException(AccidentResultCodes.ACCIDENT_REPORT_NULL); }else{ String[] idArr = ids.split(","); for (String id : idArr) { deleteWorkInjuryDeclaration(Long.valueOf(id)); } return new ResultVO(ResultCodes.OK); } } private void deleteWorkInjuryDeclaration(Long id) { //查询是否存在 WorkInjuryDeclarationInfoDetailDO WorkInjuryDeclarationInfoDetailDO = workInjuryDeclarationInfoService.selectWorkInjuryDeclarationById(id); if (WorkInjuryDeclarationInfoDetailDO==null){ throw new AccidentException(AccidentResultCodes.ACCIDENT_REPORT_NOT_EXIST); }else{ workInjuryDeclarationInfoService.deleteWorkInjuryDeclarationById(id); //删除附件 workInjuryDeclarationFileInfoService.deleteWorkInjuryDeclarationFileByWorkInjuryDeclarationId(id); } } /** * 验证必填项 * @return */ private void checkRequired(WorkInjuryDeclarationReqDTO WorkInjuryDeclarationReqDTO) { /* //名称 if (StringUtils.isBlank(WorkInjuryDeclarationReqDTO.getAccidentName())) { throw new AccidentException(AccidentResultCodes.Report_NAME_NULL); } //部门 if (WorkInjuryDeclarationReqDTO.getAccidentDepartmentId()==null) { throw new AccidentException(AccidentResultCodes.Report_DEPARTMENT_NULL); } //发生时间 if (WorkInjuryDeclarationReqDTO.getOccurrenceTime() == null ) { throw new AccidentException(AccidentResultCodes.Report_TIME_NULL); } //发生地点 if (StringUtils.isBlank(WorkInjuryDeclarationReqDTO.getOccurrencePlace())) { throw new AccidentException(AccidentResultCodes.Report_PLACE_NULL); } //事故原因 if (StringUtils.isBlank(WorkInjuryDeclarationReqDTO.getAccidentCause())) { throw new AccidentException(AccidentResultCodes.Report_CAUSE_NULL); } //是否有伤亡 if (WorkInjuryDeclarationReqDTO.getCasualties()==null) { throw new AccidentException(AccidentResultCodes.Report_CASUALTIES_NULL); } //简要经过 if (StringUtils.isBlank(WorkInjuryDeclarationReqDTO.getAccidentBriefProcess())) { throw new AccidentException(AccidentResultCodes.Report_BRIEF_PROCESS_NULL); } //初步分析 if (StringUtils.isBlank(WorkInjuryDeclarationReqDTO.getAccidentCausesPreliminaryAnalysis())) { throw new AccidentException(AccidentResultCodes.Report_CASE_PRELIMINARY_ANALYSIS_NULL); } //应急防范措施 if (StringUtils.isBlank(WorkInjuryDeclarationReqDTO.getEmergencyPrecautions())) { throw new AccidentException(AccidentResultCodes.Report_EMERGENCY_PRECAUTIONS_NULL); }*/ } } incident-manage/incident-manage-service/src/main/resources/config/mapper/incidentManage/WorkInjuryDeclarationFileInfoMapper.xml
对比新文件 @@ -0,0 +1,55 @@ <?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.gkhy.safePlatform.incidentManage.repository.WorkInjuryDeclarationFileInfoRepository"> <insert id="addWorkInjuryDeclarationFile"> insert into work_injury_declaration_file <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null ">id,</if> <if test="delFlag != null ">del_flag,</if> <if test="gmtCreate != null ">gmt_create,</if> <if test="gmtModitify != null ">gmt_moditify,</if> <if test="createUid != null ">create_uid,</if> <if test="updateUid != null ">update_uid,</if> <if test="workInjuryDeclarationId != null ">work_injury_declaration_id,</if> <if test="fileUrl != null and fileUrl != ''">file_url,</if> <if test="fileName != null and fileName != ''">file_name</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null ">#{id},</if> <if test="delFlag != null ">#{delFlag},</if> <if test="gmtCreate != null ">#{gmtCreate},</if> <if test="gmtModitify != null ">#{gmtModitify},</if> <if test="createUid != null ">#{createUid},</if> <if test="updateUid != null ">#{updateUid},</if> <if test="workInjuryDeclarationId != null ">#{workInjuryDeclarationId},</if> <if test="fileUrl != null and fileUrl != ''">#{fileUrl},</if> <if test="fileName != null and fileName != ''">#{fileName}</if> </trim> </insert> <resultMap type="com.gkhy.safePlatform.incidentManage.entity.WorkInjuryDeclarationFileInfoDO" id="WorkInjuryDeclarationFileInfoDOResult"> <id column="id" property="id" jdbcType="BIGINT"/> <result column="work_injury_declaration_id" property="workInjuryDeclarationId" /> <result column="file_url" property="fileUrl" /> <result column="file_name" property="fileName" /> </resultMap> <select id="selectByWorkInjuryDeclarationId" resultMap="WorkInjuryDeclarationFileInfoDOResult"> select id,`work_injury_declaration_id`,`file_url`,`file_name` from work_injury_declaration_file where del_flag = 0 and work_injury_declaration_id = #{WorkInjuryDeclarationId} </select> <update id = "deleteWorkInjuryDeclarationFileByIds" > update work_injury_declaration_file set del_flag = 1 where id in <foreach item="id" collection="ids" open="(" separator="," close=")"> #{id} </foreach> </update> <update id="deleteWorkInjuryDeclarationFileByWorkInjuryDeclarationId"> update work_injury_declaration_file set del_flag = 1 where work_injury_declaration_id = #{WorkInjuryDeclarationId} </update> </mapper> incident-manage/incident-manage-service/src/main/resources/config/mapper/incidentManage/WorkInjuryDeclarationInfoMapper.xml
对比新文件 @@ -0,0 +1,118 @@ <?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.gkhy.safePlatform.incidentManage.repository.WorkInjuryDeclarationInfoRepository"> <resultMap type="com.gkhy.safePlatform.incidentManage.entity.WorkInjuryDeclarationInfoPageDO" id="WorkInjuryDeclarationInfoPageDOResult"> <id column="id" property="id" jdbcType="BIGINT"/> <result column="declare_user_name" property="declareUserName"/> <result column="declare_department_id" property="declareDepartmentId"/> <result column="accident_express_id" property="accidentExpressId"/> <result column="work_injury_type" property="workInjuryType"/> <result column="declare_date" property="declareDate"/> <result column="visit_hospital" property="visitHospital"/> </resultMap> <select id="selectWorkInjuryDeclarationList" resultMap="WorkInjuryDeclarationInfoPageDOResult"> select id,`declare_user_name`,`declare_department_id`,`accident_express_id` ,work_injury_type ,declare_date ,visit_hospital from work_injury_declaration where del_flag = 0 <if test="query.accidentExpressId != null">and `accident_express_id` = #{query.accidentExpressId}</if> </select> <insert id="addWorkInjuryDeclaration" parameterType="com.gkhy.safePlatform.incidentManage.entity.WorkInjuryDeclarationInfo" keyProperty="id" useGeneratedKeys="true"> insert into work_injury_declaration <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null ">id,</if> <if test="delFlag != null ">del_flag,</if> <if test="gmtCreate != null ">gmt_create,</if> <if test="gmtModitify != null ">gmt_moditify,</if> <if test="createUid != null ">create_uid,</if> <if test="updateUid != null ">update_uid,</if> <if test="declareUserName != null and declareUserName != ''">declare_user_name,</if> <if test="declareUserGender != null ">declare_user_gender,</if> <if test="declareDepartmentId != null ">declare_department_id,</if> <if test="accidentExpressId != null ">accident_express_id,</if> <if test="workInjuryType != null and workInjuryType != ''">work_injury_type,</if> <if test="declareDate != null ">declare_date,</if> <if test="lostTime != null ">lost_time,</if> <if test="visitHospital != null and visitHospital != ''">visit_hospital,</if> <if test="visitResult != null and visitResult != ''">visit_result,</if> <if test="mattersNeedingAttention != null and mattersNeedingAttention != ''">matters_needing_attention,</if> <if test="completeMaterials != null ">complete_materials,</if> <if test="remark != null and remark != ''">remark,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null ">#{id},</if> <if test="delFlag != null ">#{delFlag},</if> <if test="gmtCreate != null ">#{gmtCreate},</if> <if test="gmtModitify != null ">#{gmtModitify},</if> <if test="createUid != null ">#{createUid},</if> <if test="updateUid != null ">#{updateUid},</if> <if test="declareUserName != null and declareUserName != ''">#{declareUserName},</if> <if test="declareUserGender != null ">#{declareUserGender},</if> <if test="declareDepartmentId != null ">#{declareDepartmentId},</if> <if test="accidentExpressId != null ">#{accidentExpressId},</if> <if test="workInjuryType != null and workInjuryType != ''">#{workInjuryType},</if> <if test="declareDate != null ">#{declareDate},</if> <if test="lostTime != null ">#{lostTime},</if> <if test="visitHospital != null and visitHospital != ''">#{visitHospital},</if> <if test="visitResult != null and visitResult != ''">#{visitResult},</if> <if test="mattersNeedingAttention != null and mattersNeedingAttention != ''">#{mattersNeedingAttention},</if> <if test="completeMaterials != null ">#{completeMaterials},</if> <if test="remark != null and remark != ''">#{remark},</if> </trim> </insert> <resultMap type="com.gkhy.safePlatform.incidentManage.entity.WorkInjuryDeclarationInfoDetailDO" id="WorkInjuryDeclarationInfoDetailDOResult"> <id column="id" property="id" jdbcType="BIGINT"/> <result column="declare_user_name" property="declareUserName"/> <result column="declare_user_gender" property="declareUserGender"/> <result column="declare_department_id" property="declareDepartmentId"/> <result column="accident_express_id" property="accidentExpressId"/> <result column="work_injury_type" property="workInjuryType"/> <result column="declare_date" property="declareDate"/> <result column="lost_time" property="lostTime"/> <result column="visit_hospital" property="visitHospital"/> <result column="visit_result" property="visitResult"/> <result column="matters_needing_attention" property="mattersNeedingAttention"/> <result column="complete_materials" property="completeMaterials"/> <result column="remark" property="remark"/> </resultMap> <select id="selectWorkInjuryDeclarationById" resultMap="WorkInjuryDeclarationInfoDetailDOResult"> select id ,declare_user_name ,`declare_user_gender`,`declare_department_id`,`accident_express_id`,`work_injury_type`,declare_date ,lost_time , `visit_hospital`,`visit_result`,`matters_needing_attention`,`complete_materials`,remark from work_injury_declaration where del_flag = 0 and id = #{id} </select> <update id="updateWorkInjuryDeclaration" parameterType="com.gkhy.safePlatform.incidentManage.entity.WorkInjuryDeclarationInfo"> update work_injury_declaration <trim prefix="SET" suffixOverrides=","> <if test="gmtModitify != null ">gmt_moditify = #{gmtModitify},</if> <if test="updateUid != null ">update_uid = #{updateUid},</if> <if test="declareUserName != null and declareUserName != ''">declare_user_name = #{declareUserName},</if> <if test="declareUserGender != null "> declare_user_gender = #{declareUserGender},</if> <if test="declareDepartmentId != null ">declare_department_id = #{declareDepartmentId},</if> <if test="accidentExpressId != null ">accident_express_id = #{accidentExpressId},</if> <if test="workInjuryType != null and workInjuryType != ''">work_injury_type = #{workInjuryType},</if> <if test="declareDate != null ">declare_date = #{declareDate},</if> <if test="lostTime != null ">lost_time = #{lostTime},</if> <if test="visitHospital != null and visitHospital != ''">visit_hospital = #{visitHospital},</if> <if test="visitResult != null and visitResult != ''">visit_result = #{visitResult},</if> <if test="mattersNeedingAttention != null and mattersNeedingAttention != ''">matters_needing_attention = #{mattersNeedingAttention},</if> <if test="completeMaterials != null ">complete_materials = #{completeMaterials},</if> <if test="remark != null and remark != ''">remark = #{remark},</if> </trim> where id = #{id} </update> <update id="deleteWorkInjuryDeclarationById"> update work_injury_declaration set del_flag = 1 where id = #{id} </update> </mapper>