“djh”
2025-11-13 34d203c93e776c433b7b6614a77ad1d61c7035dd
修改新增
9 files modified
22 files added
1298 ■■■■■ changed files
multi-admin/src/main/java/com/gkhy/exam/admin/controller/app/AppItemReviewController.java 31 ●●●●● patch | view | raw | blame | history
multi-admin/src/main/java/com/gkhy/exam/admin/controller/web/UseSealApplyController.java 191 ●●●●● patch | view | raw | blame | history
multi-system/src/main/java/com/gkhy/exam/system/domain/ExStudent.java 3 ●●●●● patch | view | raw | blame | history
multi-system/src/main/java/com/gkhy/exam/system/domain/FlowApprove.java 50 ●●●●● patch | view | raw | blame | history
multi-system/src/main/java/com/gkhy/exam/system/domain/SealType.java 49 ●●●●● patch | view | raw | blame | history
multi-system/src/main/java/com/gkhy/exam/system/domain/StandardizedTemplate.java 13 ●●●●● patch | view | raw | blame | history
multi-system/src/main/java/com/gkhy/exam/system/domain/SupplierSureQuality.java 7 ●●●●● patch | view | raw | blame | history
multi-system/src/main/java/com/gkhy/exam/system/domain/UseSealApply.java 109 ●●●●● patch | view | raw | blame | history
multi-system/src/main/java/com/gkhy/exam/system/domain/UseSealApplyFile.java 40 ●●●●● patch | view | raw | blame | history
multi-system/src/main/java/com/gkhy/exam/system/domain/UseSealApplyFlow.java 65 ●●●●● patch | view | raw | blame | history
multi-system/src/main/java/com/gkhy/exam/system/mapper/FlowApproveMapper.java 17 ●●●●● patch | view | raw | blame | history
multi-system/src/main/java/com/gkhy/exam/system/mapper/SealTypeMapper.java 12 ●●●●● patch | view | raw | blame | history
multi-system/src/main/java/com/gkhy/exam/system/mapper/UseSealApplyFileMapper.java 21 ●●●●● patch | view | raw | blame | history
multi-system/src/main/java/com/gkhy/exam/system/mapper/UseSealApplyFlowMapper.java 24 ●●●●● patch | view | raw | blame | history
multi-system/src/main/java/com/gkhy/exam/system/mapper/UseSealApplyMapper.java 15 ●●●●● patch | view | raw | blame | history
multi-system/src/main/java/com/gkhy/exam/system/service/impl/SysUserServiceImpl.java 18 ●●●●● patch | view | raw | blame | history
multi-system/src/main/java/com/gkhy/exam/system/service/useSealApply/FlowApproveService.java 16 ●●●●● patch | view | raw | blame | history
multi-system/src/main/java/com/gkhy/exam/system/service/useSealApply/SealTypeService.java 16 ●●●●● patch | view | raw | blame | history
multi-system/src/main/java/com/gkhy/exam/system/service/useSealApply/UseSealApplyService.java 22 ●●●●● patch | view | raw | blame | history
multi-system/src/main/java/com/gkhy/exam/system/service/useSealApply/impl/FlowApproveServiceImpl.java 56 ●●●●● patch | view | raw | blame | history
multi-system/src/main/java/com/gkhy/exam/system/service/useSealApply/impl/SealTypeServiceImpl.java 62 ●●●●● patch | view | raw | blame | history
multi-system/src/main/java/com/gkhy/exam/system/service/useSealApply/impl/UseSealApplyServiceImpl.java 160 ●●●●● patch | view | raw | blame | history
multi-system/src/main/resources/mapper/system/FlowApproveMapper.xml 32 ●●●●● patch | view | raw | blame | history
multi-system/src/main/resources/mapper/system/SealTypeMapper.xml 22 ●●●●● patch | view | raw | blame | history
multi-system/src/main/resources/mapper/system/StandardizedTemplateMapper.xml 42 ●●●●● patch | view | raw | blame | history
multi-system/src/main/resources/mapper/system/SupplierSureQualityMapper.xml 1 ●●●● patch | view | raw | blame | history
multi-system/src/main/resources/mapper/system/SysDeptMapper.xml 2 ●●● patch | view | raw | blame | history
multi-system/src/main/resources/mapper/system/SysUserMapper.xml 5 ●●●●● patch | view | raw | blame | history
multi-system/src/main/resources/mapper/system/UseSealApplyFileMapper.xml 31 ●●●●● patch | view | raw | blame | history
multi-system/src/main/resources/mapper/system/UseSealApplyFlowMapper.xml 94 ●●●●● patch | view | raw | blame | history
multi-system/src/main/resources/mapper/system/UseSealApplyMapper.xml 72 ●●●●● patch | view | raw | blame | history
multi-admin/src/main/java/com/gkhy/exam/admin/controller/app/AppItemReviewController.java
@@ -2,19 +2,24 @@
import com.gkhy.exam.common.api.CommonResult;
import com.gkhy.exam.system.domain.ItemReviewUser;
import com.gkhy.exam.system.domain.UseSealApplyFlow;
import com.gkhy.exam.system.service.ItemReviewService;
import com.gkhy.exam.system.service.useSealApply.UseSealApplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@Api(tags = "APP项目审批前端控制器")
@Api(tags = "APP审批前端控制器")
@RestController
@RequestMapping("/app/item/review")
public class AppItemReviewController {
    @Autowired
    private ItemReviewService itemReviewService;
    @Autowired
    private UseSealApplyService applyService;
@@ -42,4 +47,28 @@
    }
    /**
     * 用章待审批
     * @param userId
     * @return
     */
    @ApiOperation(value = "待审批列表")
    @GetMapping("apply/List")
    public CommonResult applyList(@RequestParam("userId") Integer userId){
        return applyService.applyList(userId);
    }
    /**
     * 用章审批
     * @param useSealApplyFlow
     * @return
     */
    @ApiOperation(value = "审批")
    @PostMapping("apply/check")
    public CommonResult check(@RequestBody UseSealApplyFlow useSealApplyFlow){
        return applyService.approveUseSealApply(useSealApplyFlow);
    }
}
multi-admin/src/main/java/com/gkhy/exam/admin/controller/web/UseSealApplyController.java
New file
@@ -0,0 +1,191 @@
package com.gkhy.exam.admin.controller.web;
import com.gkhy.exam.common.api.CommonResult;
import com.gkhy.exam.system.domain.*;
import com.gkhy.exam.system.domain.req.QualityTargetReq;
import com.gkhy.exam.system.service.useSealApply.FlowApproveService;
import com.gkhy.exam.system.service.useSealApply.SealTypeService;
import com.gkhy.exam.system.service.useSealApply.UseSealApplyService;
import com.gkhy.exam.system.service.useSealApply.impl.UseSealApplyServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@Api(tags = "用章申请")
@RestController
@RequestMapping("/seal")
public class UseSealApplyController {
    @Autowired
    private SealTypeService sealTypeService;
    @Autowired
    private FlowApproveService flowApproveService;
    @Autowired
    private UseSealApplyService useSealApplyService;
    /**
     * 印章类型
     * @param sealType
     * @return
     */
    @ApiOperation(value = "印章类型")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"),
            @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10"),
    })
    @GetMapping("/type/list")
    public CommonResult listSealType(SealType sealType){
        return CommonResult.success(sealTypeService.selectSealTypeList(sealType));
    }
    /**
     * 印章类型新增
     * @param sealType
     * @return
     */
    @ApiOperation(value = "印章类型新增")
    @PostMapping("/type/insert")
    public CommonResult insertSealType(@RequestBody SealType sealType){
        return sealTypeService.insertSealType(sealType);
    }
    /**
     * 印章类型修改
     * @param sealType
     * @return
     */
    @ApiOperation(value = "印章类型修改")
    @PostMapping("/type/update")
    public CommonResult updateSealType(@RequestBody SealType sealType){
        return sealTypeService.updateSealType(sealType);
    }
    /**
     * 印章类型删除
     * @param sealTypeId
     * @return
     */
    @ApiOperation(value = "印章类型删除")
    @GetMapping("/type/deleted")
    public CommonResult deletedSealType(@RequestParam("sealTypeId") Integer sealTypeId){
        return sealTypeService.deletedSealType(sealTypeId);
    }
    /**
     * 流程管理
     * @param flowApprove
     * @return
     */
    @ApiOperation(value = "流程管理")
    @GetMapping("/flow/list")
    public CommonResult listFlowApprove(FlowApprove flowApprove){
        return flowApproveService.selectFlowApproveList(flowApprove);
    }
    /**
     * 流程管理新增
     * @param flowApprove
     * @return
     */
    @ApiOperation(value = "流程管理新增")
    @PostMapping("/flow/insert")
    public CommonResult insertFlowApprove(@RequestBody FlowApprove flowApprove){
        return flowApproveService.insertFlowApprove(flowApprove);
    }
    /**
     * 流程管理修改
     * @param flowApprove
     * @return
     */
    @ApiOperation(value = "流程管理修改")
    @PostMapping("/flow/update")
    public CommonResult updateFlowApprove(@RequestBody FlowApprove flowApprove){
        return flowApproveService.updateFlowApprove(flowApprove);
    }
    /**
     * 流程管理删除
     * @param flowId
     * @return
     */
    @ApiOperation(value = "流程管理删除")
    @GetMapping("/flow/deleted")
    public CommonResult deletedFlowApprove(@RequestParam("flowId") Integer flowId){
        return flowApproveService.deletedFlowApprove(flowId);
    }
    /**
     * 用章申请
     * @param useSealApply
     * @return
     */
    @ApiOperation(value = "用章申请列表")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"),
            @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10"),
    })
    @GetMapping("/apply/list")
    public CommonResult listUseSealApply(UseSealApply useSealApply){
        return CommonResult.success(useSealApplyService.selectUseSealApplyList(useSealApply));
    }
    /**
     * 用章申请新增
     * @param useSealApply
     * @return
     */
    @ApiOperation(value = "用章申请新增")
    @PostMapping("/apply/insert")
    public CommonResult insertUseSealApply(@RequestBody UseSealApply useSealApply){
        return useSealApplyService.insertUseSealApply(useSealApply);
    }
    /**
     * 用章申请修改
     * @param useSealApply
     * @return
     */
    @ApiOperation(value = "用章申请修改")
    @PostMapping("/apply/update")
    public CommonResult updateUseSealApply(@RequestBody UseSealApply useSealApply){
        return useSealApplyService.updateUseSealApply(useSealApply);
    }
    /**
     * 用章申请删除
     * @param applyId
     * @return
     */
    @ApiOperation(value = "用章申请删除")
    @GetMapping("/apply/deleted")
    public CommonResult deletedUseSealApply(@RequestParam("applyId") Integer applyId){
        return useSealApplyService.deletedUseSealApply(applyId);
    }
    /**
     * 审批
     * @param useSealApplyFlow
     * @return
     */
    @ApiOperation(value = "审批")
    @PostMapping("/apply/approve")
    public CommonResult approveUseSealApply(@RequestBody UseSealApplyFlow useSealApplyFlow){
        return useSealApplyService.approveUseSealApply(useSealApplyFlow);
    }
}
multi-system/src/main/java/com/gkhy/exam/system/domain/ExStudent.java
@@ -96,6 +96,9 @@
    @TableField(exist = false)
    private String deptName;
    @TableField("user_id")
    private Long userId;
    @ApiModelProperty("删除标志(0代表存在,1代表删除,默认0)")
    @TableField("del_flag")
    private Integer delFlag;
