jinpengyong
2023-09-26 b9086588c215b7493682d65d49ed1070d88c3058
Merge remote-tracking branch 'origin/wb' into wb

# Conflicts:
# screen-api/src/main/java/com/moral/api/controller/AllocationController.java
# screen-api/src/main/java/com/moral/api/service/AllocationService.java
# screen-api/src/main/java/com/moral/api/service/impl/AllocationServiceImpl.java
48 files added
17 files modified
3312 ■■■■■ changed files
screen-api/pom.xml 9 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/config/mybatis/MybatisPlusConfig.java 2 ●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/config/mybatis/PlusConfig.java 125 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/controller/AllocationController.java 89 ●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/controller/AllocationExtensionController.java 64 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/controller/DictController.java 2 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/entity/Allocation.java 27 ●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/entity/AllocationExtension.java 56 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/entity/ApproveTable.java 21 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/exception/GlobalExceptionHandler.java 16 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/mapper/AllocationExtensionMapper.java 37 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/mapper/AllocationMapper.java 25 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/bean/BaseCreateEntity.java 53 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/bean/BaseDelEntity.java 33 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/bean/BaseEntity.java 13 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/bean/BaseInvalidEntity.java 31 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/bean/BaseUpdateEntity.java 53 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/enums/AllocationApproveEnum.java 10 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/enums/AllocationEscalationTypeEnum.java 59 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/enums/AllocationExtensionApproveEnum.java 68 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/enums/FileTableEnum.java 5 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/enums/YesOrNo.java 2 ●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/ext/allocation/AllocationExt.java 37 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/ext/allocation/AllocationListExt.java 22 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/ext/allocation/AllocationPageExt.java 24 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/ext/allocationextension/AllocationExtensionExt.java 69 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/ext/allocationextension/AllocationExtensionListExt.java 22 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/ext/allocationextension/AllocationExtensionPageExt.java 40 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/query/OrderByItem.java 41 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/query/OrderType.java 55 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/query/PageCond.java 44 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/query/allocation/AllocationAddCond.java 77 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/query/allocation/AllocationChangeCond.java 58 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/query/allocation/AllocationCheckCond.java 53 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/query/allocation/AllocationListCond.java 37 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/query/allocation/AllocationPageCond.java 54 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/query/allocation/AllocationUpdateCond.java 84 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/query/allocationextension/AllocationExtensionAddCond.java 51 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/query/allocationextension/AllocationExtensionListCond.java 28 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/query/allocationextension/AllocationExtensionPageCond.java 49 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/query/allocationextension/AllocationExtensionUpdateCond.java 76 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/query/approvetable/ApproveTableAddCond.java 70 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/query/approvetable/ApproveTableListCond.java 28 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/query/approvetable/ApproveTablePageCond.java 31 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/query/approvetable/ApproveTableUpdateCond.java 70 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/vo/DictionaryVo.java 11 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/vo/allocation/AllocationPageVo.java 122 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/vo/allocation/AllocationVo.java 144 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/vo/allocationextension/AllocationExtensionListVo.java 83 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/vo/allocationextension/AllocationExtensionPageVo.java 96 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/vo/allocationextension/AllocationExtensionVo.java 122 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/vo/approvetable/ApproveTableListVo.java 47 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/service/AllocationExtensionService.java 44 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/service/AllocationService.java 37 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/service/ApproveTableService.java 29 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/service/FileTableService.java 4 ●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/service/impl/AllocationExtensionServiceImpl.java 93 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/service/impl/AllocationServiceImpl.java 234 ●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/service/impl/ApproveTableServiceImpl.java 50 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/service/impl/FileTableServiceImpl.java 49 ●●●●● patch | view | raw | blame | history
screen-api/src/main/resources/application-qa.yml 1 ●●●● patch | view | raw | blame | history
screen-api/src/main/resources/mapper/AllocationExtensionMapper.xml 69 ●●●●● patch | view | raw | blame | history
screen-api/src/main/resources/mapper/AllocationMapper.xml 96 ●●●●● patch | view | raw | blame | history
screen-common/src/main/java/com/moral/constant/PageInfo.java 27 ●●●●● patch | view | raw | blame | history
screen-common/src/main/java/com/moral/constant/PageResult.java 34 ●●●●● patch | view | raw | blame | history
screen-api/pom.xml
@@ -72,8 +72,17 @@
            <artifactId>poi-tl</artifactId>
            <version>1.5.1</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-validation</artifactId>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>net.coobird</groupId>
            <artifactId>thumbnailator</artifactId>
            <version>0.4.8</version>
screen-api/src/main/java/com/moral/api/config/mybatis/MybatisPlusConfig.java
@@ -22,7 +22,7 @@
import java.util.*;
@Configuration
/*@Configuration*/
public class MybatisPlusConfig {
    public static ThreadLocal<String> tableName = new ThreadLocal<>();
screen-api/src/main/java/com/moral/api/config/mybatis/PlusConfig.java
New file
@@ -0,0 +1,125 @@
package com.moral.api.config.mybatis;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import com.baomidou.mybatisplus.extension.injector.methods.LogicDeleteByIdWithFill;
import com.baomidou.mybatisplus.extension.plugins.OptimisticLockerInterceptor;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import com.moral.api.config.Interceptor.UserHelper;
import com.moral.api.pojo.enums.YesOrNo;
import com.moral.api.pojo.vo.user.QxUser;
import org.apache.ibatis.reflection.MetaObject;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.Date;
import java.util.List;
/**
 * @ClassName PlusConfig
 * @Description TODO
 * @Author @cjl
 * @Date 2023-09-25 10:28
 * @Version 1.0
 */
@Configuration
@MapperScan(basePackages = {"com.moral.*.mapper"})
public class PlusConfig {
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        return new PaginationInterceptor();
    }
    @Bean
    public OptimisticLockerInterceptor optimisticLockerInterceptor() {
        return new OptimisticLockerInterceptor();
    }
    @Bean
    public DefaultSqlInjector logicSqlInjector() {
        return new DefaultSqlInjector() {
            @Override
            public List<AbstractMethod> getMethodList(Class<?> mapperClass) {
                List<AbstractMethod> methodList = super.getMethodList(mapperClass);
                methodList.add(new LogicDeleteByIdWithFill());
                return methodList;
            }
        };
    }
    @Bean
    public MetaObjectHandler metaObjectHandler() {
        return new MetaObjectHandler() {
            private final static String IS_DEL = "isDel";
            private final static String IS_INVALID = "isInvalid";
            private final static String CREATOR_ID = "createId";
            private final static String CREATOR_NAME = "createName";
            private final static String CREATE_TIME = "createTime";
            private final static String LAST_MODIFY_ID = "updateId";
            private final static String LAST_MODIFY_NAME = "updateName";
            private final static String LAST_MODIFY_TIME = "updateTime";
            @Override
            public void insertFill(MetaObject metaObject) {
                if (metaObject.hasSetter(IS_DEL)) {
                    this.setFieldValByName(IS_DEL, 0, metaObject);
                }
                if (metaObject.hasSetter(IS_INVALID)) {
                    this.setFieldValByName(IS_INVALID, 0, metaObject);
                }
                creatorHandler(metaObject);
                lastModifyHandler(metaObject);
            }
            @Override
            public void updateFill(MetaObject metaObject) {
                lastModifyHandler(metaObject);
            }
            private void creatorHandler(MetaObject metaObject) {
                QxUser currentUser = UserHelper.getCurrentUser();
                Integer userId = currentUser == null ? 0 : currentUser.getUserId()==null?null:currentUser.getUserId().intValue();
                String userName = currentUser == null ? "admin" : currentUser.getUserName();
                if (metaObject.hasSetter(IS_INVALID)) {
                    this.strictInsertFill(metaObject, IS_INVALID, Integer.class, YesOrNo.NO.getValue());
                }
                if (metaObject.hasSetter(IS_DEL)) {
                    this.strictInsertFill(metaObject, IS_DEL, Integer.class, YesOrNo.NO.getValue());
                }
                if (metaObject.hasSetter(CREATOR_ID)) {
                    this.strictInsertFill(metaObject, CREATOR_ID, Integer.class, userId);
                }
                if (metaObject.hasSetter(CREATOR_NAME)) {
                    this.strictInsertFill(metaObject, CREATOR_NAME, String.class, userName);
                }
                if (metaObject.hasSetter(CREATE_TIME)) {
                    this.strictInsertFill(metaObject, CREATE_TIME, Date.class, new Date());
                }
            }
            private void lastModifyHandler(MetaObject metaObject) {
                QxUser currentUser = UserHelper.getCurrentUser();
                Integer userId = currentUser == null ? 0 : currentUser.getUserId()==null?null:currentUser.getUserId().intValue();
                String userName = currentUser == null ? "admin" : currentUser.getUserName();
                if (metaObject.hasSetter(LAST_MODIFY_ID)) {
                    this.strictUpdateFill(metaObject, LAST_MODIFY_ID, Integer.class, userId);
                }
                if (metaObject.hasSetter(LAST_MODIFY_NAME)) {
                    this.strictUpdateFill(metaObject, LAST_MODIFY_NAME, String.class, userName);
                }
                if (metaObject.hasSetter(LAST_MODIFY_TIME)) {
                    this.strictUpdateFill(metaObject, LAST_MODIFY_TIME, Date.class, new Date());
                }
            }
        };
    }
}
screen-api/src/main/java/com/moral/api/controller/AllocationController.java
@@ -7,13 +7,17 @@
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections4.CollectionUtils;
import org.aspectj.apache.bcel.generic.RET;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.moral.api.pojo.ext.allocation.AllocationExt;
import com.moral.api.pojo.ext.allocation.AllocationPageExt;
import com.moral.api.pojo.query.allocation.*;
import com.moral.api.pojo.query.allocationextension.AllocationExtensionAddCond;
import com.moral.api.pojo.vo.allocation.AllocationPageVo;
import com.moral.api.pojo.vo.allocation.AllocationVo;
import com.moral.constant.PageResult;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.lang.reflect.Field;
import java.util.ArrayList;
@@ -33,6 +37,8 @@
import com.moral.constant.Constants;
import com.moral.constant.ResultMessage;
import com.moral.util.WebUtils;
import javax.validation.Valid;
@Api(tags = {"立行立改"})
@@ -55,9 +61,6 @@
    }
    @ApiOperation(value = "责任单位", notes = "责任单位")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "token", required = true, paramType = "header", dataType = "String")
