screen-api/src/main/java/com/moral/api/controller/AllocationExtensionController.java
@@ -10,7 +10,9 @@ import com.moral.api.service.AllocationExtensionService; import com.moral.constant.PageResult; import com.moral.constant.ResultMessage; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; @@ -25,6 +27,7 @@ */ @RestController @RequestMapping("/allocationExtension") @Api(tags = {"延期申请"}) public class AllocationExtensionController { private final AllocationExtensionService allocationExtensionService; @@ -50,4 +53,12 @@ return ResultMessage.ok(result); } @GetMapping("check") @ApiOperation("审批") public ResultMessage check(@RequestParam @ApiParam(value = "id",name = "主键id") Integer id, @RequestParam @ApiParam(value = "sate",name = "状态") Integer sate){ allocationExtensionService.check(id,sate); return ResultMessage.ok(); } } screen-api/src/main/java/com/moral/api/pojo/enums/AllocationExtensionApproveEnum.java
@@ -23,11 +23,11 @@ /** *未申请 */ NOT_AAPPROVE(10, "未申请"), NOT_AAPPROVE(10, "未审批"), /** *申请中 */ APPLYING(30, "申请中"), APPLYING(30, "审批中"), /** *通过 */ screen-api/src/main/java/com/moral/api/pojo/ext/allocationextension/AllocationExtensionExt.java
@@ -1,9 +1,15 @@ package com.moral.api.pojo.ext.allocationextension; import com.fasterxml.jackson.annotation.JsonFormat; import com.moral.api.entity.AllocationExtension; import com.moral.api.pojo.vo.file.FileVo; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; import java.util.Date; import java.util.List; /** * <p> @@ -18,4 +24,46 @@ @Accessors(chain = true) public class AllocationExtensionExt extends AllocationExtension { @ApiModelProperty(value = "交办单号") private String allocationNum; @ApiModelProperty(value = "上报时间") private Date escalationTime; @ApiModelProperty(value = "污染位置") private String pollutePosition; @ApiModelProperty(value = "责任单位id") private Integer unitId; @ApiModelProperty(value = "污染分类id") private Integer polluteType; @ApiModelProperty(value = "整改类型id") private Integer changeType; @ApiModelProperty(value = "期限天数") private Integer changeDay; @ApiModelProperty(value = "上报单位id") private Integer escalationUnitId; @ApiModelProperty(value = "上报人") private String escalationName; @ApiModelProperty(value = "排查方式id") private Integer investigationType; @ApiModelProperty(value = "问题描述") private String problemDescribe; @ApiModelProperty(value = "基础附件") private List<FileVo> fileBaseList; @ApiModelProperty(value = "延期附件") private List<FileVo> fileList; } screen-api/src/main/java/com/moral/api/pojo/vo/allocation/AllocationPageVo.java
@@ -1,5 +1,6 @@ package com.moral.api.pojo.vo.allocation; import com.fasterxml.jackson.annotation.JsonFormat; import com.moral.api.pojo.enums.AllocationApproveEnum; import com.moral.api.pojo.ext.allocation.AllocationPageExt; import com.moral.api.utils.BeanConverts; @@ -14,6 +15,7 @@ import java.util.Date; import java.util.List; import java.util.Objects; import java.util.regex.Pattern; import java.util.stream.Collectors; /** @@ -38,6 +40,7 @@ private String allocationNum; @ApiModelProperty(value = "上报时间") @JsonFormat(pattern="yyyy-MM-dd") private Date escalationTime; @ApiModelProperty(value = "责任单位id") @@ -77,6 +80,7 @@ private String createName; @ApiModelProperty(value = "创建时间") @JsonFormat(pattern="yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date createTime; @ApiModelProperty(value = "更新人id") @@ -86,6 +90,7 @@ private String updateName; @ApiModelProperty(value = "更新时间") @JsonFormat(pattern="yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date updateTime; @ApiModelProperty(value = "能否申请延期") screen-api/src/main/java/com/moral/api/pojo/vo/allocation/AllocationVo.java
@@ -1,5 +1,6 @@ package com.moral.api.pojo.vo.allocation; import com.fasterxml.jackson.annotation.JsonFormat; import com.moral.api.pojo.ext.allocation.AllocationExt; import com.moral.api.pojo.vo.approvetable.ApproveTableListVo; import com.moral.api.pojo.vo.file.FileVo; @@ -37,6 +38,7 @@ @ApiModelProperty(value = "上报时间") @JsonFormat(pattern="yyyy-MM-dd") private Date escalationTime; @ApiModelProperty(value = "污染位置") @@ -76,6 +78,7 @@ private String changeName; @ApiModelProperty(value = "整改时间") @JsonFormat(pattern="yyyy-MM-dd") private Date changeTime; @ApiModelProperty(value = "考核分值") @@ -88,6 +91,7 @@ private String checkName; @ApiModelProperty(value = "考核时间") @JsonFormat(pattern="yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date checkTime; @ApiModelProperty(value = "状态") @@ -106,6 +110,7 @@ private String createName; @ApiModelProperty(value = "创建时间") @JsonFormat(pattern="yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date createTime; @ApiModelProperty(value = "更新人id") @@ -115,6 +120,7 @@ private String updateName; @ApiModelProperty(value = "更新时间") @JsonFormat(pattern="yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date updateTime; @ApiModelProperty(value = "基础附件") screen-api/src/main/java/com/moral/api/pojo/vo/allocationextension/AllocationExtensionPageVo.java
@@ -1,5 +1,6 @@ package com.moral.api.pojo.vo.allocationextension; import com.fasterxml.jackson.annotation.JsonFormat; import com.moral.api.pojo.ext.allocationextension.AllocationExtensionPageExt; import com.moral.api.utils.BeanConverts; import io.swagger.annotations.ApiModel; @@ -35,6 +36,7 @@ private String allocationNum; @ApiModelProperty(value = "上报时间") @JsonFormat(pattern="yyyy-MM-dd") private Date escalationTime; @ApiModelProperty(value = "责任单位id") private Integer unitId; @@ -68,6 +70,7 @@ private String createName; @ApiModelProperty(value = "创建时间") @JsonFormat(pattern="yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date createTime; @ApiModelProperty(value = "更新人id") @@ -77,6 +80,7 @@ private String updateName; @ApiModelProperty(value = "更新时间") @JsonFormat(pattern="yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date updateTime; screen-api/src/main/java/com/moral/api/pojo/vo/allocationextension/AllocationExtensionVo.java
@@ -1,6 +1,8 @@ package com.moral.api.pojo.vo.allocationextension; import com.fasterxml.jackson.annotation.JsonFormat; import com.moral.api.pojo.ext.allocationextension.AllocationExtensionExt; import com.moral.api.pojo.vo.file.FileVo; import com.moral.api.utils.BeanConverts; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -10,6 +12,7 @@ import java.io.Serializable; import java.util.Date; import java.util.List; /** * <p> @@ -29,8 +32,50 @@ @ApiModelProperty(value = "主键id") private Integer id; @ApiModelProperty(value = "交办单id") private Integer allocationId; @ApiModelProperty(value = "交办单号") private String allocationNum; @ApiModelProperty(value = "上报时间") @JsonFormat(pattern="yyyy-MM-dd") private Date escalationTime; @ApiModelProperty(value = "污染位置") private String pollutePosition; @ApiModelProperty(value = "责任单位id") private Integer unitId; @ApiModelProperty(value = "污染分类id") private Integer polluteType; @ApiModelProperty(value = "整改类型id") private Integer changeType; @ApiModelProperty(value = "期限天数") private Integer changeDay; @ApiModelProperty(value = "上报单位id") private Integer escalationUnitId; @ApiModelProperty(value = "上报人") private String escalationName; @ApiModelProperty(value = "排查方式id") private Integer investigationType; @ApiModelProperty(value = "问题描述") private String problemDescribe; @ApiModelProperty(value = "基础附件") private List<FileVo> fileBaseList; @ApiModelProperty(value = "延期附件") private List<FileVo> fileList; @ApiModelProperty(value = "延期天数") private Integer extensionNum; @@ -40,9 +85,6 @@ @ApiModelProperty(value = "状态") private Integer state; @ApiModelProperty(value = "是否删除") private Integer isDel; @ApiModelProperty(value = "是否作废") private Integer isInvalid; @@ -57,6 +99,7 @@ private String createName; @ApiModelProperty(value = "创建时间") @JsonFormat(pattern="yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date createTime; @ApiModelProperty(value = "更新人id") @@ -66,6 +109,7 @@ private String updateName; @ApiModelProperty(value = "更新时间") @JsonFormat(pattern="yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date updateTime; screen-api/src/main/java/com/moral/api/pojo/vo/approvetable/ApproveTableListVo.java
@@ -1,5 +1,6 @@ package com.moral.api.pojo.vo.approvetable; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -40,6 +41,7 @@ private String createName; @ApiModelProperty(value = "创建时间") @JsonFormat(pattern="yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date createTime; } screen-api/src/main/java/com/moral/api/service/AllocationExtensionService.java
@@ -39,5 +39,6 @@ */ boolean save(AllocationExtensionAddCond allocationExtensionAddCond); boolean check(Integer id,Integer sate); } screen-api/src/main/java/com/moral/api/service/AllocationService.java
@@ -37,6 +37,8 @@ */ AllocationExt extOne(Integer id); AllocationExt oneAllocation(Integer id); void changeAllocation(AllocationChangeCond changeCond); void checkAllocation(AllocationCheckCond checkCond); screen-api/src/main/java/com/moral/api/service/impl/AllocationExtensionServiceImpl.java
@@ -2,14 +2,22 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.moral.api.entity.Allocation; import com.moral.api.entity.AllocationExtension; import com.moral.api.exception.BusinessException; import com.moral.api.mapper.AllocationExtensionMapper; import com.moral.api.pojo.enums.AllocationExtensionApproveEnum; import com.moral.api.pojo.enums.FileTableEnum; import com.moral.api.pojo.ext.allocation.AllocationExt; import com.moral.api.pojo.ext.allocationextension.AllocationExtensionExt; import com.moral.api.pojo.ext.allocationextension.AllocationExtensionPageExt; import com.moral.api.pojo.query.allocationextension.AllocationExtensionAddCond; import com.moral.api.pojo.query.allocationextension.AllocationExtensionPageCond; import com.moral.api.service.AllocationExtensionService; import com.moral.api.service.AllocationService; import com.moral.api.service.FileTableService; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; /** * <p> @@ -22,12 +30,33 @@ @Service public class AllocationExtensionServiceImpl extends ServiceImpl<AllocationExtensionMapper, AllocationExtension> implements AllocationExtensionService { // private final All private final AllocationService allocationService; private final FileTableService fileTableService; public AllocationExtensionServiceImpl(AllocationService allocationService, FileTableService fileTableService) { this.allocationService = allocationService; this.fileTableService = fileTableService; } @Override public AllocationExtensionExt extOne(Integer id) { return this.baseMapper.extOne(id); AllocationExtensionExt extensionExt = this.baseMapper.extOne(id); AllocationExt extOne = allocationService.oneAllocation(extensionExt.getAllocationId()); extensionExt.setAllocationNum(extOne.getAllocationNum()) .setEscalationTime(extOne.getEscalationTime()) .setPollutePosition(extOne.getPollutePosition()) .setUnitId(extOne.getUnitId()) .setPolluteType(extOne.getPolluteType()) .setChangeType(extOne.getChangeType()) .setChangeDay(extOne.getChangeDay()) .setEscalationName(extOne.getEscalationName()) .setInvestigationType(extOne.getInvestigationType()) .setProblemDescribe(extOne.getProblemDescribe()) .setEscalationUnitId(extOne.getEscalationUnitId()); extensionExt.setFileBaseList(fileTableService.list(extensionExt.getAllocationId(), FileTableEnum.ALLOCATION_FOUNDATION.value)); extensionExt.setFileList(fileTableService.list(id, FileTableEnum.ALLOCATION_EXTENSION.value)); return extensionExt; } @@ -42,5 +71,23 @@ return this.save(allocationExtensionAddCond.convert()); } @Override @Transactional public boolean check(Integer id, Integer sate) { AllocationExtensionExt extensionExt = this.baseMapper.extOne(id); if(!AllocationExtensionApproveEnum.APPLYING.value.equals(extensionExt.getState())){ throw new BusinessException("审批中才能发起审批!"); } AllocationExtension allocationExtension = new AllocationExtension(); allocationExtension.setId(id); allocationExtension.setState(sate); this.baseMapper.updateById(allocationExtension); if(AllocationExtensionApproveEnum.PASS.value.equals(sate)){ Allocation allocation = new Allocation(); allocation.setAllocationId(extensionExt.getAllocationId()); allocation.setChangeDay(extensionExt.getChangeDay()+extensionExt.getExtensionNum()); allocationService.updateById(allocation); } return true; } } screen-api/src/main/java/com/moral/api/service/impl/AllocationServiceImpl.java
@@ -274,7 +274,8 @@ return allocationExt; } private AllocationExt oneAllocation(Integer id){ @Override public AllocationExt oneAllocation(Integer id){ return this.baseMapper.extOne(id); } screen-api/src/main/resources/mapper/AllocationExtensionMapper.xml
@@ -27,7 +27,7 @@ SELECT <include refid="AllocationExtension_Column_List"/> FROM allocation_extension allocationextension where allocationextension.id = #{id} where allocationextension.id = #{id} and allocationextension.is_del = 0 </select>