multi-system/src/main/java/com/gkhy/exam/system/domain/FlowApprove.java
New file
@@ -0,0 +1,50 @@
package com.gkhy.exam.system.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
@Setter
@Getter
@TableName("flow_approve")
@ApiModel(value = "flowApprove",description = "流程管理")
public class FlowApprove {
    @ApiModelProperty("主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty(value = "企业id")
    @TableField("company_id")
    private Integer companyId;
    @TableField(exist = false)
    private String companyName;
    @ApiModelProperty(value = "流程名称")
    @TableField("flow_name")
    private String flowName;
    @ApiModelProperty(value = "审批人")
    @TableField("approve_user_id")
    private Integer approveUserId;
    @TableField(exist = false)
    private String approveUserName;
    @TableField(exist = false)
    private Integer deptId;
    @TableField(exist = false)
    private String deptName;
    @ApiModelProperty(value = "是否删除")
    @TableField("del_flag")
    private String delFlag;
}
multi-system/src/main/java/com/gkhy/exam/system/domain/SealType.java
New file
@@ -0,0 +1,49 @@
package com.gkhy.exam.system.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.time.LocalDateTime;
@Setter
@Getter
@TableName("seal_type")
@ApiModel(value = "sealType",description = "印章类型")
public class SealType implements Serializable {
    @ApiModelProperty("主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty(value = "企业id")
    @TableField("company_id")
    private Integer companyId;
    @ApiModelProperty(value = "印章类型")
    @TableField("seal_name")
    private String sealName;
    @ApiModelProperty(value = "是否删除")
    @TableField("del_flag")
    private Integer delFlag;
    @TableField("create_by")
    private String createBy;
    @TableField("create_time")
    private LocalDateTime createTime;
    @TableField("update_by")
    private String updateBy;
    @TableField("update_time")
    private LocalDateTime updateTime;
}
multi-system/src/main/java/com/gkhy/exam/system/domain/StandardizedTemplate.java
@@ -38,11 +38,22 @@
    @NotBlank(message = "模板名称不可为空")
    private String templateName;
    @ApiModelProperty(value = "类型1体系标准2技术标准3应用标准4程序文件5作业指导书6记录及表单7技术类8生产类9其他知识产权")
    @ApiModelProperty(value = "类型1体系标准2技术标准3应用标准4程序文件5作业指导书6记录及表单7技术类8生产类9其他知识产权10程序文件模块")
    @TableField("template_type")
    @NotNull(message = "类型不可为空")
    private Integer templateType;
    @ApiModelProperty(value = "分类 1体系标准  2安全标准 3其他")
    @TableField("classify")
    private Integer classify;
    @ApiModelProperty(value = "所属部门")
    @TableField("dept_id")
    private Integer deptId;
    @TableField(exist = false)
    private String deptName;
    @ApiModelProperty(value = "文件路径")
    @TableField("file_path")
    @NotBlank(message = "文件路径不可为空")
multi-system/src/main/java/com/gkhy/exam/system/domain/SupplierSureQuality.java
@@ -4,11 +4,13 @@
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
@Data
@@ -72,6 +74,11 @@
    @TableField("other_qualifi")
    private String otherQualifi;
    @ApiModelProperty(value = "其他资质到期时间")
    @TableField("other_date")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate otherDate;
    @ApiModelProperty(value = "1通过产品认证  2没有产品认证  3通过质量体系认证  4没有体系认证  5其他认证 6具体内容")
    @TableField("product")
    private String product;
multi-system/src/main/java/com/gkhy/exam/system/domain/UseSealApply.java
New file
@@ -0,0 +1,109 @@
package com.gkhy.exam.system.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
@Setter
@Getter
@TableName("use_seal_apply")
@ApiModel(value = "useSealApply",description = "用章申请")
public class UseSealApply {
    @ApiModelProperty("主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty(value = "企业id")
    @TableField("company_id")
    private Integer companyId;
    @TableField(exist = false)
    private String companyName;
    @ApiModelProperty(value = "申请人")
    @TableField("apply_user_id")
    private Integer applyUserId;
    @TableField(exist = false)
    private String applyUserName;
    @ApiModelProperty(value = "申请人部门")
    @TableField("apply_dept_id")
    private Integer applyDeptId;
    @TableField(exist = false)
    private String applyDeptName;
    @ApiModelProperty(value = "申请时间")
    @TableField("apply_time")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate applyTime;
    @ApiModelProperty(value = "印章类型")
    @TableField("seal_id")
    private Integer sealId;
    @TableField(exist = false)
    private String sealName;
    @ApiModelProperty(value = "盖章份数")
    @TableField("amount")
    private Integer amount;
    @ApiModelProperty(value = "用章时间")
    @TableField("use_seal_time")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate useSealTime;
    @ApiModelProperty(value = "用章事由")
    @TableField("use_seal_cause")
    private String useSealCause;
    @ApiModelProperty(value = "是否红头0否  1是")
    @TableField("is_red")
    private Integer isRed;
    @ApiModelProperty(value = "状态1审批中  2审批完成")
    @TableField("status")
    private Integer status;
    @ApiModelProperty(value = "下一审批人")
    @TableField("next_check")
    private Integer nextCheck;
    @ApiModelProperty(value = "是否删除")
    @TableField("del_flag")
    private Integer delFlag;
    @TableField("create_by")
    private String createBy;
    @TableField("create_time")
    private LocalDateTime createTime;
    @TableField("update_by")
    private String updateBy;
    @TableField("update_time")
    private LocalDateTime updateTime;
    @TableField(exist = false)
    private List<UseSealApplyFile> files;
    @TableField(exist = false)
    private List<UseSealApplyFlow> flows;
}
multi-system/src/main/java/com/gkhy/exam/system/domain/UseSealApplyFile.java
New file
@@ -0,0 +1,40 @@
package com.gkhy.exam.system.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
@Setter
@Getter
@TableName("use_seal_apply_file")
@ApiModel(value = "useSealApplyFile",description = "用章申请文件")
public class UseSealApplyFile implements Serializable {
    @ApiModelProperty("主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty(value = "主表id")
    @TableField("use_seal_id")
    private Integer useSealId;
    @ApiModelProperty(value = "文件名称")
    @TableField("file_name")
    private String fileName;
    @ApiModelProperty(value = "文件路径")
    @TableField("file_path")
    private String filePath;
    @ApiModelProperty(value = "是否删除")
    @TableField("del_flag")
    private Integer delFlag;
}
multi-system/src/main/java/com/gkhy/exam/system/domain/UseSealApplyFlow.java
New file
@@ -0,0 +1,65 @@
package com.gkhy.exam.system.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.time.LocalDateTime;
@Setter
@Getter
@TableName("use_seal_apply_flow")
@ApiModel(value = "useSealApplyFlow",description = "用章申请审批流程")
public class UseSealApplyFlow implements Serializable {
    @ApiModelProperty("主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty(value = "主表id")
    @TableField("use_seal_id")
    private Integer useSealId;
    @ApiModelProperty(value = "流程名称")
    @TableField("flow_name")
    private String flowName;
    @ApiModelProperty(value = "审批人")
    @TableField("approve_user_id")
    private Integer approveUserId;
    @TableField(exist = false)
    private String approveUserName;
    @ApiModelProperty(value = "审批人部门")
    @TableField("approve_dept_id")
    private Integer approveDeptId;
    @TableField(exist = false)
    private String approveDeptName;
    @ApiModelProperty(value = "审批意见内容")
    @TableField("approve_content")
    private String approveContent;
    @ApiModelProperty(value = "审批时间")
    @TableField("approve_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime approveTime;
    @ApiModelProperty(value = "审批状态1同意/提交 2不同意")
    @TableField("approve_status")
    private Integer approveStatus;
    @ApiModelProperty(value = "状态1待审批  2已审批")
    @TableField("status")
    private Integer status;
}
multi-system/src/main/java/com/gkhy/exam/system/mapper/FlowApproveMapper.java
New file
@@ -0,0 +1,17 @@
package com.gkhy.exam.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gkhy.exam.system.domain.FlowApprove;
import org.apache.ibatis.annotations.Param;
import org.mapstruct.Mapper;
import java.util.List;
@Mapper
public interface FlowApproveMapper extends BaseMapper<FlowApprove> {
    List<FlowApprove> selectFlowApproveList(FlowApprove flowApprove);
    void updateByFlowId(@Param("id") Integer flowId);
    FlowApprove selectByApproveUserId(FlowApprove flowApprove);
}
multi-system/src/main/java/com/gkhy/exam/system/mapper/SealTypeMapper.java
New file
@@ -0,0 +1,12 @@
package com.gkhy.exam.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gkhy.exam.system.domain.SealType;
import org.mapstruct.Mapper;
import java.util.List;
@Mapper
public interface SealTypeMapper extends BaseMapper<SealType> {
    List<SealType> selectSealTypeList(SealType sealType);
}
multi-system/src/main/java/com/gkhy/exam/system/mapper/UseSealApplyFileMapper.java
New file
@@ -0,0 +1,21 @@
package com.gkhy.exam.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gkhy.exam.system.domain.UseSealApplyFile;
import com.gkhy.exam.system.domain.UseSealApplyFlow;
import org.apache.ibatis.annotations.Param;
import org.mapstruct.Mapper;
import java.util.List;
@Mapper
public interface UseSealApplyFileMapper extends BaseMapper<UseSealApplyFile> {
    List<UseSealApplyFile> selectByUseSealId(@Param("id") Integer id);
    void insertBatchs(@Param("files") List<UseSealApplyFile> files);
    void deleteByUseSealId(@Param("id") Integer id);
}
multi-system/src/main/java/com/gkhy/exam/system/mapper/UseSealApplyFlowMapper.java
New file
@@ -0,0 +1,24 @@
package com.gkhy.exam.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gkhy.exam.system.domain.UseSealApplyFlow;
import org.apache.ibatis.annotations.Param;
import org.mapstruct.Mapper;
import java.util.List;
@Mapper
public interface UseSealApplyFlowMapper extends BaseMapper<UseSealApplyFlow> {
    List<UseSealApplyFlow> selectByUseSealId(@Param("id") Integer id);
    void insertBatchs(@Param("flows") List<UseSealApplyFlow> flows);
    void deleteByUseSealId(@Param("id") Integer id);
    Integer updateByUseSealId(UseSealApplyFlow useSealApplyFlow);
    UseSealApplyFlow selectByUseId(@Param("useSealId") Integer useSealId
    );
    List<UseSealApplyFlow> selectByUseSealIdAndApplyUserId(@Param("id") Integer id, @Param("approveUserId") Integer approveUserId);
}
multi-system/src/main/java/com/gkhy/exam/system/mapper/UseSealApplyMapper.java
New file
@@ -0,0 +1,15 @@
package com.gkhy.exam.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gkhy.exam.system.domain.UseSealApply;
import org.apache.ibatis.annotations.Param;
import org.mapstruct.Mapper;
import java.util.List;
@Mapper
public interface UseSealApplyMapper extends BaseMapper<UseSealApply> {
    List<UseSealApply> selectUseApplyList(UseSealApply useSealApply);
    List<UseSealApply> selectUseApplyByUserId(@Param("userId") Integer userId);
}
multi-system/src/main/java/com/gkhy/exam/system/service/impl/SysUserServiceImpl.java
@@ -139,14 +139,7 @@
    @Override
    @Transactional(rollbackFor = RuntimeException.class)
    public int addUser(SysUser user) {
        ExStudent exStudent = new ExStudent();
        exStudent.setCompanyId(user.getCompanyId());
        exStudent.setName(user.getName());
        exStudent.setPassword(user.getPassword());
        exStudent.setDeptId(user.getDeptId());
        exStudent.setDuty(user.getDuty());
        exStudent.setSex(user.getSex());
        exStudent.setPhone(user.getPhone());
        checkRequestData(user);
        checkUserAllowed(user);
        user.setCreateBy(SecurityUtils.getUsername());
@@ -155,6 +148,15 @@
        batchSaveRole(user.getRoles(), user.getId(), false);
        ExStudent exStudent = new ExStudent();
        exStudent.setCompanyId(user.getCompanyId());
        exStudent.setName(user.getName());
        exStudent.setPassword(user.getPassword());
        exStudent.setDeptId(user.getDeptId());
        exStudent.setDuty(user.getDuty());
        exStudent.setSex(user.getSex());
        exStudent.setPhone(user.getPhone());
        exStudent.setUserId(user.getId());
        exStudentService.insertStudent(exStudent);
        if (row < 1) {
multi-system/src/main/java/com/gkhy/exam/system/service/useSealApply/FlowApproveService.java
New file
@@ -0,0 +1,16 @@
package com.gkhy.exam.system.service.useSealApply;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gkhy.exam.common.api.CommonPage;
import com.gkhy.exam.common.api.CommonResult;
import com.gkhy.exam.system.domain.FlowApprove;
public interface FlowApproveService extends IService<FlowApprove> {
    CommonResult selectFlowApproveList(FlowApprove flowApprove);
    CommonResult insertFlowApprove(FlowApprove flowApprove);
    CommonResult updateFlowApprove(FlowApprove flowApprove);
    CommonResult deletedFlowApprove(Integer flowId);
}
multi-system/src/main/java/com/gkhy/exam/system/service/useSealApply/SealTypeService.java
New file
@@ -0,0 +1,16 @@
package com.gkhy.exam.system.service.useSealApply;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gkhy.exam.common.api.CommonPage;
import com.gkhy.exam.common.api.CommonResult;
import com.gkhy.exam.system.domain.SealType;
public interface SealTypeService extends IService<SealType> {
    CommonPage selectSealTypeList(SealType sealType);
    CommonResult insertSealType(SealType sealType);
    CommonResult updateSealType(SealType sealType);
    CommonResult deletedSealType(Integer sealTypeId);
}
multi-system/src/main/java/com/gkhy/exam/system/service/useSealApply/UseSealApplyService.java
New file
@@ -0,0 +1,22 @@
package com.gkhy.exam.system.service.useSealApply;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gkhy.exam.common.api.CommonPage;
import com.gkhy.exam.common.api.CommonResult;
import com.gkhy.exam.system.domain.UseSealApply;
import com.gkhy.exam.system.domain.UseSealApplyFlow;
public interface UseSealApplyService extends IService<UseSealApply> {
    CommonPage selectUseSealApplyList(UseSealApply useSealApply);
    CommonResult insertUseSealApply(UseSealApply useSealApply);
    CommonResult updateUseSealApply(UseSealApply useSealApply);
    CommonResult deletedUseSealApply(Integer applyId);
    CommonResult approveUseSealApply(UseSealApplyFlow useSealApplyFlow);
    CommonResult applyList(Integer userId);
}
multi-system/src/main/java/com/gkhy/exam/system/service/useSealApply/impl/FlowApproveServiceImpl.java
New file
@@ -0,0 +1,56 @@
package com.gkhy.exam.system.service.useSealApply.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gkhy.exam.common.api.CommonPage;
import com.gkhy.exam.common.api.CommonResult;
import com.gkhy.exam.common.exception.ApiException;
import com.gkhy.exam.system.domain.FlowApprove;
import com.gkhy.exam.system.mapper.FlowApproveMapper;
import com.gkhy.exam.system.service.useSealApply.FlowApproveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class FlowApproveServiceImpl extends ServiceImpl<FlowApproveMapper, FlowApprove> implements FlowApproveService {
    @Autowired
    private FlowApproveMapper flowApproveMapper;
    @Override
    public CommonResult selectFlowApproveList(FlowApprove flowApprove) {
        if (flowApprove.getCompanyId()==null){
            throw new ApiException("企业不可为空");
        }
        List<FlowApprove> flowApproves = flowApproveMapper.selectFlowApproveList(flowApprove);
        return CommonResult.success(flowApproves);
    }
    @Override
    public CommonResult insertFlowApprove(FlowApprove flowApprove) {
        if (flowApprove.getCompanyId()==null){
            return CommonResult.failed("企业不可为空");
        }
        FlowApprove flowApprove1 = flowApproveMapper.selectByApproveUserId(flowApprove);
        if (flowApprove1!=null){
            return CommonResult.failed("当前用户已存在");
        }
        int insert = flowApproveMapper.insert(flowApprove);
        return CommonResult.success();
    }
    @Override
    public CommonResult updateFlowApprove(FlowApprove flowApprove) {
        int update = flowApproveMapper.updateById(flowApprove);
        return CommonResult.success();
    }
    @Override
    public CommonResult deletedFlowApprove(Integer flowId) {
        flowApproveMapper.updateByFlowId(flowId);
        return CommonResult.success();
    }
}
multi-system/src/main/java/com/gkhy/exam/system/service/useSealApply/impl/SealTypeServiceImpl.java
New file
@@ -0,0 +1,62 @@
package com.gkhy.exam.system.service.useSealApply.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gkhy.exam.common.api.CommonPage;
import com.gkhy.exam.common.api.CommonResult;
import com.gkhy.exam.common.exception.ApiException;
import com.gkhy.exam.common.utils.PageUtils;
import com.gkhy.exam.common.utils.SecurityUtils;
import com.gkhy.exam.system.domain.SealType;
import com.gkhy.exam.system.mapper.SealTypeMapper;
import com.gkhy.exam.system.service.useSealApply.SealTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.List;
@Service
public class SealTypeServiceImpl extends ServiceImpl<SealTypeMapper, SealType> implements SealTypeService {
    @Autowired
    private SealTypeMapper sealTypeMapper;
    @Override
    public CommonPage selectSealTypeList(SealType sealType) {
        if (!SecurityUtils.adminUser()){
            if (sealType.getCompanyId()==null){
                throw new ApiException("非管理员操作,查询条件不可为空");
            }
        }
        PageUtils.startPage();
        List<SealType> sealTypes = sealTypeMapper.selectSealTypeList(sealType);
        return CommonPage.restPage(sealTypes);
    }
    @Override
    public CommonResult insertSealType(SealType sealType) {
        sealType.setCreateTime(LocalDateTime.now());
        sealType.setCreateBy(SecurityUtils.getUsername());
        int insert = sealTypeMapper.insert(sealType);
        return CommonResult.success();
    }
    @Override
    public CommonResult updateSealType(SealType sealType) {
        sealType.setUpdateTime(LocalDateTime.now());
        sealType.setUpdateBy(SecurityUtils.getUsername());
        int update = sealTypeMapper.updateById(sealType);
        return CommonResult.success();
    }
    @Override
    public CommonResult deletedSealType(Integer sealTypeId) {
        SealType sealType = new SealType();
        sealType.setId(sealTypeId);
        sealType.setDelFlag(2);
        sealType.setUpdateTime(LocalDateTime.now());
        sealType.setUpdateBy(SecurityUtils.getUsername());
        sealTypeMapper.updateById(sealType);
        return CommonResult.success();
    }
}
multi-system/src/main/java/com/gkhy/exam/system/service/useSealApply/impl/UseSealApplyServiceImpl.java
New file
@@ -0,0 +1,160 @@
package com.gkhy.exam.system.service.useSealApply.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gkhy.exam.common.api.CommonPage;
import com.gkhy.exam.common.api.CommonResult;
import com.gkhy.exam.common.exception.ApiException;
import com.gkhy.exam.common.utils.PageUtils;
import com.gkhy.exam.common.utils.SecurityUtils;
import com.gkhy.exam.system.domain.UseSealApply;
import com.gkhy.exam.system.domain.UseSealApplyFile;
import com.gkhy.exam.system.domain.UseSealApplyFlow;
import com.gkhy.exam.system.mapper.UseSealApplyFileMapper;
import com.gkhy.exam.system.mapper.UseSealApplyFlowMapper;
import com.gkhy.exam.system.mapper.UseSealApplyMapper;
import com.gkhy.exam.system.service.useSealApply.UseSealApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.time.LocalDateTime;
import java.util.List;
@Service
public class UseSealApplyServiceImpl extends ServiceImpl<UseSealApplyMapper, UseSealApply> implements UseSealApplyService {
    @Autowired
    private UseSealApplyMapper useSealApplyMapper;
    @Autowired
    private UseSealApplyFlowMapper flowMapper;
    @Autowired
    private UseSealApplyFileMapper fileMapper;
    @Override
    public CommonPage selectUseSealApplyList(UseSealApply useSealApply) {
        if (!SecurityUtils.adminUser()){
            if (useSealApply.getCompanyId()==null){
                throw new ApiException("非管理员操作,企业不可为空");
            }
        }
        PageUtils.startPage();
        List<UseSealApply> useSealApplies = useSealApplyMapper.selectUseApplyList(useSealApply);
        for (UseSealApply sealApply : useSealApplies) {
            List<UseSealApplyFlow> useSealApplyFlows = flowMapper.selectByUseSealId(sealApply.getId());
            List<UseSealApplyFile> useSealApplyFiles = fileMapper.selectByUseSealId(sealApply.getId());
            sealApply.setFiles(useSealApplyFiles);
            sealApply.setFlows(useSealApplyFlows);
        }
        return CommonPage.restPage(useSealApplies);
    }
    @Override
    @Transactional
    public CommonResult insertUseSealApply(UseSealApply useSealApply) {
        useSealApply.setCreateBy(SecurityUtils.getUsername());
        useSealApply.setCreateTime(LocalDateTime.now());
        int insert = useSealApplyMapper.insert(useSealApply);
        if (insert>0){
            List<UseSealApplyFlow> flows = useSealApply.getFlows();
            for (UseSealApplyFlow flow : flows) {
                flow.setUseSealId(useSealApply.getId());
                if (flow.getApproveUserId().equals(useSealApply.getApplyUserId())){
                    flow.setStatus(2);
                }else {
                    flow.setStatus(1);
                }
            }
            flowMapper.insertBatchs(flows);
            List<UseSealApplyFile> files = useSealApply.getFiles();
            for (UseSealApplyFile file : files) {
                file.setUseSealId(useSealApply.getId());
            }
            fileMapper.insertBatchs(files);
        }
        return CommonResult.success();
    }
    @Override
    public CommonResult updateUseSealApply(UseSealApply useSealApply) {
        List<UseSealApplyFlow> useSealApplyFlows = flowMapper.selectByUseSealIdAndApplyUserId(useSealApply.getId(), useSealApply.getApplyUserId());
        if (!CollectionUtils.isEmpty(useSealApplyFlows)){
            return CommonResult.failed("该申请已审批,请勿修改");
        }
        useSealApply.setUpdateBy(SecurityUtils.getUsername());
        useSealApply.setUpdateTime(LocalDateTime.now());
        int update = useSealApplyMapper.updateById(useSealApply);
        if (update>0){
            fileMapper.deleteByUseSealId(useSealApply.getId());
            List<UseSealApplyFile> files = useSealApply.getFiles();
            for (UseSealApplyFile file : files) {
                file.setUseSealId(useSealApply.getId());
            }
            fileMapper.insertBatchs(files);
        }
        return CommonResult.success();
    }
    @Override
    public CommonResult deletedUseSealApply(Integer applyId) {
        if (!SecurityUtils.adminUser()){
            List<UseSealApplyFlow> useSealApplyFlows = flowMapper.selectByUseSealIdAndApplyUserId(applyId,null);
            if (!CollectionUtils.isEmpty(useSealApplyFlows)){
                return CommonResult.failed("该申请已审批,请勿删除");
            }
        }
        UseSealApply useSealApply = new UseSealApply();
        useSealApply.setUpdateBy(SecurityUtils.getUsername());
        useSealApply.setUpdateTime(LocalDateTime.now());
        useSealApply.setDelFlag(2);
        useSealApply.setId(applyId);
        useSealApplyMapper.updateById(useSealApply);
        return CommonResult.success();
    }
    @Override
    @Transactional
    public CommonResult approveUseSealApply(UseSealApplyFlow useSealApplyFlow) {
        if (useSealApplyFlow.getApproveStatus()==null){
            return CommonResult.failed("审批意见不可为空");
        }
        if (useSealApplyFlow.getApproveStatus()==1){
            useSealApplyFlow.setApproveContent("同意");
        }else {
            useSealApplyFlow.setApproveContent("不同意");
        }
        useSealApplyFlow.setStatus(2);
        useSealApplyFlow.setApproveTime(LocalDateTime.now());
        Integer i = flowMapper.updateByUseSealId(useSealApplyFlow);
        if (i>0){
            UseSealApply useSealApply = new UseSealApply();
            UseSealApplyFlow useSealApplyFlow1 = flowMapper.selectByUseId(useSealApplyFlow.getUseSealId());
            if (useSealApplyFlow1!=null){
                useSealApply.setNextCheck(useSealApplyFlow1.getApproveUserId());
            }else {
                useSealApply.setStatus(2);
            }
            useSealApply.setId(useSealApplyFlow.getUseSealId());
            useSealApply.setUpdateBy(SecurityUtils.getUsername());
            useSealApply.setUpdateTime(LocalDateTime.now());
            useSealApplyMapper.updateById(useSealApply);
        }
        return CommonResult.success();
    }
    @Override
    public CommonResult applyList(Integer userId) {
        List<UseSealApply> useSealApplies = useSealApplyMapper.selectUseApplyByUserId(userId);
        for (UseSealApply sealApply : useSealApplies) {
            List<UseSealApplyFlow> useSealApplyFlows = flowMapper.selectByUseSealId(sealApply.getId());
            sealApply.setFlows(useSealApplyFlows);
        }
        return CommonResult.success(useSealApplies);
    }
}
multi-system/src/main/resources/mapper/system/FlowApproveMapper.xml
New file
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gkhy.exam.system.mapper.FlowApproveMapper">
    <update id="updateByFlowId">
        update flow_approve set del_flag = 2 where id = #{id}
    </update>
    <select id="selectFlowApproveList" resultType="com.gkhy.exam.system.domain.FlowApprove">
        SELECT
            fa.`id`,
            fa.`company_id`,
            fa.`flow_name`,
            fa.`approve_user_id`,
            su.`name` as approve_user_name,
            su.`dept_id`,
            sd.`dept_name`,
            fa.`del_flag`
        FROM
            `flow_approve` fa
                LEFT JOIN sys_user su on fa.approve_user_id = su.id
                LEFT JOIN sys_dept sd on su.dept_id = sd.dept_id
        WHERE fa.del_flag = 0
        <if test="companyId!=null">
            and fa.company_id = #{companyId}
        </if>
        order By fa.id asc
    </select>
    <select id="selectByApproveUserId" resultType="com.gkhy.exam.system.domain.FlowApprove">
        select  * from flow_approve where approve_user_id = #{approveUserId} and company_id = #{companyId} and del_flag = 0
    </select>
</mapper>
multi-system/src/main/resources/mapper/system/SealTypeMapper.xml
New file
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gkhy.exam.system.mapper.SealTypeMapper">
    <select id="selectSealTypeList" resultType="com.gkhy.exam.system.domain.SealType">
        SELECT
            `id`,
            `company_id`,
            `seal_name`,
            `create_by`,
            `create_time`,
            `update_by`,
            `update_time`,
            `del_flag`
        FROM
            `seal_type`
        where del_flag = 0
            <if test="companyId!=null">
                and company_id = #{companyId}
            </if>
    </select>
</mapper>
multi-system/src/main/resources/mapper/system/StandardizedTemplateMapper.xml
@@ -22,6 +22,12 @@
            <if test="format != null and format !=''" >
                format = #{format},
            </if>
            <if test="classify !=null">
                classify = #{classify},
            </if>
            <if test="deptId !=null">
                dept_id = #{deptId},
            </if>
            <if test="delFlag != null and delFlag != ''" >
                del_flag = #{delFlag},
            </if>
@@ -43,27 +49,31 @@
    <select id="selectStandardizedTemplateList" resultType="com.gkhy.exam.system.domain.StandardizedTemplate">
        SELECT
            `id`,
            `company_id`,
            `company_name`,
            `template_name`,
            `template_type`,
            `file_path`,
            `format`,
            `del_flag`,
            `create_by`,
            `create_time`,
            `update_by`,
            `update_time`
            st.`id`,
            st.`company_id`,
            st.`company_name`,
            st.`template_name`,
            st. `template_type`,
            st. `file_path`,
            st. `format`,
            st. `classify`,
            st. `dept_id`,
            sd.`dept_name`,
            st. `del_flag`,
            st. `create_by`,
            st. `create_time`,
            st. `update_by`,
            st. `update_time`
        FROM
        standardized_template
        standardized_template st
        left join  sys_dept sd on st.dept_id =sd.dept_id
        WHERE
            del_flag = 0 and template_type = #{templateType}
            st.del_flag = 0 and st.template_type = #{templateType}
        <if test="companyId!=null and companyId!=''">
            and company_id = #{companyId}
            and st.company_id = #{companyId}
        </if>
        ORDER BY
            create_time DESC
            st.create_time DESC
    </select>
</mapper>
multi-system/src/main/resources/mapper/system/SupplierSureQualityMapper.xml
@@ -28,6 +28,7 @@
            `team_work`,
            `qualification`,
            `other_qualifi`,
            `other_date`,
            `product`,
            `other_product`,
            `company_mess`,
multi-system/src/main/resources/mapper/system/SysDeptMapper.xml
@@ -198,7 +198,7 @@
    <select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
        select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader_user_id,d.company_id,d.status,d.person_num,d.internal_auditors,
               d.responsibilities,d.dept_type,d.respons_type,
            (select dept_name from sys_dept where dept_id = d.parent_id) parent_name,(select dept_name from sys_user where id = d.leader_user_id) leader_name
            (select dept_name from sys_dept where dept_id = d.parent_id) parent_name,(select `name` from sys_user where id = d.leader_user_id) leader_name
                ,(select dept_name from sys_user where id = d.internal_auditors) internal_auditors_name
        from sys_dept d
        where d.dept_id = #{deptId}
multi-system/src/main/resources/mapper/system/SysUserMapper.xml
@@ -55,8 +55,9 @@
    <select id="getUserByUsername" resultMap="SysUserResult">
        select id,username,name,password,user_type,company_id,status,del_flag,parent_id from sys_user
        where username=#{username} and del_flag=0 limit 1
        select u.id,u.username,u.name,u.password,u.user_type,u.company_id,u.status,u.del_flag,u.parent_id,u.dept_id,d.dept_name from sys_user u
            left join sys_dept  d on d.dept_id=u.dept_id
        where u.username=#{username} and u.del_flag=0 limit 1
    </select>
    <select id="getReponseData" resultType="com.gkhy.exam.common.domain.entity.SysRole">
multi-system/src/main/resources/mapper/system/UseSealApplyFileMapper.xml
New file
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gkhy.exam.system.mapper.UseSealApplyFileMapper">
    <insert id="insertBatchs">
        INSERT INTO `use_seal_apply_file`
            (`use_seal_id`, `file_name`, `file_path`)
        VALUES
            <foreach collection="files" item="item" separator=",">
                (#{item.useSealId},
                 #{item.fileName},
                 #{item.filePath})
            </foreach>
    </insert>
    <delete id="deleteByUseSealId">
        delete from use_seal_apply_file where use_seal_id = #{id}
    </delete>
    <select id="selectByUseSealId" resultType="com.gkhy.exam.system.domain.UseSealApplyFile">
        SELECT
            `id`,
            `use_seal_id`,
            `file_name`,
            `file_path`,
            `del_flag`
        FROM
            `use_seal_apply_file`
        WHERE use_seal_id = #{id} and del_flag = 0
    </select>
</mapper>
multi-system/src/main/resources/mapper/system/UseSealApplyFlowMapper.xml
New file
@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gkhy.exam.system.mapper.UseSealApplyFlowMapper">
    <insert id="insertBatchs">
        INSERT INTO `use_seal_apply_flow`
            (`use_seal_id`, `flow_name`, `approve_user_id`, `approve_dept_id`, `approve_content`, `approve_time`, `approve_status`, `status` )
        VALUES
            <foreach collection="flows" item="item" separator=",">
                (#{item.useSealId},
                 #{item.flowName},
                 #{item.approveUserId},
                 #{item.approveDeptId},
                 #{item.approveContent},
                 #{item.approveTime},
                 #{item.approveStatus},
                 #{item.status} )
            </foreach>
    </insert>
    <update id="updateByUseSealId">
        UPDATE `use_seal_apply_flow`
        SET
            `approve_content` = #{approveContent},
            `approve_time` = #{approveTime},
            `approve_status` = #{approveStatus},
            `status` = #{status}
        WHERE
             use_seal_id = #{useSealId} and approve_user_id = #{approveUserId}
    </update>
    <delete id="deleteByUseSealId">
        delete from use_seal_apply_flow where use_seal_id = #{id}
    </delete>
    <select id="selectByUseSealId" resultType="com.gkhy.exam.system.domain.UseSealApplyFlow">
        SELECT
            usaf.`id`,
            usaf.`use_seal_id`,
            usaf.`flow_name`,
            usaf.`approve_user_id`,
            su.    `name` as approve_user_name,
            usaf.`approve_dept_id`,
            sd.    `dept_name` as approve_dept_name,
            usaf.`approve_content`,
            usaf.`approve_time`,
            usaf.`approve_status`,
            usaf.`status`
        FROM
            `use_seal_apply_flow` usaf
                LEFT JOIN sys_user su on usaf.approve_user_id = su.id
                LEFT JOIN sys_dept sd on usaf.approve_dept_id = sd.dept_id
        WHERE usaf.use_seal_id = #{id}
    </select>
    <select id="selectByUseId" resultType="com.gkhy.exam.system.domain.UseSealApplyFlow">
        SELECT
            `id`,
            `use_seal_id`,
            `flow_name`,
            `approve_user_id`,
            `approve_dept_id`,
            `approve_content`,
            `approve_time`,
            `approve_status`,
            `status`
        FROM
            `use_seal_apply_flow`
        WHERE use_seal_id = #{useSealId} and `status` = 1
        ORDER BY id asc LIMIT 1
    </select>
    <select id="selectByUseSealIdAndApplyUserId" resultType="com.gkhy.exam.system.domain.UseSealApplyFlow">
        SELECT
        usaf.`id`,
        usaf.`use_seal_id`,
        usaf.`flow_name`,
        usaf.`approve_user_id`,
        usaf.`approve_dept_id`,
        usaf.`approve_content`,
        usaf.`approve_time`,
        usaf.`approve_status`,
        usaf.`status`
        FROM
        `use_seal_apply_flow` usaf
        LEFT JOIN use_seal_apply usa ON usaf.use_seal_id = usa.id
        WHERE
        usaf.`status` = 2
        AND usaf.approve_user_id != usa.apply_user_id
            <if test="id!=null">
               and usaf.use_seal_id = #{id}
            </if>
            <if test="approveUserId!=null">
                and usaf.approve_user_id != #{approveUserId}
            </if>
    </select>
</mapper>
multi-system/src/main/resources/mapper/system/UseSealApplyMapper.xml
New file
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gkhy.exam.system.mapper.UseSealApplyMapper">
    <select id="selectUseApplyList" resultType="com.gkhy.exam.system.domain.UseSealApply">
        SELECT
            usa.`id`,
            usa.`company_id`,
            sc.`name` as company_name,
            usa.`apply_user_id`,
            su.`name` as apply_user_name,
            usa.`apply_dept_id`,
            sd.`dept_name` as apply_dept_name,
            usa.`apply_time`,
            usa.`seal_id`,
            st.`seal_name`,
            usa.`amount`,
            usa.`use_seal_time`,
            usa.`use_seal_cause`,
            usa.`is_red`,
            usa.`del_flag`,
            usa.`create_by`,
            usa.`create_time`,
            usa.`update_by`,
            usa.`update_time`,
            usa.`status`,
            usa.`next_check`
        FROM
            `use_seal_apply` usa
                LEFT JOIN sys_user su on usa.apply_user_id = su.id
                LEFT JOIN sys_dept sd on usa.apply_dept_id = sd.dept_id
                LEFT JOIN sys_company sc on usa.company_id = sc.id
                LEFT JOIN seal_type st on usa.seal_id= st.id
        WHERE usa.del_flag =0
            <if test="companyId!=null">
                and usa.company_id = #{companyId}
            </if>
            <if test="applyUserId!=null">
                and usa.apply_user_id = #{applyUserId}
            </if>
            <if test="nextCheck!=null">
                and usa.next_check = #{nextCheck} and usa.status = 1
            </if>
        ORDER BY usa.create_time DESC
    </select>
    <select id="selectUseApplyByUserId" resultType="com.gkhy.exam.system.domain.UseSealApply">
        SELECT
            usa.`id`,
            usa.`company_id`,
            usa.`apply_user_id`,
            su.`name` as apply_user_name,
            usa.`apply_dept_id`,
            sd.`dept_name` as apply_dept_name,
            usa.`apply_time`,
            usa.`seal_id`,
            st.`seal_name`,
            usa.`amount`,
            usa.`use_seal_time`,
            usa.`use_seal_cause`,
            usa.`is_red`,
            usa.`del_flag`,
            usa.`status`,
            usa.`next_check`
        FROM
            `use_seal_apply` usa
                LEFT JOIN sys_user su on usa.apply_user_id = su.id
                LEFT JOIN sys_dept sd on usa.apply_dept_id = sd.dept_id
                LEFT JOIN seal_type st on usa.seal_id= st.id
        WHERE usa.del_flag =0 and usa.status = 1 and usa.next_check = #{userId}
    </select>
</mapper>