@@ -73,7 +76,8 @@
     * @return
     */
    @PostMapping("insert")
    public  ResultMessage insert(@RequestBody Allocation allocation){
    @ApiOperation("新增")
    public  ResultMessage insert(@Valid @RequestBody AllocationAddCond allocation){
        allocationService.insertAllocation(allocation);
        return ResultMessage.ok();
    }
@@ -83,23 +87,39 @@
     * 查看交办单
     * @return
     */
    @GetMapping("check")
   /* @GetMapping("check")
    public ResultMessage check(Integer id){
        allocationService.check(id);
        return ResultMessage.ok();
    }
    }*/
    /**
     * 修改表单
     * @param allocation
     * @param allocationUpdateCond
     * @return
     *
     *
     */
    @PostMapping("update")
    public ResultMessage update(@RequestBody Allocation allocation){
        allocationService.updateAll(allocation);
    @ApiOperation("修改")
    public ResultMessage update(@Valid @RequestBody AllocationUpdateCond allocationUpdateCond){
        allocationService.updateAll(allocationUpdateCond);
        return ResultMessage.ok();
    }
    @PostMapping("change")
    @ApiOperation("整改")
    public ResultMessage changeAllocation(@Valid @RequestBody AllocationChangeCond changeCond){
        allocationService.changeAllocation(changeCond);
        return ResultMessage.ok();
    }
    @PostMapping("check")
    @ApiOperation("审批")
    public ResultMessage checkAllocation(@Valid @RequestBody AllocationCheckCond checkCond){
        allocationService.checkAllocation(checkCond);
        return ResultMessage.ok();
    }
    /**
     * 根据条件查询
     * @return
@@ -110,6 +130,45 @@
        return ResultMessage.ok();
    }
    @PostMapping("/page")
    @ApiOperation("分页")
    public ResultMessage<PageResult<AllocationPageVo>> page(@Valid @RequestBody AllocationPageCond allocationPageCond) {
        Page<AllocationPageExt> page = allocationService.extPage(allocationPageCond);
        PageResult<AllocationPageVo> result = new PageResult<>(page);
        result.setList(AllocationPageVo.convert(page.getRecords()));
        return ResultMessage.ok(result);
    }
    @GetMapping("/detail")
    @ApiOperation("详情")
    public ResultMessage<AllocationVo> get(Integer id) {
        AllocationExt allocationext = allocationService.extOne(id);
        AllocationVo allocationVo = AllocationVo.convert(allocationext);
        allocationVo.setFileBaseList(allocationext.getFileBaseList());
        allocationVo.setFileChangeList(allocationext.getFileChangeList());
        allocationVo.setFileApproveList(allocationext.getFileApproveList());
        allocationVo.setApproveList(allocationext.getApproveList());
        return ResultMessage.ok(allocationVo);
    }
    @GetMapping("remove")
    @ApiOperation("删除")
    public ResultMessage removeById(Integer id){
        allocationService.removeById(id);
        return ResultMessage.ok();
    }
    @GetMapping("invalid")
    @ApiOperation("作废")
    public ResultMessage invalidResult(@RequestParam @ApiParam(value = "id",name = "主键id") Integer id,
                                       @RequestParam @ApiParam(value = "invalidReason",name = "作废理由") String invalidReason){
        allocationService.invalidResult(id,invalidReason);
        return ResultMessage.ok();
    }
    @PostMapping("/applyfor")
    @ApiOperation("申请延期")
    public ResultMessage applyFor(@Valid @RequestBody AllocationExtensionAddCond allocationExtensionAddCond) {
        return allocationService.applyFor(allocationExtensionAddCond) ? ResultMessage.ok() : ResultMessage.fail();
    }
    /**
     * 查询表单总览
screen-api/src/main/java/com/moral/api/controller/AllocationExtensionController.java
New file
@@ -0,0 +1,64 @@
package com.moral.api.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.pojo.vo.allocationextension.AllocationExtensionPageVo;
import com.moral.api.pojo.vo.allocationextension.AllocationExtensionVo;
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;
/**
 * <p>
 * 交办单延期 前端控制器
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
@RestController
@RequestMapping("/allocationExtension")
@Api(tags = {"延期申请"})
public class AllocationExtensionController {
    private final AllocationExtensionService allocationExtensionService;
    public AllocationExtensionController(AllocationExtensionService allocationExtensionService) {
        this.allocationExtensionService = allocationExtensionService;
    }
    @GetMapping("/detail")
    @ApiOperation("详情")
    public ResultMessage<AllocationExtensionVo> get(Integer id) {
        AllocationExtensionExt allocationExtensionext = allocationExtensionService.extOne(id);
        return ResultMessage.ok(allocationExtensionext == null ? null : AllocationExtensionVo.convert(allocationExtensionext));
    }
    @PostMapping("/page")
    @ApiOperation("分页")
    public ResultMessage<PageResult<AllocationExtensionPageVo>> page(@Valid @RequestBody AllocationExtensionPageCond allocationExtensionPageCond) {
        Page<AllocationExtensionPageExt> page = allocationExtensionService.extPage(allocationExtensionPageCond);
        PageResult<AllocationExtensionPageVo> result = new PageResult<>(page);
        result.setList(AllocationExtensionPageVo.convert(page.getRecords()));
        return ResultMessage.ok(result);
    }
    @GetMapping("check")
    @ApiOperation("审批")
    public ResultMessage check(@RequestParam @ApiParam(value = "id",name = "主键id") Integer id,
                                       @RequestParam @ApiParam(value = "state",name = "状态") Integer state){
        allocationExtensionService.check(id,state);
        return ResultMessage.ok();
    }
}
screen-api/src/main/java/com/moral/api/controller/DictController.java
@@ -30,6 +30,8 @@
                .setInvestigationEnum(InvestigationEnum.values())
                .setYesOrNo(YesOrNo.values())
                .setFileTableEnum(FileTableEnum.values())
                .setAllocationApproveEnum(AllocationApproveEnum.values())
                .setAllocationExtensionApproveEnum(AllocationExtensionApproveEnum.values())
                ;
        return ResultMessage.ok(dictionaryVo);
    }
screen-api/src/main/java/com/moral/api/entity/Allocation.java
@@ -1,6 +1,7 @@
package com.moral.api.entity;
import com.moral.api.pojo.bean.BaseInvalidEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -13,7 +14,7 @@
@Data
@EqualsAndHashCode(callSuper = false)
public class Allocation extends Model<Allocation> {
public class Allocation extends BaseInvalidEntity<Allocation> {
    private static final long serialVersionUID = 1L;
@@ -32,7 +33,7 @@
    /**
     * 自查or核查
     */
    private String escalationType;
    private Integer escalationType;
    /**
     * 上报时间
@@ -129,31 +130,11 @@
    /**
     * 状态 0 创建  1 整改 2审核 3 拒绝 4 通过
     */
    private String state;
    /**
     * 是否删除
     */
    private String isDel;
    /**
     * 是否作废
     */
    private String isInvalid;
    private Integer state;
    /**
     * 作废理由
     */
    private String invalidReason;
    private Integer createId;
    private String createName;
    private Date createTime;
    private Integer updateId;
    private String updateName;
    private Date updateTime;
}
screen-api/src/main/java/com/moral/api/entity/AllocationExtension.java
New file
@@ -0,0 +1,56 @@
package com.moral.api.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.moral.api.pojo.bean.BaseInvalidEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
 * <p>
 * 交办单延期
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class AllocationExtension extends BaseInvalidEntity<AllocationExtension> {
    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 交办单id
     */
    private Integer allocationId;
    /**
     * 延期天数
     */
    private Integer extensionNum;
    /**
     * 延期理由
     */
    private String remake;
    /**
     * 状态
     */
    private Integer state;
    /**
     * 作废理由
     */
    private String invalidReason;
}
screen-api/src/main/java/com/moral/api/entity/ApproveTable.java
@@ -1,6 +1,7 @@
package com.moral.api.entity;
import com.moral.api.pojo.bean.BaseDelEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -12,7 +13,7 @@
@Data
@EqualsAndHashCode(callSuper = false)
public class ApproveTable extends Model<ApproveTable> {
public class ApproveTable extends BaseDelEntity<ApproveTable> {
    private static final long serialVersionUID = 1L;
@@ -43,25 +44,7 @@
     */
    private String stateName;
    /**
     * 是否删除
     *
     */
    private Integer isDel;
    private Integer createId;
    private String createName;
    private Date createTime;
    private Integer updateId;
    private String updateName;
    private Date updateTime;
screen-api/src/main/java/com/moral/api/exception/GlobalExceptionHandler.java
@@ -1,15 +1,24 @@
package com.moral.api.exception;
import com.alibaba.druid.wall.violation.ErrorCode;
import com.moral.api.utils.StringUtils;
import com.moral.constant.Constants;
import com.moral.constant.ResponseCodeEnum;
import com.moral.constant.ResultMessage;
import com.moral.exception.TokenException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.support.DefaultMessageSourceResolvable;
import org.springframework.http.HttpStatus;
import org.springframework.validation.FieldError;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@ControllerAdvice
@@ -36,6 +45,13 @@
        return ResultMessage.fail(ResponseCodeEnum.FAIL.getCode(), "请求用户数据失败");
    }
    @ExceptionHandler
    public ResultMessage exceptionHandler(MethodArgumentNotValidException e){
        List<String> collect = e.getBindingResult().getFieldErrors().stream().map(DefaultMessageSourceResolvable::getDefaultMessage)
                .collect(Collectors.toList());
        return ResultMessage.fail(ResponseCodeEnum.FAIL.getCode(), StringUtils.join(collect, ","));
    }
    /**
     * 处理TokenException异常
     */
screen-api/src/main/java/com/moral/api/mapper/AllocationExtensionMapper.java
New file
@@ -0,0 +1,37 @@
package com.moral.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.moral.api.entity.AllocationExtension;
import com.moral.api.pojo.ext.allocationextension.AllocationExtensionExt;
import com.moral.api.pojo.ext.allocationextension.AllocationExtensionPageExt;
import com.moral.api.pojo.query.allocationextension.AllocationExtensionPageCond;
import org.apache.ibatis.annotations.Param;
/**
 * <p>
 * 交办单延期 Mapper 接口
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
public interface AllocationExtensionMapper extends BaseMapper<AllocationExtension> {
    /**
     * 查询单个详情
     * @param id
     * @return AllocationExtensionExt
     */
    AllocationExtensionExt extOne(@Param("id") Integer id);
    /**
     * 查询分页详情
     * @param page
     * @param allocation
     * @return AllocationExtensionPageExt
     */
    Page<AllocationExtensionPageExt> extPage(Page page, @Param("allocation") AllocationExtensionPageCond allocation);
}
screen-api/src/main/java/com/moral/api/mapper/AllocationMapper.java
@@ -1,8 +1,33 @@
package com.moral.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.moral.api.entity.Allocation;
import com.moral.api.pojo.ext.allocation.AllocationExt;
import com.moral.api.pojo.ext.allocation.AllocationListExt;
import com.moral.api.pojo.ext.allocation.AllocationPageExt;
import com.moral.api.pojo.query.allocation.AllocationListCond;
import com.moral.api.pojo.query.allocation.AllocationPageCond;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface AllocationMapper extends BaseMapper<Allocation> {
    /**
     * 查询单个详情
     * @param id
     * @return AllocationExt
     */
    AllocationExt extOne(@Param("id") Integer id);
    Page<AllocationPageExt> extPage(Page page, @Param("allocation") AllocationPageCond allocationPageCond);
    /**
     * 查询列表详情
     * @param allocationListCond
     * @return AllocationListExt
     */
    List<AllocationListExt> extList(@Param("allocation") AllocationListCond allocationListCond);
}
screen-api/src/main/java/com/moral/api/pojo/bean/BaseCreateEntity.java
New file
@@ -0,0 +1,53 @@
package com.moral.api.pojo.bean;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Getter;
import java.io.Serializable;
import java.util.Date;
/**
 * @ClassName BaseCreateEntity
 * @Description TODO
 * @Author @cjl
 * @Date 2023-09-25 10:54
 * @Version 1.0
 */
@Getter
@SuppressWarnings("unchecked")
public abstract  class BaseCreateEntity <T extends Serializable> implements BaseEntity<T>{
    /**
     * 创建人ID
     */
    @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    private Integer createId;
    /**
     * 创建人姓名
     */
    @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    private String createName;
    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    private Date createTime;
    public T setCreateUserId(Integer createId) {
        this.createId = createId;
        return (T) this;
    }
    public T setCreateUserName(String createName) {
        this.createName = createName;
        return (T) this;
    }
    public T setCreateTime(Date createTime) {
        this.createTime = createTime;
        return (T) this;
    }
}
screen-api/src/main/java/com/moral/api/pojo/bean/BaseDelEntity.java
New file
@@ -0,0 +1,33 @@
package com.moral.api.pojo.bean;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
/**
 * @ClassName BaseDelEntity
 * @Description TODO
 * @Author @cjl
 * @Date 2023-09-25 11:01
 * @Version 1.0
 */
public abstract class BaseDelEntity <T extends Serializable> extends BaseUpdateEntity<T>{
    /**
     * 是否删除
     */
    @TableLogic
    @TableField(fill = FieldFill.INSERT_UPDATE, updateStrategy = FieldStrategy.NOT_NULL)
    private Integer isDel;
    public T setIsDel(Integer isDel) {
        this.isDel = isDel;
        return (T) this;
    }
    public Integer getIsDel() {
        return isDel;
    }
}
screen-api/src/main/java/com/moral/api/pojo/bean/BaseEntity.java
New file
@@ -0,0 +1,13 @@
package com.moral.api.pojo.bean;
import java.io.Serializable;
/**
 * @ClassName BaseEntity
 * @Description TODO
 * @Author @cjl
 * @Date 2023-09-25 10:56
 * @Version 1.0
 */
public interface BaseEntity <T extends Serializable> extends Serializable{
}
screen-api/src/main/java/com/moral/api/pojo/bean/BaseInvalidEntity.java
New file
@@ -0,0 +1,31 @@
package com.moral.api.pojo.bean;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
/**
 * @ClassName BaseInvalidEntity
 * @Description TODO
 * @Author @cjl
 * @Date 2023-09-25 11:00
 * @Version 1.0
 */
public abstract  class BaseInvalidEntity <T extends Serializable> extends BaseDelEntity<T>{
    /**
     * 是否作废
     */
    @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    private Integer isInvalid;
    public T setIsInvalid(Integer isInvalid) {
        this.isInvalid = isInvalid;
        return (T) this;
    }
    public Integer getIsInvalid() {
        return isInvalid;
    }
}
screen-api/src/main/java/com/moral/api/pojo/bean/BaseUpdateEntity.java
New file
@@ -0,0 +1,53 @@
package com.moral.api.pojo.bean;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Getter;
import java.io.Serializable;
import java.util.Date;
/**
 * @ClassName BaseUpdateEntity
 * @Description TODO
 * @Author @cjl
 * @Date 2023-09-25 10:57
 * @Version 1.0
 */
@Getter
@SuppressWarnings("unchecked")
public abstract class BaseUpdateEntity <T extends Serializable> extends BaseCreateEntity<T>{
    /**
     * 更新人ID
     */
    @TableField(fill = FieldFill.INSERT_UPDATE, updateStrategy = FieldStrategy.NOT_NULL)
    private Integer updateId;
    /**
     * 更新人姓名
     */
    @TableField(fill = FieldFill.INSERT_UPDATE, updateStrategy = FieldStrategy.NOT_NULL)
    private String updateName;
    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE, updateStrategy = FieldStrategy.NOT_NULL)
    private Date updateTime;
    public T setUpdateId(Integer updateId) {
        this.updateId = updateId;
        return (T) this;
    }
    public T setUpdateName(String updateName) {
        this.updateName = updateName;
        return (T) this;
    }
    public T setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
        return (T) this;
    }
}
screen-api/src/main/java/com/moral/api/pojo/enums/AllocationApproveEnum.java
@@ -20,13 +20,21 @@
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum AllocationApproveEnum implements IntegerValueEnum{
    /**
     *草稿
     */
    DRAFT(9, "草稿"),
    /**
     *新建
     */
    NEW_BUILT(10, "新建"),
    /**
     *整改中
     */
    UNDER_RECTIFICATION(20, "整改中"),
   // CHANGE(19, "整改"),
    /**
     *整改中
     */
    UNDER_RECTIFICATION(20, "整改"),
    /**
     *审批中
     */
screen-api/src/main/java/com/moral/api/pojo/enums/AllocationEscalationTypeEnum.java
New file
@@ -0,0 +1,59 @@
package com.moral.api.pojo.enums;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.moral.api.exception.BusinessException;
import lombok.Getter;
import java.util.HashMap;
import java.util.Map;
/**
 * @ClassName StateEnum
 * @Description TODO
 * @Author @lizijie
 * @Date 2023-09-20 11:11
 * @Version 1.0
 */
@Getter
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum AllocationEscalationTypeEnum implements IntegerValueEnum {
    /**
     *自查
     */
    SELF(1, "自查"),
    /**
     *核查
     */
    CHECK(2, "核查"),
   ;
    @EnumValue
    public  final Integer value;
    public  final String name;
    AllocationEscalationTypeEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }
    private static Map<Integer, AllocationEscalationTypeEnum> valueMap = new HashMap<>();
    static {
        for (AllocationEscalationTypeEnum v : AllocationEscalationTypeEnum.values()) {
            valueMap.put(v.value, v);
        }
    }
    @JsonCreator
    public static AllocationEscalationTypeEnum getByValue(Integer value) {
        if (value == null) {
            return null;
        }
        AllocationEscalationTypeEnum result = valueMap.get(value);
        if (result == null) {
            throw new BusinessException("枚举转换异常" + value);
        }
        return result;
    }
}
screen-api/src/main/java/com/moral/api/pojo/enums/AllocationExtensionApproveEnum.java
New file
@@ -0,0 +1,68 @@
package com.moral.api.pojo.enums;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.moral.api.exception.BusinessException;
import lombok.Getter;
import java.util.HashMap;
import java.util.Map;
/**
 * @ClassName InvestigationEnum
 * @Description TODO
 * @Author @cjl
 * @Date 2023-09-20 14:47
 * @Version 1.0
 */
@Getter
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum AllocationExtensionApproveEnum implements IntegerValueEnum{
    /**
     *未申请
     */
    NOT_AAPPROVE(10, "未审批"),
    /**
     *申请中
     */
    APPLYING(30, "审批中"),
    /**
     *通过
     */
    PASS(40, "通过"),
    /**
     *拒绝
     */
    REFUSE(50, "拒绝"),
    ;
    @EnumValue
    public  final Integer value;
    public  final String name;
    AllocationExtensionApproveEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }
    private static Map<Integer, AllocationExtensionApproveEnum> valueMap = new HashMap<>();
    static {
        for (AllocationExtensionApproveEnum v : AllocationExtensionApproveEnum.values()) {
            valueMap.put(v.value, v);
        }
    }
    @JsonCreator
    public static AllocationExtensionApproveEnum getByValue(Integer value) {
        if (value == null) {
            return null;
        }
        AllocationExtensionApproveEnum result = valueMap.get(value);
        if (result == null) {
            throw new BusinessException("枚举转换异常" + value);
        }
        return result;
    }
}
screen-api/src/main/java/com/moral/api/pojo/enums/FileTableEnum.java
@@ -32,6 +32,11 @@
     */
    ALLOCATION_APPROVE(1010203, "交办单审批"),
    /**
     *延期申请
     */
    ALLOCATION_EXTENSION(1251701, "延期申请"),
    ;
    @EnumValue
screen-api/src/main/java/com/moral/api/pojo/enums/YesOrNo.java
@@ -26,7 +26,7 @@
    /**
     *已生效
     */
    No(0, "否");
    NO(0, "否");
    @EnumValue
    public  final Integer value;
screen-api/src/main/java/com/moral/api/pojo/ext/allocation/AllocationExt.java
New file
@@ -0,0 +1,37 @@
package com.moral.api.pojo.ext.allocation;
import com.moral.api.entity.Allocation;
import com.moral.api.pojo.vo.approvetable.ApproveTableListVo;
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.List;
/**
 * <p>
 * 交办单
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class AllocationExt extends Allocation {
    @ApiModelProperty(value = "基础附件")
    private List<FileVo> fileBaseList;
    @ApiModelProperty(value = "整改附件")
    private List<FileVo> fileChangeList;
    @ApiModelProperty(value = "审批附件")
    private List<FileVo> fileApproveList;
    @ApiModelProperty(value = "流程状态")
    private List<ApproveTableListVo> approveList;
}
screen-api/src/main/java/com/moral/api/pojo/ext/allocation/AllocationListExt.java
New file
@@ -0,0 +1,22 @@
package com.moral.api.pojo.ext.allocation;
import com.moral.api.entity.Allocation;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
 * <p>
 * 交办单
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class AllocationListExt extends Allocation {
}
screen-api/src/main/java/com/moral/api/pojo/ext/allocation/AllocationPageExt.java
New file
@@ -0,0 +1,24 @@
package com.moral.api.pojo.ext.allocation;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.moral.api.entity.Allocation;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
 * @ClassName AllocationPageExt
 * @Description TODO
 * @Author @cjl
 * @Date 2023-09-25 14:34
 * @Version 1.0
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class AllocationPageExt extends Allocation {
    private Integer applyState;
}
screen-api/src/main/java/com/moral/api/pojo/ext/allocationextension/AllocationExtensionExt.java
New file
@@ -0,0 +1,69 @@
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>
 * 交办单延期
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@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/ext/allocationextension/AllocationExtensionListExt.java
New file
@@ -0,0 +1,22 @@
package com.moral.api.pojo.ext.allocationextension;
import com.moral.api.entity.AllocationExtension;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
 * <p>
 * 交办单延期
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class AllocationExtensionListExt extends AllocationExtension {
}
screen-api/src/main/java/com/moral/api/pojo/ext/allocationextension/AllocationExtensionPageExt.java
New file
@@ -0,0 +1,40 @@
package com.moral.api.pojo.ext.allocationextension;
import com.moral.api.entity.AllocationExtension;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
 * <p>
 * 交办单延期
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class AllocationExtensionPageExt extends AllocationExtension {
    @ApiModelProperty(value = "交办单号")
    private String allocationNum;
    @ApiModelProperty(value = "上报时间")
    private Date escalationTime;
    @ApiModelProperty(value = "责任单位id")
    private Integer unitId;
    @ApiModelProperty(value = "污染分类id")
    private Integer polluteType;
    @ApiModelProperty(value = "整改类型id")
    private Integer changeType;
    @ApiModelProperty(value = "期限天数")
    private Integer changeDay;
}
screen-api/src/main/java/com/moral/api/pojo/query/OrderByItem.java
New file
@@ -0,0 +1,41 @@
package com.moral.api.pojo.query;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
/**
 * @Description
 *
 * @Date 2020/10/27 10:59
 * @Version 1.0
 */
@Data
@Accessors(chain = true)
@ApiModel(value = "排序对象", description = "排序对象")
public class OrderByItem {
    @ApiModelProperty(value = "排序字段名")
    private String name;
    @ApiModelProperty(value = "排序顺序")
    private OrderType order;
    public OrderItem convertOrderItem() {
        OrderItem orderItem = new OrderItem();
        switch (order) {
            case ASC:
                orderItem = OrderItem.asc(this.name);
                break;
            case DESC:
                orderItem = OrderItem.desc(this.name);
                break;
            default:
                break;
        }
        return orderItem;
    }
}
screen-api/src/main/java/com/moral/api/pojo/query/OrderType.java
New file
@@ -0,0 +1,55 @@
package com.moral.api.pojo.query;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import java.util.HashMap;
import java.util.Map;
/**
 * @Description
 *
 * @Date 2020/10/27 11:00
 * @Version 1.0
 */
@Getter
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum OrderType {
    /**
     * ASC
     */
    ASC("ascending"),
    /**
     * DESC
     */
    DESC("descending"),
    ;
    private static Map<String, OrderType> valueMap = new HashMap<>();
    static {
        for (OrderType orderType : OrderType.values()) {
            valueMap.put(orderType.code, orderType);
        }
    }
    @EnumValue
    public final String code;
    OrderType(String code) {
        this.code = code;
    }
    @JsonCreator
    public static OrderType getByValue(String code) {
        OrderType result = valueMap.get(code);
        if (result == null) {
            throw new IllegalArgumentException("No element matches " + code);
        }
        return result;
    }
}
screen-api/src/main/java/com/moral/api/pojo/query/PageCond.java
New file
@@ -0,0 +1,44 @@
package com.moral.api.pojo.query;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.commons.collections4.CollectionUtils;
import java.util.List;
import java.util.stream.Collectors;
/**
 *
 */
@Data
@Accessors(chain = true)
@ApiModel(value = "分页对象", description = "分页对象")
public class PageCond {
    @ApiModelProperty(value = "排序")
    private List<OrderByItem> orders;
    @ApiModelProperty(value = "每页数量")
    private long pageSize;
    @ApiModelProperty(value = "当前页码")
    private long currentPage;
    public List<OrderByItem> orders() {
        return this.orders;
    }
    public Page convertPage() {
        Page page = new Page();
        page.setCurrent(this.currentPage);
        page.setSize(this.pageSize);
        if (CollectionUtils.isNotEmpty(orders)) {
            page.setOrders(this.orders.stream().map(orderByItem -> orderByItem.convertOrderItem()).collect(Collectors.toList()));
        }
        return page;
    }
}
screen-api/src/main/java/com/moral/api/pojo/query/allocation/AllocationAddCond.java
New file
@@ -0,0 +1,77 @@
package com.moral.api.pojo.query.allocation;
import com.moral.api.entity.Allocation;
import com.moral.api.pojo.vo.file.FileVo;
import com.moral.api.utils.BeanConverts;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
 * <p>
 * 交办单
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="Allocation - 新增对象", description="Allocation - 新增对象")
public class AllocationAddCond implements Serializable {
    @ApiModelProperty(value = "上报时间")
    @NotNull(message = "上报时间不能为空!")
    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 = "状态")
    @NotNull(message = "状态不能为空!")
    private Integer state;
    @ApiModelProperty(value = "基础附件")
    private List<FileVo> fileBaseList;
    public Allocation convert() {
        Allocation allocation = BeanConverts.convert(this, Allocation.class);
        return allocation;
    }
}
screen-api/src/main/java/com/moral/api/pojo/query/allocation/AllocationChangeCond.java
New file
@@ -0,0 +1,58 @@
package com.moral.api.pojo.query.allocation;
import com.moral.api.entity.Allocation;
import com.moral.api.pojo.vo.file.FileVo;
import com.moral.api.utils.BeanConverts;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
 * <p>
 * 交办单
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="Allocation - 更新整改对象", description="Allocation - 更新整改对象")
public class AllocationChangeCond implements Serializable {
    @ApiModelProperty(value = "主键id")
    @NotNull(message = "主键id不能为空!")
    private Integer allocationId;
    @ApiModelProperty(value = "是否整改")
    @NotNull(message = "是否整改不能为空!")
    private Integer isChange;
    @ApiModelProperty(value = "整改反馈")
    private String changeDescribe;
    @ApiModelProperty(value = "整改人性名")
    @NotEmpty(message = "整改人性名不能为空!")
    private String changeName;
    @ApiModelProperty(value = "状态")
    @NotEmpty(message = "状态不能为空!")
    private Integer state;
    @ApiModelProperty(value = "整改附件")
    private List<FileVo> fileChangeList;
    public Allocation convert() {
        Allocation allocation = BeanConverts.convert(this, Allocation.class);
        return allocation;
    }
}
screen-api/src/main/java/com/moral/api/pojo/query/allocation/AllocationCheckCond.java
New file
@@ -0,0 +1,53 @@
package com.moral.api.pojo.query.allocation;
import com.moral.api.entity.Allocation;
import com.moral.api.pojo.vo.file.FileVo;
import com.moral.api.utils.BeanConverts;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
/**
 * <p>
 * 交办单
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="Allocation - 更新考核对象", description="Allocation - 更新考核对象")
public class AllocationCheckCond implements Serializable {
    @ApiModelProperty(value = "主键id")
    @NotNull(message = "主键id不能为空!")
    private Integer allocationId;
    @ApiModelProperty(value = "考核分值")
    @NotNull(message = "考核分值不能为空!")
    private Integer checkScore;
    @ApiModelProperty(value = "考核理由")
    private String checkDescribe;
    @ApiModelProperty(value = "状态")
    @NotEmpty(message = "状态不能为空!")
    private Integer state;
    @ApiModelProperty(value = "审批附件")
    private List<FileVo> fileApproveList;
    public Allocation convert() {
        Allocation allocation = BeanConverts.convert(this, Allocation.class);
        return allocation;
    }
}
screen-api/src/main/java/com/moral/api/pojo/query/allocation/AllocationListCond.java
New file
@@ -0,0 +1,37 @@
package com.moral.api.pojo.query.allocation;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
 * <p>
 * 交办单
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="Allocation - 列表查询对象", description="Allocation - 列表查询对象")
public class AllocationListCond implements Serializable {
    @ApiModelProperty(value = "责任单位id")
    private Integer unitId;
    @ApiModelProperty(value = "污染分类id")
    private Integer polluteType;
    @ApiModelProperty(value = "开始时间")
    private String startTime;
    @ApiModelProperty(value = "结束时间")
    private String endTime;
}
screen-api/src/main/java/com/moral/api/pojo/query/allocation/AllocationPageCond.java
New file
@@ -0,0 +1,54 @@
package com.moral.api.pojo.query.allocation;
import com.moral.api.pojo.query.PageCond;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
 * <p>
 * 交办单
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="Allocation - 分页查询对象", description="Allocation - 分页查询对象")
public class AllocationPageCond implements Serializable{
    @ApiModelProperty(value = "责任单位id")
    private Integer unitId;
    @ApiModelProperty(value = "污染分类id")
    private Integer polluteType;
    @ApiModelProperty(value = "流程状态")
    private Integer state;
    @ApiModelProperty(value = "排查方式id")
    private Integer investigationType;
    @ApiModelProperty(value = "整改类型id")
    private Integer changeType;
    @ApiModelProperty(value = "是否作废")
    private Integer isInvalid;
    @ApiModelProperty(value = "开始时间")
    private String startTime;
    @ApiModelProperty(value = "结束时间")
    private String endTime;
    @ApiModelProperty(value = "分页参数")
    private PageCond page;
}
screen-api/src/main/java/com/moral/api/pojo/query/allocation/AllocationUpdateCond.java
New file
@@ -0,0 +1,84 @@
package com.moral.api.pojo.query.allocation;
import com.moral.api.entity.Allocation;
import com.moral.api.pojo.vo.file.FileVo;
import com.moral.api.utils.BeanConverts;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
 * <p>
 * 交办单
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="Allocation - 更新对象", description="Allocation - 更新对象")
public class AllocationUpdateCond implements Serializable {
    @ApiModelProperty(value = "主键id")
    @NotNull(message = "主键id不能为空!")
    private Integer allocationId;
    @ApiModelProperty(value = "上报时间")
    @NotNull(message = "上报时间不能为空!")
    private Date escalationTime;
    @ApiModelProperty(value = "污染位置")
    @NotEmpty(message = "污染位置不能为空!")
    private String pollutePosition;
    @ApiModelProperty(value = "责任单位id")
    @NotNull(message = "责任单位不能为空!")
    private Integer unitId;
    @ApiModelProperty(value = "污染分类id")
    @NotNull(message = "污染分类不能为空!")
    private Integer polluteType;
    @ApiModelProperty(value = "整改类型id")
    @NotNull(message = "整改类型不能为空!")
    private Integer changeType;
    @ApiModelProperty(value = "期限天数")
    private Integer changeDay;
    @ApiModelProperty(value = "上报单位id")
    @NotNull(message = "上报单位不能为空!")
    private Integer escalationUnitId;
    @ApiModelProperty(value = "上报人")
    @NotEmpty(message = "上报人不能为空!")
    private String escalationName;
    @ApiModelProperty(value = "排查方式id")
    @NotNull(message = "排查方式不能为空!")
    private Integer investigationType;
    @ApiModelProperty(value = "问题描述")
    private String problemDescribe;
    @ApiModelProperty(value = "状态")
    private Integer state;
    @ApiModelProperty(value = "基础附件")
    private List<FileVo> fileBaseList;
    public Allocation convert() {
        Allocation allocation = BeanConverts.convert(this, Allocation.class);
        return allocation;
    }
}
screen-api/src/main/java/com/moral/api/pojo/query/allocationextension/AllocationExtensionAddCond.java
New file
@@ -0,0 +1,51 @@
package com.moral.api.pojo.query.allocationextension;
import com.moral.api.entity.AllocationExtension;
import com.moral.api.pojo.vo.file.FileVo;
import com.moral.api.utils.BeanConverts;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
 * <p>
 * 交办单延期
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="AllocationExtension - 新增对象", description="AllocationExtension - 新增对象")
public class AllocationExtensionAddCond implements Serializable {
    @ApiModelProperty(value = "交办单id")
    @NotNull(message = "交办单id不能为空!")
    private Integer allocationId;
    @ApiModelProperty(value = "延期天数")
    @NotNull(message = "延期天数不能为空!")
    private Integer extensionNum;
    @ApiModelProperty(value = "延期理由")
    @NotEmpty(message = "延期理由不能为空!")
    private String remake;
    @ApiModelProperty(value = "附件")
    private List<FileVo> fileList;
    public AllocationExtension convert() {
        AllocationExtension allocationExtension = BeanConverts.convert(this, AllocationExtension.class);
        return allocationExtension;
    }
}
screen-api/src/main/java/com/moral/api/pojo/query/allocationextension/AllocationExtensionListCond.java
New file
@@ -0,0 +1,28 @@
package com.moral.api.pojo.query.allocationextension;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
 * <p>
 * 交办单延期
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="AllocationExtension - 列表查询对象", description="AllocationExtension - 列表查询对象")
public class AllocationExtensionListCond implements Serializable {
    @ApiModelProperty(value = "ID")
    private Integer id;
}
screen-api/src/main/java/com/moral/api/pojo/query/allocationextension/AllocationExtensionPageCond.java
New file
@@ -0,0 +1,49 @@
package com.moral.api.pojo.query.allocationextension;
import com.moral.api.pojo.query.PageCond;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
 * <p>
 * 交办单延期
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="AllocationExtension - 分页查询对象", description="AllocationExtension - 分页查询对象")
public class AllocationExtensionPageCond implements Serializable{
    @ApiModelProperty(value = "责任单位id")
    private Integer unitId;
    @ApiModelProperty(value = "污染分类id")
    private Integer polluteType;
    @ApiModelProperty(value = "流程状态")
    private Integer state;
    @ApiModelProperty(value = "排查方式id")
    private Integer investigationType;
    @ApiModelProperty(value = "整改类型id")
    private Integer changeType;
    @ApiModelProperty(value = "开始时间")
    private String startTime;
    @ApiModelProperty(value = "结束时间")
    private String endTime;
    @ApiModelProperty(value = "分页参数")
    private PageCond page;
}
screen-api/src/main/java/com/moral/api/pojo/query/allocationextension/AllocationExtensionUpdateCond.java
New file
@@ -0,0 +1,76 @@
package com.moral.api.pojo.query.allocationextension;
import com.moral.api.entity.AllocationExtension;
import com.moral.api.utils.BeanConverts;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
 * <p>
 * 交办单延期
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="AllocationExtension - 更新对象", description="AllocationExtension - 更新对象")
public class AllocationExtensionUpdateCond implements Serializable {
    @ApiModelProperty(value = "主键id")
    private Integer id;
    @ApiModelProperty(value = "交办单id")
    private Integer allocationId;
    @ApiModelProperty(value = "延期天数")
    private Integer extensionNum;
    @ApiModelProperty(value = "延期理由")
    private String remake;
    @ApiModelProperty(value = "状态")
    private Integer state;
    @ApiModelProperty(value = "是否删除")
    private Integer isDel;
    @ApiModelProperty(value = "是否作废")
    private Integer isInvalid;
    @ApiModelProperty(value = "作废理由")
    private String invalidReason;
    @ApiModelProperty(value = "创建人id")
    private Integer createId;
    @ApiModelProperty(value = "创建人姓名")
    private String createName;
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    @ApiModelProperty(value = "更新人id")
    private Integer updateId;
    @ApiModelProperty(value = "更新人姓名")
    private String updateName;
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;
    public AllocationExtension convert() {
        AllocationExtension allocationExtension = BeanConverts.convert(this, AllocationExtension.class);
        return allocationExtension;
    }
}
screen-api/src/main/java/com/moral/api/pojo/query/approvetable/ApproveTableAddCond.java
New file
@@ -0,0 +1,70 @@
package com.moral.api.pojo.query.approvetable;
import com.moral.api.entity.ApproveTable;
import com.moral.api.utils.BeanConverts;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
 * <p>
 * 流程表
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="ApproveTable - 新增对象", description="ApproveTable - 新增对象")
public class ApproveTableAddCond implements Serializable {
    @ApiModelProperty(value = "流程主键id")
    private Integer id;
    @ApiModelProperty(value = "模块")
    private Integer approveModule;
    @ApiModelProperty(value = "关联主键id")
    private Integer relationId;
    @ApiModelProperty(value = "状态")
    private Integer state;
    @ApiModelProperty(value = "状态名称")
    private String stateName;
    @ApiModelProperty(value = "是否删除")
    private Integer isDel;
    @ApiModelProperty(value = "创建人id")
    private Integer createId;
    @ApiModelProperty(value = "创建人姓名")
    private String createName;
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    @ApiModelProperty(value = "更新人id")
    private Integer updateId;
    @ApiModelProperty(value = "更新人姓名")
    private String updateName;
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;
    public ApproveTable convert() {
        ApproveTable approveTable = BeanConverts.convert(this, ApproveTable.class);
        return approveTable;
    }
}
screen-api/src/main/java/com/moral/api/pojo/query/approvetable/ApproveTableListCond.java
New file
@@ -0,0 +1,28 @@
package com.moral.api.pojo.query.approvetable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
 * <p>
 * 流程表
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="ApproveTable - 列表查询对象", description="ApproveTable - 列表查询对象")
public class ApproveTableListCond implements Serializable {
    @ApiModelProperty(value = "ID")
    private Integer id;
}
screen-api/src/main/java/com/moral/api/pojo/query/approvetable/ApproveTablePageCond.java
New file
@@ -0,0 +1,31 @@
package com.moral.api.pojo.query.approvetable;
import com.moral.api.pojo.query.PageCond;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
 * <p>
 * 流程表
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="ApproveTable - 分页查询对象", description="ApproveTable - 分页查询对象")
public class ApproveTablePageCond implements Serializable{
    @ApiModelProperty(value = "ID")
    private Integer id;
    @ApiModelProperty(value = "分页参数")
    private PageCond page;
}
screen-api/src/main/java/com/moral/api/pojo/query/approvetable/ApproveTableUpdateCond.java
New file
@@ -0,0 +1,70 @@
package com.moral.api.pojo.query.approvetable;
import com.moral.api.entity.ApproveTable;
import com.moral.api.utils.BeanConverts;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
 * <p>
 * 流程表
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="ApproveTable - 更新对象", description="ApproveTable - 更新对象")
public class ApproveTableUpdateCond implements Serializable {
    @ApiModelProperty(value = "流程主键id")
    private Integer id;
    @ApiModelProperty(value = "模块")
    private Integer approveModule;
    @ApiModelProperty(value = "关联主键id")
    private Integer relationId;
    @ApiModelProperty(value = "状态")
    private Integer state;
    @ApiModelProperty(value = "状态名称")
    private String stateName;
    @ApiModelProperty(value = "是否删除")
    private Integer isDel;
    @ApiModelProperty(value = "创建人id")
    private Integer createId;
    @ApiModelProperty(value = "创建人姓名")
    private String createName;
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    @ApiModelProperty(value = "更新人id")
    private Integer updateId;
    @ApiModelProperty(value = "更新人姓名")
    private String updateName;
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;
    public ApproveTable convert() {
        ApproveTable approveTable = BeanConverts.convert(this, ApproveTable.class);
        return approveTable;
    }
}
screen-api/src/main/java/com/moral/api/pojo/vo/DictionaryVo.java
@@ -33,9 +33,10 @@
    private List<Map<String, Object>> ChangeEnum;
    private List<Map<String, Object>> YesOrNo;
    private List<Map<String, Object>> AllocationApproveEnum;
    private List<Map<String, Object>> FileTableEnum;
    private List<Map<String, Object>> AllocationExtensionApproveEnum;
    public static List<Map<String, Object>> enumArray2Map(Enum[] enums) {
@@ -68,5 +69,13 @@
        this.FileTableEnum = enumArray2Map(enumResult);
        return this;
    }
    public DictionaryVo setAllocationApproveEnum(com.moral.api.pojo.enums.AllocationApproveEnum[] enumResult) {
        this.AllocationApproveEnum = enumArray2Map(enumResult);
        return this;
    }
    public DictionaryVo setAllocationExtensionApproveEnum(com.moral.api.pojo.enums.AllocationExtensionApproveEnum[] enumResult) {
        this.AllocationExtensionApproveEnum = enumArray2Map(enumResult);
        return this;
    }
}
screen-api/src/main/java/com/moral/api/pojo/vo/allocation/AllocationPageVo.java
New file
@@ -0,0 +1,122 @@
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;
import com.moral.util.DateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
/**
 * <p>
 * 交办单
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="Allocation - 分页VO对象", description="Allocation - 分页VO对象")
public class AllocationPageVo implements Serializable {
    @ApiModelProperty(value = "主键id")
    private Integer allocationId;
    @ApiModelProperty(value = "交办单号")
    private String allocationNum;
    @ApiModelProperty(value = "上报时间")
    @JsonFormat(pattern="yyyy-MM-dd")
    private Date escalationTime;
    @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 = "剩余天数")
    private Integer residueDay;
    @ApiModelProperty(value = "上报单位id")
    private Integer escalationUnitId;
    @ApiModelProperty(value = "上报人")
    private String escalationName;
    @ApiModelProperty(value = "排查方式id")
    private Integer investigationType;
    @ApiModelProperty(value = "状态")
    private Integer state;
    @ApiModelProperty(value = "是否作废")
    private Integer isInvalid;
    @ApiModelProperty(value = "创建人id")
    private Integer createId;
    @ApiModelProperty(value = "创建人姓名")
    private String createName;
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date createTime;
    @ApiModelProperty(value = "更新人id")
    private Integer updateId;
    @ApiModelProperty(value = "更新人姓名")
    private String updateName;
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date updateTime;
    @ApiModelProperty(value = "能否申请延期")
    private Integer applyState;
    public static AllocationPageVo convert(AllocationPageExt allocationPageExt) {
        AllocationPageVo allocationPageVo = BeanConverts.convert(allocationPageExt, AllocationPageVo.class);
        return allocationPageVo;
    }
    public static List<AllocationPageVo> convert(List<AllocationPageExt> allocationPageExtList) {
        return allocationPageExtList.stream().map(AllocationPageVo::convert).collect(Collectors.toList());
    }
    public Integer getResidueDay() {
        int day = this.changeDay;
        if(AllocationApproveEnum.UNDER_RECTIFICATION.value.equals(state)){
            Date date = new Date();
            int days = DateUtils.getDays(escalationTime, date);
            return day-days;
        }
        return day;
    }
    public Integer getApplyState() {
        return Objects.isNull(applyState)?0:applyState;
    }
}
screen-api/src/main/java/com/moral/api/pojo/vo/allocation/AllocationVo.java
New file
@@ -0,0 +1,144 @@
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;
import com.moral.api.utils.BeanConverts;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
 * <p>
 * 交办单
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="Allocation - 详情VO对象", description="Allocation - 详情VO对象")
public class AllocationVo implements Serializable {
    @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 Integer isChange;
    @ApiModelProperty(value = "整改反馈")
    private String changeDescribe;
    @ApiModelProperty(value = "整改人性名")
    private String changeName;
    @ApiModelProperty(value = "整改时间")
    @JsonFormat(pattern="yyyy-MM-dd")
    private Date changeTime;
    @ApiModelProperty(value = "考核分值")
    private Integer checkScore;
    @ApiModelProperty(value = "考核理由")
    private String checkDescribe;
    @ApiModelProperty(value = "考核人")
    private String checkName;
    @ApiModelProperty(value = "考核时间")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date checkTime;
    @ApiModelProperty(value = "状态")
    private Integer state;
    @ApiModelProperty(value = "是否作废")
    private Integer isInvalid;
    @ApiModelProperty(value = "作废理由")
    private String invalidReason;
    @ApiModelProperty(value = "创建人id")
    private Integer createId;
    @ApiModelProperty(value = "创建人姓名")
    private String createName;
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date createTime;
    @ApiModelProperty(value = "更新人id")
    private Integer updateId;
    @ApiModelProperty(value = "更新人姓名")
    private String updateName;
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date updateTime;
    @ApiModelProperty(value = "基础附件")
    private List<FileVo> fileBaseList;
    @ApiModelProperty(value = "整改附件")
    private List<FileVo> fileChangeList;
    @ApiModelProperty(value = "审批附件")
    private List<FileVo> fileApproveList;
    @ApiModelProperty(value = "流程状态")
    private List<ApproveTableListVo> approveList;
    public static AllocationVo convert(AllocationExt allocationExt) {
        AllocationVo allocationVo = BeanConverts.convert(allocationExt, AllocationVo.class);
        return allocationVo;
    }
}
screen-api/src/main/java/com/moral/api/pojo/vo/allocationextension/AllocationExtensionListVo.java
New file
@@ -0,0 +1,83 @@
package com.moral.api.pojo.vo.allocationextension;
import com.moral.api.pojo.ext.allocationextension.AllocationExtensionListExt;
import com.moral.api.utils.BeanConverts;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
 * <p>
 * 交办单延期
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="AllocationExtension - 列表VO对象", description="AllocationExtension - 列表VO对象")
public class AllocationExtensionListVo implements Serializable {
    @ApiModelProperty(value = "主键id")
    private Integer id;
    @ApiModelProperty(value = "交办单id")
    private Integer allocationId;
    @ApiModelProperty(value = "延期天数")
    private Integer extensionNum;
    @ApiModelProperty(value = "延期理由")
    private String remake;
    @ApiModelProperty(value = "状态")
    private Integer state;
    @ApiModelProperty(value = "是否删除")
    private Integer isDel;
    @ApiModelProperty(value = "是否作废")
    private Integer isInvalid;
    @ApiModelProperty(value = "作废理由")
    private String invalidReason;
    @ApiModelProperty(value = "创建人id")
    private Integer createId;
    @ApiModelProperty(value = "创建人姓名")
    private String createName;
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    @ApiModelProperty(value = "更新人id")
    private Integer updateId;
    @ApiModelProperty(value = "更新人姓名")
    private String updateName;
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;
    public static AllocationExtensionListVo convert(AllocationExtensionListExt allocationExtensionListExt) {
        AllocationExtensionListVo allocationExtensionListVo = BeanConverts.convert(allocationExtensionListExt, AllocationExtensionListVo.class);
        return allocationExtensionListVo;
    }
    public static List<AllocationExtensionListVo> convert(List<AllocationExtensionListExt> allocationExtensionListExtList) {
        return allocationExtensionListExtList.stream().map(AllocationExtensionListVo::convert).collect(Collectors.toList());
    }
}
screen-api/src/main/java/com/moral/api/pojo/vo/allocationextension/AllocationExtensionPageVo.java
New file
@@ -0,0 +1,96 @@
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;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
 * <p>
 * 交办单延期
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="AllocationExtension - 分页VO对象", description="AllocationExtension - 分页VO对象")
public class AllocationExtensionPageVo implements Serializable {
    @ApiModelProperty(value = "主键id")
    private Integer id;
    @ApiModelProperty(value = "交办单号")
    private String allocationNum;
    @ApiModelProperty(value = "上报时间")
    @JsonFormat(pattern="yyyy-MM-dd")
    private Date escalationTime;
    @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 = "延期天数")
    private Integer extensionNum;
    @ApiModelProperty(value = "状态")
    private Integer state;
    @ApiModelProperty(value = "上报单位id")
    private Integer escalationUnitId;
    @ApiModelProperty(value = "上报人")
    private String escalationName;
    @ApiModelProperty(value = "创建人id")
    private Integer createId;
    @ApiModelProperty(value = "创建人姓名")
    private String createName;
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date createTime;
    @ApiModelProperty(value = "更新人id")
    private Integer updateId;
    @ApiModelProperty(value = "更新人姓名")
    private String updateName;
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date updateTime;
    public static AllocationExtensionPageVo convert(AllocationExtensionPageExt allocationExtensionPageExt) {
        AllocationExtensionPageVo allocationExtensionPageVo = BeanConverts.convert(allocationExtensionPageExt, AllocationExtensionPageVo.class);
        return allocationExtensionPageVo;
    }
    public static List<AllocationExtensionPageVo> convert(List<AllocationExtensionPageExt> allocationExtensionPageExtList) {
        return allocationExtensionPageExtList.stream().map(AllocationExtensionPageVo::convert).collect(Collectors.toList());
    }
}
screen-api/src/main/java/com/moral/api/pojo/vo/allocationextension/AllocationExtensionVo.java
New file
@@ -0,0 +1,122 @@
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;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
 * <p>
 * 交办单延期
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="AllocationExtension - 详情VO对象", description="AllocationExtension - 详情VO对象")
public class AllocationExtensionVo implements Serializable {
    @ApiModelProperty(value = "主键id")
    private Integer id;
    @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;
    @ApiModelProperty(value = "延期理由")
    private String remake;
    @ApiModelProperty(value = "状态")
    private Integer state;
    @ApiModelProperty(value = "是否作废")
    private Integer isInvalid;
    @ApiModelProperty(value = "作废理由")
    private String invalidReason;
    @ApiModelProperty(value = "创建人id")
    private Integer createId;
    @ApiModelProperty(value = "创建人姓名")
    private String createName;
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date createTime;
    @ApiModelProperty(value = "更新人id")
    private Integer updateId;
    @ApiModelProperty(value = "更新人姓名")
    private String updateName;
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date updateTime;
    public static AllocationExtensionVo convert(AllocationExtensionExt allocationExtensionExt) {
        AllocationExtensionVo allocationExtensionVo = BeanConverts.convert(allocationExtensionExt, AllocationExtensionVo.class);
        return allocationExtensionVo;
    }
}
screen-api/src/main/java/com/moral/api/pojo/vo/approvetable/ApproveTableListVo.java
New file
@@ -0,0 +1,47 @@
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;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
 * <p>
 * 流程表
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="ApproveTable - 列表VO对象", description="ApproveTable - 列表VO对象")
public class ApproveTableListVo implements Serializable {
    @ApiModelProperty(value = "流程主键id")
    private Integer id;
    @ApiModelProperty(value = "状态")
    private Integer state;
    @ApiModelProperty(value = "状态名称")
    private String stateName;
    @ApiModelProperty(value = "创建人id")
    private Integer createId;
    @ApiModelProperty(value = "创建人姓名")
    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
New file
@@ -0,0 +1,44 @@
package com.moral.api.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.moral.api.entity.AllocationExtension;
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;
/**
 * <p>
 * 交办单延期 服务类
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
public interface AllocationExtensionService extends IService<AllocationExtension> {
    /**
     * 根据id查询详情
     * @param id
     * @return AllocationExtensionExt
     */
    AllocationExtensionExt extOne(Integer id);
    /**
     * 查询分页详情
     * @param allocationExtensionPageCond
     * @return AllocationExtensionPageExt
     */
    Page<AllocationExtensionPageExt> extPage(AllocationExtensionPageCond allocationExtensionPageCond);
    /**
    * 保存
    * @param allocationExtensionAddCond
    * @return
    */
    boolean save(AllocationExtensionAddCond allocationExtensionAddCond);
    boolean check(Integer id,Integer state);
}
screen-api/src/main/java/com/moral/api/service/AllocationService.java
@@ -4,11 +4,16 @@
import java.util.Map;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.moral.api.entity.Allocation;
import com.moral.api.entity.ResponsibilityUnit;
import com.moral.api.pojo.ext.allocation.AllocationExt;
import com.moral.api.pojo.ext.allocation.AllocationListExt;
import com.moral.api.pojo.ext.allocation.AllocationPageExt;
import com.moral.api.pojo.query.allocation.*;
import com.moral.api.pojo.dto.allocation.AllocationUnitDto;
import com.moral.api.pojo.query.allocationextension.AllocationExtensionAddCond;
public interface AllocationService extends IService<Allocation> {
@@ -16,11 +21,11 @@
    List<ResponsibilityUnit> seleteUnit();
    Integer insertAllocation(Allocation allocation);
    Integer insertAllocation(AllocationAddCond allocation);
    AllocationUnitDto check(Integer id);
    void updateAll(Allocation allocation);
    void updateAll(AllocationUpdateCond allocationUpdateCond);
    List<Allocation> selectAll(Map<String,Object> map);
@@ -29,4 +34,30 @@
    List<Map<String,Object>> unitExel(Map<String,Object> map);
    Page<AllocationPageExt> extPage(AllocationPageCond allocationPageCond);
    /**
     * 根据id查询详情
     * @param id
     * @return AllocationExt
     */
    AllocationExt extOne(Integer id);
     AllocationExt oneAllocation(Integer id);
    void changeAllocation(AllocationChangeCond changeCond);
    void checkAllocation(AllocationCheckCond checkCond);
    boolean removeById(Integer id);
    boolean invalidResult (Integer id,String invalidReason);
    /**
     * 查询列表详情
     * @param allocationListCond
     * @return AllocationListExt
     */
    List<AllocationListExt> extList(AllocationListCond allocationListCond);
    boolean applyFor (AllocationExtensionAddCond allocationExtensionAddCond);
}
screen-api/src/main/java/com/moral/api/service/ApproveTableService.java
New file
@@ -0,0 +1,29 @@
package com.moral.api.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.moral.api.entity.ApproveTable;
import com.moral.api.pojo.vo.approvetable.ApproveTableListVo;
import java.util.List;
/**
 * <p>
 * 流程表 服务类
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
public interface ApproveTableService extends IService<ApproveTable> {
    /**
     * 保存
     * @param approveTable
     * @return
     */
    boolean saveResult(ApproveTable approveTable);
    List<ApproveTableListVo> listAll(int relationId,int fileModule);
}
screen-api/src/main/java/com/moral/api/service/FileTableService.java
@@ -26,4 +26,8 @@
    void preview(Integer id, HttpServletRequest request, HttpServletResponse response);
    void coverPreview(Integer id, HttpServletRequest request, HttpServletResponse response);
    void upDateResult(List<FileVo> list,int relationId,int fileModule);
    List<FileVo> list(int relationId,int fileModule);
}
screen-api/src/main/java/com/moral/api/service/impl/AllocationExtensionServiceImpl.java
New file
@@ -0,0 +1,93 @@
package com.moral.api.service.impl;
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>
 * 交办单延期 服务实现类
 * </p>
 * deyt template generate
 * @author JI
 * @since 2023-09-25
 */
@Service
public class AllocationExtensionServiceImpl extends ServiceImpl<AllocationExtensionMapper, AllocationExtension> implements AllocationExtensionService {
    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) {
        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;
    }
    @Override
    public Page<AllocationExtensionPageExt> extPage(AllocationExtensionPageCond allocationExtensionPageCond) {
        return this.baseMapper.extPage(allocationExtensionPageCond.getPage().convertPage(), allocationExtensionPageCond);
    }
    @Override
    public boolean save(AllocationExtensionAddCond allocationExtensionAddCond) {
        return this.save(allocationExtensionAddCond.convert());
    }
    @Override
    @Transactional
    public boolean check(Integer id, Integer state) {
        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(state);
        this.baseMapper.updateById(allocationExtension);
        if(AllocationExtensionApproveEnum.PASS.value.equals(state)){
            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
@@ -1,5 +1,21 @@
package com.moral.api.service.impl;
import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.moral.api.config.Interceptor.UserHelper;
import com.moral.api.entity.*;
import com.moral.api.exception.BusinessException;
import com.moral.api.pojo.bean.BaseInvalidEntity;
import com.moral.api.pojo.enums.*;
import com.moral.api.pojo.ext.allocation.AllocationExt;
import com.moral.api.pojo.ext.allocation.AllocationListExt;
import com.moral.api.pojo.ext.allocation.AllocationPageExt;
import com.moral.api.pojo.query.PageCond;
import com.moral.api.pojo.query.allocation.*;
import com.moral.api.pojo.query.allocationextension.AllocationExtensionAddCond;
import com.moral.api.pojo.vo.user.QxUser;
import com.moral.api.service.AllocationExtensionService;
import com.moral.api.service.ApproveTableService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -16,6 +32,7 @@
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -27,9 +44,7 @@
import com.moral.api.entity.SysDictData;
import com.moral.api.entity.SysDictType;
import com.moral.api.mapper.AllocationMapper;
import com.moral.api.mapper.ApproveTableMapper;
import com.moral.api.mapper.ResponsibilityUnitMapper;
import com.moral.api.mapper.SysAreaMapper;
import com.moral.api.mapper.SysDictDataMapper;
import com.moral.api.mapper.SysDictTypeMapper;
import com.moral.api.pojo.dto.allocation.AllocationUnitDto;
@@ -64,6 +79,11 @@
    private ApproveTableMapper approveTableMapper;
    @Autowired
    private  SysAreaService sysAreaService;
    private ApproveTableService approveTableService;
    @Autowired
    private FileTableService fileTableService;
    @Autowired
    private AllocationExtensionService allocationExtensionService;
    /**
     * 根据字典类型获取字典数据
@@ -104,53 +124,46 @@
    /**
     * 添加交办单
     * @param allocation
     * @param allocationCond
     * @return
     */
    @Override
    @Transactional
    public Integer insertAllocation(Allocation allocation) {
        ApproveTable approveTable = new ApproveTable();
        //获取用户信息
        Map<String, Object> userInfo = (Map<String, Object>) TokenUtils.getUserInfo();
    public Integer insertAllocation(AllocationAddCond allocationCond) {
        Allocation allocation = allocationCond.convert();
        allocation.setEscalationType(AllocationEscalationTypeEnum.SELF.getValue());
        String dateString = DateUtils.dateToDateString(new Date(), DateUtils.yyyyMMdd_EN);
        QueryWrapper<Allocation> wrapper = new QueryWrapper<>();
        Object o = redisTemplate.opsForValue().get(RedisConstants.JBD_DATA);
        int i;
        if (ObjectUtils.isEmpty(o)){
            wrapper.last("limit 1");
            Allocation selectOne = allocationMapper.selectOne(wrapper);
            String allocationNum = selectOne.getAllocationNum();
            String num = allocationNum.substring(10);
             i = Integer.parseInt(num)+1;
             i = 1;
        }else {
             i = Integer.parseInt(o.toString()) + 1;
        }
        //单号
        String allocationNum = "JBD" + dateString + String.format("%04d", i);
        allocation.setAllocationNum(allocationNum);
        allocation.setIsDel("0");
        allocation.setIsInvalid("0");
        allocation.setCreateId(Integer.parseInt(userInfo.get("userId").toString()));
        allocation.setCreateTime(new Date());
        allocation.setCreateName(userInfo.get("account").toString());
        allocation.setUpdateId(Integer.parseInt(userInfo.get("userId").toString()));
        allocation.setUpdateTime(new Date());
        allocation.setUpdateName(userInfo.get("account").toString());
        if(Objects.nonNull(allocationCond.getEscalationUnitId())&&allocationCond.getEscalationUnitId().toString().length()==6) {
            allocation.setEscalationType(AllocationEscalationTypeEnum.CHECK.getValue());
        }
        if(AllocationApproveEnum.NEW_BUILT.value.equals(allocationCond.getState())) {
            allocation.setState(AllocationApproveEnum.UNDER_RECTIFICATION.value);
        }
        //获取新建图片
        allocationMapper.insert(allocation);
        redisTemplate.opsForValue().set(RedisConstants.JBD_DATA,i);
        //添加流程数据
        approveTable.setRelationId(allocation.getAllocationId());
        approveTable.setState(Integer.parseInt(allocation.getState()));
        approveTable.setApproveModule(null);
        approveTable.setStateName(null);
        approveTable.setIsDel(0);
        approveTableMapper.insert(approveTable);
        return null;
        if(AllocationApproveEnum.NEW_BUILT.value.equals(allocationCond.getState())) {
            //添加流程数据
            ApproveTable approveTable = new ApproveTable();
            approveTable.setRelationId(allocation.getAllocationId());
            approveTable.setState(AllocationApproveEnum.NEW_BUILT.value);
            approveTable.setApproveModule(FileTableEnum.ALLOCATION_FOUNDATION.value);
            approveTable.setStateName(AllocationApproveEnum.NEW_BUILT.name);
            approveTableService.saveResult(approveTable);
        }
        fileTableService.upDateResult(allocationCond.getFileBaseList(),allocation.getAllocationId(), FileTableEnum.ALLOCATION_FOUNDATION.value);
        return allocation.getAllocationId();
    }
    /**
     * 查看表单
@@ -175,29 +188,36 @@
        }
        allocationUnitDto.setChangeTypeName(allocation.getChangeType()==0?"限期整改":"立即整改");
        allocationUnitDto.setInvestigationTypeName(allocation.getChangeType()==0?"现场":"无人机");
        //获取图片
        return allocationUnitDto;
    }
    /**
     * 修改交办单
     * @param allocation
     * @param allocationUpdateCond
     */
    @Override
    public void updateAll(Allocation allocation) {
        //获取用户信息
        Map<String, Object> userInfo = (Map<String, Object>) TokenUtils.getUserInfo();
        if (allocation.getState().equals("1")){
            //获取整改图片
            allocation.setChangeTime(new Date());
        }else {
            //获取审核图片
            allocation.setCheckTime(new Date());
    @Transactional
    public void updateAll(AllocationUpdateCond allocationUpdateCond) {
        AllocationExt allocationExt = oneAllocation(allocationUpdateCond.getAllocationId());
        if(!AllocationApproveEnum.DRAFT.value.equals(allocationExt.getState())) {
            throw new BusinessException("新建未提交状态,才能编辑!");
        }
        allocation.setUpdateId(Integer.parseInt(userInfo.get("userId").toString()));
        allocation.setUpdateTime(new Date());
        allocation.setUpdateName(userInfo.get("account").toString());
        //获取用户信息
        Allocation allocation = allocationUpdateCond.convert();
        if(Objects.nonNull(allocationUpdateCond.getEscalationUnitId())&&allocationUpdateCond.getEscalationUnitId().toString().length()==6) {
            allocation.setEscalationType(AllocationEscalationTypeEnum.CHECK.getValue());
        }
        if(AllocationApproveEnum.NEW_BUILT.value.equals(allocationUpdateCond.getState())) {
            //添加流程数据
            ApproveTable approveTable = new ApproveTable();
            approveTable.setRelationId(allocation.getAllocationId());
            approveTable.setState(AllocationApproveEnum.NEW_BUILT.value);
            approveTable.setApproveModule(FileTableEnum.ALLOCATION_FOUNDATION.value);
            approveTable.setStateName(AllocationApproveEnum.NEW_BUILT.name);
            approveTableService.saveResult(approveTable);
        }
        fileTableService.upDateResult(allocationUpdateCond.getFileBaseList(),allocation.getAllocationId(), FileTableEnum.ALLOCATION_FOUNDATION.value);
        allocationMapper.updateById(allocation);
    }
@@ -434,4 +454,128 @@
    public List<Map<String, Object>> unitExel(Map<String, Object> map) {
        return null;
    }
    @Override
    public Page<AllocationPageExt> extPage(AllocationPageCond allocationPageCond) {
        return this.baseMapper.extPage(allocationPageCond.getPage().convertPage(), allocationPageCond);
    }
    @Override
    public AllocationExt extOne(Integer id) {
        AllocationExt allocationExt = oneAllocation(id);
        allocationExt.setFileBaseList(fileTableService.list(id,FileTableEnum.ALLOCATION_FOUNDATION.value));
        allocationExt.setFileChangeList(fileTableService.list(id,FileTableEnum.ALLOCATION_RECTIFICATION.value));
        allocationExt.setFileApproveList(fileTableService.list(id,FileTableEnum.ALLOCATION_APPROVE.value));
        allocationExt.setApproveList(approveTableService.listAll(id,FileTableEnum.ALLOCATION_FOUNDATION.value));
        return allocationExt;
    }
    @Override
    public AllocationExt oneAllocation(Integer id){
        return this.baseMapper.extOne(id);
    }
    @Override
    @Transactional
    public void changeAllocation(AllocationChangeCond changeCond) {
        AllocationExt allocationExt = oneAllocation(changeCond.getAllocationId());
        if(!AllocationApproveEnum.UNDER_RECTIFICATION.value.equals(allocationExt.getState())) {
            throw new BusinessException("整改状态,才能提交审批!");
        }
        Allocation allocation = new Allocation();
        allocation.setAllocationId(changeCond.getAllocationId());
        allocation.setIsChange(changeCond.getIsChange());
        allocation.setChangeName(changeCond.getChangeName());
        allocation.setChangeDescribe(changeCond.getChangeDescribe());
        allocation.setState(changeCond.getState());
        allocation.setChangeTime(new Date());
        this.updateById(allocation);
        //添加流程数据
        ApproveTable approveTable = new ApproveTable();
        approveTable.setRelationId(allocation.getAllocationId());
        approveTable.setState(AllocationApproveEnum.UNDER_RECTIFICATION.value);
        approveTable.setStateName(AllocationApproveEnum.UNDER_RECTIFICATION.name);
        approveTable.setApproveModule(FileTableEnum.ALLOCATION_FOUNDATION.value);
        approveTableService.saveResult(approveTable);
        fileTableService.upDateResult(changeCond.getFileChangeList(),allocation.getAllocationId(), FileTableEnum.ALLOCATION_FOUNDATION.value);
    }
    @Override
    @Transactional
    public void checkAllocation(AllocationCheckCond checkCond) {
        AllocationExt allocationExt = oneAllocation(checkCond.getAllocationId());
        if(!AllocationApproveEnum.IN_APPROVAL.value.equals(allocationExt.getState())) {
            throw new BusinessException("审批状态,才能进行审批操作!");
        }
        QxUser qxUser = UserHelper.getCurrentUser();
        Allocation allocation = new Allocation();
        allocation.setCheckScore(checkCond.getCheckScore());
        allocation.setCheckDescribe(checkCond.getCheckDescribe());
        allocation.setCheckName(qxUser.getUserName());
        allocation.setCheckTime(new Date());
        allocation.setState(checkCond.getState());
        this.updateById(allocation);
        //添加流程数据
        ApproveTable approveTable = new ApproveTable();
        approveTable.setRelationId(allocation.getAllocationId());
        if(AllocationApproveEnum.PASS.value.equals(checkCond.getState())){
            approveTable.setState(AllocationApproveEnum.PASS.value);
            approveTable.setStateName(AllocationApproveEnum.PASS.name);
        }else {
            approveTable.setState(AllocationApproveEnum.REFUSE.value);
            approveTable.setStateName(AllocationApproveEnum.REFUSE.name);
        }
        approveTable.setApproveModule(FileTableEnum.ALLOCATION_FOUNDATION.value);
        approveTableService.saveResult(approveTable);
        fileTableService.upDateResult(checkCond.getFileApproveList(),allocation.getAllocationId(), FileTableEnum.ALLOCATION_FOUNDATION.value);
    }
    @Override
    @Transactional
    public boolean removeById(Integer id) {
        AllocationExt allocationExt = oneAllocation(id);
        if(!AllocationApproveEnum.DRAFT.value.equals(allocationExt.getState())) {
            throw new BusinessException("新建草稿状态,才能删除!");
        }
        this.baseMapper.deleteById(id);
        return true;
    }
    @Override
    @Transactional
    public boolean invalidResult(Integer id,String invalidReason) {
        AllocationExt allocationExt = oneAllocation(id);
        if( AllocationApproveEnum.IN_APPROVAL.value >= allocationExt.getState() ) {
            throw new BusinessException("审批结束才能作废!");
        }
        LambdaUpdateChainWrapper<Allocation> wrapper =lambdaUpdate();
        wrapper.eq(Allocation::getAllocationId,id).set(Allocation::getInvalidReason,invalidReason).set(BaseInvalidEntity::getIsInvalid, YesOrNo.YES.value);
        return wrapper.update();
    }
    @Override
    public List<AllocationListExt> extList(AllocationListCond allocationListCond) {
        return null;
    }
    @Override
    @Transactional
    public boolean applyFor(AllocationExtensionAddCond allocationExtensionAddCond) {
        AllocationExt allocationExt = oneAllocation(allocationExtensionAddCond.getAllocationId());
        boolean type = false;
        if( !AllocationApproveEnum.UNDER_RECTIFICATION.value.equals(allocationExt.getState())) {
            type = true;
        }
        if(!ChangeEnum.DEADLINE.value.equals(allocationExt.getState())){
            type = true;
        }
        if(type){
            throw new BusinessException("只有限期整改类型,状态为整改中,才能发起延期申请!");
        }
        AllocationExtension allocationExtension = allocationExtensionAddCond.convert();
        allocationExtension.setState(AllocationExtensionApproveEnum.APPLYING.value);
        allocationExtensionService.save(allocationExtension);
        fileTableService.upDateResult(allocationExtensionAddCond.getFileList(),allocationExtension.getId(), FileTableEnum.ALLOCATION_EXTENSION.value);
        return true;
    }
}
screen-api/src/main/java/com/moral/api/service/impl/ApproveTableServiceImpl.java
New file
@@ -0,0 +1,50 @@
package com.moral.api.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.moral.api.entity.ApproveTable;
import com.moral.api.entity.FileTable;
import com.moral.api.mapper.ApproveTableMapper;
import com.moral.api.pojo.enums.YesOrNo;
import com.moral.api.pojo.vo.approvetable.ApproveTableListVo;
import com.moral.api.pojo.vo.file.FileVo;
import com.moral.api.service.ApproveTableService;
import com.moral.api.utils.BeanConverts;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
/**
 * <p>
 * 流程表 服务实现类
 * </p>
 * deyt template generate
 *
 * @author JI
 * @since 2023-09-25
 */
@Service
public class ApproveTableServiceImpl extends ServiceImpl<ApproveTableMapper, ApproveTable> implements ApproveTableService {
    @Override
    @Transactional
    public boolean saveResult(ApproveTable approveTable) {
        return this.save(approveTable);
    }
    @Override
    public List<ApproveTableListVo> listAll(int relationId,int fileModule) {
        List<ApproveTableListVo> list = new ArrayList<>();
        List<ApproveTable> existsList = this.lambdaQuery().eq(ApproveTable::getRelationId, relationId)
                .eq(ApproveTable::getApproveModule, fileModule)
                .eq(ApproveTable::getIsDel, YesOrNo.NO.value).orderByAsc(ApproveTable::getCreateTime).list();
        existsList.forEach(it->{
            ApproveTableListVo listVo = BeanConverts.convert(it,ApproveTableListVo.class);
            list.add(listVo);
        });
        return list;
    }
}
screen-api/src/main/java/com/moral/api/service/impl/FileTableServiceImpl.java
@@ -5,6 +5,7 @@
import com.moral.api.exception.BusinessException;
import com.moral.api.mapper.FileTableMapper;
import com.moral.api.pojo.enums.FileType;
import com.moral.api.pojo.enums.YesOrNo;
import com.moral.api.pojo.vo.file.FileVo;
import com.moral.api.pojo.vo.user.QxUser;
import com.moral.api.service.FileTableService;
@@ -14,8 +15,11 @@
import com.moral.util.DateUtils;
import lombok.extern.slf4j.Slf4j;
import net.coobird.thumbnailator.Thumbnails;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
@@ -23,6 +27,7 @@
import java.io.*;
import java.net.URLEncoder;
import java.util.*;
import java.util.stream.Collectors;
/**
 * <p>
@@ -185,4 +190,48 @@
            log.error("读取文件异常!!! e={}", e.getMessage());
        }
    }
    @Override
    @Transactional
    public void upDateResult(List<FileVo> list,int relationId,int fileModule) {
        List<FileTable> existsList = this.lambdaQuery().eq(FileTable::getRelationId, relationId)
                .eq(FileTable::getFileModule, fileModule)
                .eq(FileTable::getIsDel, YesOrNo.NO.value).list();
        // 新增附件
        if (!CollectionUtils.isEmpty(list)) {
            List<FileTable> addList = new ArrayList();
            // 2.2.筛选出需要保存的文件
            list.forEach(it -> {
               existsList.removeIf(file -> file.getFileId().equals(it.getFileId()));
               FileTable file = new FileTable();
               BeanUtils.copyProperties(it,file);
               file.setRelationId(relationId);
               addList.add(file);
            });
            if (!CollectionUtils.isEmpty(addList)) {
                // 保存
                this.updateBatchById(addList);
            }
        }
        // 删除附件
        if (!CollectionUtils.isEmpty(existsList)) {
            removeByIds(existsList.stream().map(FileTable::getFileId).collect(Collectors.toList()));
        }
    }
    @Override
    public List<FileVo> list(int relationId, int fileModule) {
        List<FileVo> list = new ArrayList<>();
        List<FileTable> existsList = this.lambdaQuery().eq(FileTable::getRelationId, relationId)
                .eq(FileTable::getFileModule, fileModule)
                .eq(FileTable::getIsDel, YesOrNo.NO.value).orderByAsc(FileTable::getCreateTime).list();
        existsList.forEach(it->{
            FileVo fileVo = new FileVo();
            fileVo.setFileId(it.getFileId());
            fileVo.setFileName(it.getFileName());
            list.add(fileVo);
        });
        return list;
    }
}
screen-api/src/main/resources/application-qa.yml
@@ -128,6 +128,7 @@
      - /webjars/**
      - /verificationCode/**
      - /static/**
      - /doc.html
      - /file/preview/**
screen-api/src/main/resources/mapper/AllocationExtensionMapper.xml
New file
@@ -0,0 +1,69 @@
<?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.moral.api.mapper.AllocationExtensionMapper">
    <!-- 通用查询映射结果 deyt template generate -->
    <resultMap id="BaseResultMap" type="com.moral.api.entity.AllocationExtension">
        <id column="id" property="id" />
        <result column="allocation_id" property="allocationId" />
        <result column="extension_num" property="extensionNum" />
        <result column="remake" property="remake" />
        <result column="state" property="state" />
        <result column="invalid_reason" property="invalidReason" />
    </resultMap>
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, allocation_id, extension_num, remake, state, is_del, is_invalid, invalid_reason, create_id, create_name, create_time, update_id, update_name, update_time
    </sql>
    <!-- 通用查询结果列 -->
    <sql id="AllocationExtension_Column_List">
        allocationextension.id, allocationextension.allocation_id, allocationextension.extension_num, allocationextension.remake, allocationextension.state, allocationextension.is_del, allocationextension.is_invalid, allocationextension.invalid_reason, allocationextension.create_id, allocationextension.create_name, allocationextension.create_time, allocationextension.update_id, allocationextension.update_name, allocationextension.update_time
    </sql>
    <select id="extOne" resultType="com.moral.api.pojo.ext.allocationextension.AllocationExtensionExt">
        SELECT
        <include refid="AllocationExtension_Column_List"/>
        FROM allocation_extension allocationextension
        where allocationextension.id = #{id} and allocationextension.is_del = 0
    </select>
    <select id="extPage" resultType="com.moral.api.pojo.ext.allocationextension.AllocationExtensionPageExt">
        SELECT
        <include refid="AllocationExtension_Column_List"/>,
        t1.allocation_num,t1.escalation_time,t1.unit_id,t1.pollute_type,t1.change_type,t1.change_day,t1.escalation_unit_id,t1.escalation_name
        FROM allocation_extension allocationextension
        left join allocation t1 on allocationextension.allocation_id = t1.allocation_id
        <where>
            1 = 1 and allocationextension.is_del = 0
            <if test="allocation.unitId != null and allocation.unitId != 0">
                and t1.unit_id = #{allocation.unitId}
            </if>
            <if test="allocation.polluteType != null and allocation.polluteType != 0">
                and t1.pollute_type = #{allocation.polluteType}
            </if>
            <if test="allocation.state != null and allocation.state != 0">
                and t1.state = #{allocation.state}
            </if>
            <if test="allocation.investigationType != null and allocation.investigationType != 0">
                and t1.investigation_type = #{allocation.investigationType}
            </if>
            <if test="allocation.changeType != null and allocation.changeType != 0">
                and t1.change_type = #{allocation.changeType}
            </if>
            <if test="allocation.startTime != null and allocation.startTime != '' ">
                and date(t1.escalation_time) <![CDATA[>=]]> #{allocation.startTime}
            </if>
            <if test="allocation.endTime != null and allocation.endTime !='' ">
                and date(t1.escalation_time) <![CDATA[<=]]>  #{allocation.endTime}
            </if>
        </where>
        order by t1.escalation_time desc,t1.allocation_id desc
    </select>
</mapper>
screen-api/src/main/resources/mapper/AllocationMapper.xml
New file
@@ -0,0 +1,96 @@
<?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.moral.api.mapper.AllocationMapper">
    <!-- 通用查询映射结果 deyt template generate -->
    <resultMap id="BaseResultMap" type="com.moral.api.entity.Allocation">
        <id column="allocation_id" property="allocationId" />
        <result column="allocation_num" property="allocationNum" />
        <result column="escalation_type" property="escalationType" />
        <result column="escalation_time" property="escalationTime" />
        <result column="pollute_position" property="pollutePosition" />
        <result column="unit_id" property="unitId" />
        <result column="pollute_type" property="polluteType" />
        <result column="change_type" property="changeType" />
        <result column="change_day" property="changeDay" />
        <result column="escalation_unit_id" property="escalationUnitId" />
        <result column="escalation_name" property="escalationName" />
        <result column="investigation_type" property="investigationType" />
        <result column="problem_describe" property="problemDescribe" />
        <result column="is_change" property="isChange" />
        <result column="change_describe" property="changeDescribe" />
        <result column="change_name" property="changeName" />
        <result column="change_time" property="changeTime" />
        <result column="check_score" property="checkScore" />
        <result column="check_describe" property="checkDescribe" />
        <result column="check_name" property="checkName" />
        <result column="check_time" property="checkTime" />
        <result column="state" property="state" />
        <result column="invalid_reason" property="invalidReason" />
    </resultMap>
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        allocation_id, allocation_num, escalation_type, escalation_time, pollute_position, unit_id, pollute_type, change_type, change_day, escalation_unit_id, escalation_name, investigation_type, problem_describe, is_change, change_describe, change_name, change_time, check_score, check_describe, check_name, check_time, state, is_del, is_invalid, invalid_reason, create_id, create_name, create_time, update_id, update_name, update_time
    </sql>
    <!-- 通用查询结果列 -->
    <sql id="Allocation_Column_List">
        allocation.allocation_id, allocation.allocation_num, allocation.escalation_type, allocation.escalation_time, allocation.pollute_position, allocation.unit_id, allocation.pollute_type, allocation.change_type, allocation.change_day, allocation.escalation_unit_id, allocation.escalation_name, allocation.investigation_type, allocation.problem_describe, allocation.is_change, allocation.change_describe, allocation.change_name, allocation.change_time, allocation.check_score, allocation.check_describe, allocation.check_name, allocation.check_time, allocation.state, allocation.is_del, allocation.is_invalid, allocation.invalid_reason, allocation.create_id, allocation.create_name, allocation.create_time, allocation.update_id, allocation.update_name, allocation.update_time
    </sql>
    <select id="extOne" resultType="com.moral.api.pojo.ext.allocation.AllocationExt">
        SELECT
        <include refid="Allocation_Column_List"/>
        FROM allocation allocation
        where  allocation.allocation_id = #{id} and allocation.is_del = 0
    </select>
    <select id="extList" resultType="com.moral.api.pojo.ext.allocation.AllocationListExt">
        SELECT
        <include refid="Allocation_Column_List"/>
        FROM allocation allocation
        <where>
            1 = 1
            <if test="allocation.id != null and allocation.id != 0">
                and allocation.allocation_id = #{allocation.id} and allocation.is_del = 0
            </if>
        </where>
    </select>
    <select id="extPage" resultType="com.moral.api.pojo.ext.allocation.AllocationPageExt">
        SELECT
        <include refid="Allocation_Column_List"/>,t1.id as applyState
        FROM allocation allocation
        left join allocation_extension t1 on t1.allocation_id = allocation.allocation_id and t1.is_del =0 and t1.is_invalid = 0 and t1.state = 30
        <where>
            1 = 1 and allocation.is_del = 0
            <if test="allocation.unitId != null and allocation.unitId != 0">
                and allocation.unit_id = #{allocation.unitId}
            </if>
            <if test="allocation.polluteType != null and allocation.polluteType != 0">
                and allocation.pollute_type = #{allocation.polluteType}
            </if>
            <if test="allocation.state != null and allocation.state != 0">
                and allocation.state = #{allocation.state}
            </if>
            <if test="allocation.investigationType != null and allocation.investigationType != 0">
                and allocation.investigation_type = #{allocation.investigationType}
            </if>
            <if test="allocation.changeType != null and allocation.changeType != 0">
                and allocation.change_type = #{allocation.changeType}
            </if>
            <if test="allocation.isInvalid != null and allocation.isInvalid != 0">
                and allocation.is_invalid = #{allocation.isInvalid}
            </if>
            <if test="allocation.startTime != null and allocation.startTime != '' ">
                and date(allocation.escalation_time) <![CDATA[>=]]> #{allocation.startTime}
            </if>
            <if test="allocation.endTime != null and allocation.endTime !='' ">
                and date(allocation.escalation_time) <![CDATA[<=]]>  #{allocation.endTime}
            </if>
        </where>
        order by allocation.escalation_time desc,allocation.allocation_id desc
    </select>
</mapper>
screen-common/src/main/java/com/moral/constant/PageInfo.java
New file
@@ -0,0 +1,27 @@
package com.moral.constant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
/**
 *
 */
@Data
@Accessors(chain = true)
@ApiModel(value = "分页信息", description = "分页信息")
public class PageInfo {
    @ApiModelProperty(value = "每页数量")
    private long pageSize;
    @ApiModelProperty(value = "当前页码")
    private long currentPage;
    @ApiModelProperty(value = "总页数")
    private long totalPage;
    @ApiModelProperty(value = "总记录数")
    private long totalNum;
}
screen-common/src/main/java/com/moral/constant/PageResult.java
New file
@@ -0,0 +1,34 @@
package com.moral.constant;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.List;
/**
 *
 */
@Data
@Accessors(chain = true)
@ApiModel(value = "分页结果", description = "分页结果")
public class PageResult<T> {
    @ApiModelProperty(value = "分页信息")
    private PageInfo page;
    @ApiModelProperty(value = "记录")
    private List<T> list;
    public PageResult() {
    }
    public PageResult(Page page) {
        this.page = new PageInfo().setCurrentPage(page.getCurrent())
                .setPageSize(page.getSize())
                .setTotalPage(page.getPages())
                .setTotalNum(page.getTotal());
    }
}