yzc 1 rok temu
rodzic
commit
f8eedab1e1

+ 9 - 0
hx-common/src/main/java/com/fjhx/common/enums/CodingRuleEnum.java

@@ -128,6 +128,15 @@ public enum CodingRuleEnum {
             getDefaultRule(RuleTypeEnum.DATE_FORMAT, "yyyyMM-"),
             getDefaultRule(RuleTypeEnum.AUTOINCREMENT, "3")
     )),
+
+    /**
+     * 用印申请
+     */
+    SEAL_USE("seal_use", "用印申请", Arrays.asList(
+            getDefaultRule(RuleTypeEnum.CUSTOMIZE, "SU-"),
+            getDefaultRule(RuleTypeEnum.DATE_FORMAT, "yyyyMM-"),
+            getDefaultRule(RuleTypeEnum.AUTOINCREMENT, "3")
+    )),
     ;
 
 

+ 87 - 0
hx-oa/src/main/java/com/fjhx/oa/controller/seal/SealUseController.java

@@ -0,0 +1,87 @@
+package com.fjhx.oa.controller.seal;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.oa.entity.seal.dto.SealUseDto;
+import com.fjhx.oa.entity.seal.dto.SealUseSelectDto;
+import com.fjhx.oa.entity.seal.vo.SealUseVo;
+import com.fjhx.oa.service.seal.SealUseService;
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import org.springframework.beans.factory.annotation.Autowired;
+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.RestController;
+
+
+/**
+ * <p>
+ * 用印申请 前端控制器
+ * </p>
+ *
+ * @author
+ * @since 2024-04-09
+ */
+@RestController
+@RequestMapping("/sealUse")
+public class SealUseController {
+
+    @Autowired
+    private SealUseService sealUseService;
+
+    /**
+     * 用印申请分页
+     */
+    @PostMapping("/page")
+    public Page<SealUseVo> page(@RequestBody SealUseSelectDto dto) {
+        return sealUseService.getPage(dto);
+    }
+
+    /**
+     * 用印申请明细
+     */
+    @PostMapping("/detail")
+    public SealUseVo detail(@RequestBody BaseSelectDto dto) {
+        return sealUseService.detail(dto.getId());
+    }
+
+    /**
+     * 用印申请新增
+     */
+    @PostMapping("/add")
+    public void add(@RequestBody SealUseDto sealUseDto) {
+        sealUseService.addOrEdit(sealUseDto);
+    }
+
+    /**
+     * 用印申请编辑
+     */
+    @PostMapping("/edit")
+    public void edit(@RequestBody SealUseDto sealUseDto) {
+        sealUseService.addOrEdit(sealUseDto);
+    }
+
+    /**
+     * 用印申请删除
+     */
+    @PostMapping("/delete")
+    public void delete(@RequestBody BaseSelectDto dto) {
+        sealUseService.delete(dto.getId());
+    }
+
+    /**
+     * 用印归还
+     */
+    @PostMapping("/returned")
+    public void returned(@RequestBody SealUseDto dto) {
+        sealUseService.returned(dto);
+    }
+
+    /**
+     * 用印申请作废
+     */
+    @PostMapping("/cancellation")
+    public void cancellation(@RequestBody SealUseDto dto) {
+        sealUseService.cancellation(dto.getId());
+    }
+
+}

+ 35 - 0
hx-oa/src/main/java/com/fjhx/oa/entity/seal/dto/SealUseDto.java

@@ -0,0 +1,35 @@
+package com.fjhx.oa.entity.seal.dto;
+
+import com.fjhx.file.entity.ObsFile;
+import com.fjhx.oa.entity.seal.po.SealUse;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * 用印申请新增编辑入参实体
+ *
+ * @author
+ * @since 2024-04-09
+ */
+@Getter
+@Setter
+public class SealUseDto extends SealUse {
+
+    /**
+     * 附件信息
+     */
+    private List<ObsFile> fileList;
+    /**
+     * 公司盖章附件信息
+     */
+    private List<ObsFile> companyFileList;
+
+    /**
+     * 客户盖章附件信息
+     */
+    private List<ObsFile> customerFileList;
+
+
+}

+ 24 - 0
hx-oa/src/main/java/com/fjhx/oa/entity/seal/dto/SealUseSelectDto.java

@@ -0,0 +1,24 @@
+package com.fjhx.oa.entity.seal.dto;
+
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 用印申请列表查询入参实体
+ *
+ * @author
+ * @since 2024-04-09
+ */
+@Getter
+@Setter
+public class SealUseSelectDto extends BaseSelectDto {
+
+    private Integer status;
+
+    /**
+     * 是否归还
+     */
+    private Integer isReturned;
+
+}

+ 104 - 0
hx-oa/src/main/java/com/fjhx/oa/entity/seal/po/SealUse.java

@@ -0,0 +1,104 @@
+package com.fjhx.oa.entity.seal.po;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.core.domain.BasePo;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * <p>
+ * 用印申请
+ * </p>
+ *
+ * @author
+ * @since 2024-04-09
+ */
+@Getter
+@Setter
+@TableName("seal_use")
+public class SealUse extends BasePo {
+
+    private String code;
+
+    /**
+     * 申请时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date applyTime;
+
+    /**
+     * 印章ids
+     */
+    private String sealIds;
+
+    /**
+     * 使用方式
+     */
+    private String useMethod;
+
+    /**
+     * 印章类型
+     */
+    private String sealType;
+
+    /**
+     * 是否盖章
+     */
+    private Integer isStamped;
+
+    /**
+     * 盖章类型
+     */
+    private String stampedType;
+
+    /**
+     * 是否合同
+     */
+    private String isContract;
+
+    /**
+     * 合同id
+     */
+    private Long contractId;
+
+    /**
+     * 借出时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date borrowTime;
+
+    /**
+     * 归还时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date returnedTime;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 是否归还
+     */
+    private Integer isReturned;
+
+    /**
+     * 归还用户
+     */
+    private Long returnedUserId;
+
+    /**
+     * 实际归还时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date realityReturnedTime;
+
+    private Integer status;
+
+    private Long flowId;
+
+}

+ 23 - 0
hx-oa/src/main/java/com/fjhx/oa/entity/seal/vo/SealUseVo.java

@@ -0,0 +1,23 @@
+package com.fjhx.oa.entity.seal.vo;
+
+import com.fjhx.oa.entity.seal.po.SealUse;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 用印申请列表查询返回值实体
+ *
+ * @author
+ * @since 2024-04-09
+ */
+@Getter
+@Setter
+public class SealUseVo extends SealUse {
+
+    private String createUserName;
+
+    private String contractCode;
+
+    private String sealNames;
+
+}

+ 74 - 0
hx-oa/src/main/java/com/fjhx/oa/flow/SealUseFlow.java

@@ -0,0 +1,74 @@
+package com.fjhx.oa.flow;
+
+import com.alibaba.fastjson.JSONObject;
+import com.fjhx.common.enums.CodingRuleEnum;
+import com.fjhx.common.enums.FlowStatusEnum1;
+import com.fjhx.common.service.coding.CodingRuleService;
+import com.fjhx.flow.core.FlowDelegate;
+import com.fjhx.flow.enums.FlowStatusEnum;
+import com.fjhx.oa.entity.seal.dto.SealUseDto;
+import com.fjhx.oa.entity.seal.po.SealUse;
+import com.fjhx.oa.service.seal.SealUseService;
+import com.ruoyi.common.core.domain.BasePo;
+import com.ruoyi.common.utils.SecurityUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+@Component
+public class SealUseFlow extends FlowDelegate {
+
+    @Autowired
+    private SealUseService sealUseService;
+    @Autowired
+    private CodingRuleService codingRuleService;
+
+    @Override
+    public String getFlowKey() {
+        return "seal_use_flow";
+    }
+
+    @Override
+    public Long start(Long flowId, JSONObject submitData) {
+        SealUseDto dto = submitData.toJavaObject(SealUseDto.class);
+        dto.setFlowId(flowId);
+
+        dto.setCode(codingRuleService.createCode(CodingRuleEnum.SEAL_USE.getKey(), null));
+        dto.setStatus(FlowStatusEnum1.UNDER_REVIEW.getKey());
+
+        sealUseService.addOrEdit(dto);
+
+        return dto.getId();
+    }
+
+    @Override
+    public void end(Long flowId, Long businessId, JSONObject submitData) {
+        sealUseService.update(q -> q
+                .eq(SealUse::getId, businessId)
+                .set(SealUse::getStatus, FlowStatusEnum1.PASS.getKey())
+                .set(BasePo::getUpdateTime, new Date())
+                .set(BasePo::getUpdateUser, SecurityUtils.getUserId())
+        );
+    }
+
+    @Override
+    public void relaunch(Long flowId, Long businessId, FlowStatusEnum flowStatus, JSONObject submitData) {
+        start(flowId, submitData);
+    }
+
+    @Override
+    public void reject(Long flowId, Long businessId, FlowStatusEnum flowStatus) {
+        sealUseService.update(q -> q
+                .eq(SealUse::getId, businessId)
+                .set(SealUse::getStatus, FlowStatusEnum1.REJECT.getKey())
+                .set(BasePo::getUpdateTime, new Date())
+                .set(BasePo::getUpdateUser, SecurityUtils.getUserId())
+        );
+    }
+
+    @Override
+    public void cancellation(Long flowId, Long businessId, FlowStatusEnum flowStatus) {
+        sealUseService.cancellation(businessId);
+    }
+}

+ 26 - 0
hx-oa/src/main/java/com/fjhx/oa/mapper/seal/SealUseMapper.java

@@ -0,0 +1,26 @@
+package com.fjhx.oa.mapper.seal;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.oa.entity.seal.po.SealUse;
+import com.fjhx.oa.entity.seal.vo.SealUseVo;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import org.apache.ibatis.annotations.Param;
+
+
+/**
+ * <p>
+ * 用印申请 Mapper 接口
+ * </p>
+ *
+ * @author
+ * @since 2024-04-09
+ */
+public interface SealUseMapper extends BaseMapper<SealUse> {
+
+    /**
+     * 用印申请分页
+     */
+    Page<SealUseVo> getPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<SealUse> wrapper);
+
+}

+ 1 - 0
hx-oa/src/main/java/com/fjhx/oa/service/education/impl/EducationSubsidyServiceImpl.java

@@ -51,6 +51,7 @@ public class EducationSubsidyServiceImpl extends ServiceImpl<EducationSubsidyMap
         IWrapper<EducationSubsidy> wrapper = getWrapper();
 
         wrapper.keyword(dto.getKeyword(), new SqlField("es", EducationSubsidy::getCode));
+        wrapper.eq("es", EducationSubsidy::getStatus, dto.getStatus());
 
         wrapper.orderByDesc("es", EducationSubsidy::getId);
         Page<EducationSubsidyVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);

+ 48 - 0
hx-oa/src/main/java/com/fjhx/oa/service/seal/SealUseService.java

@@ -0,0 +1,48 @@
+package com.fjhx.oa.service.seal;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.oa.entity.seal.dto.SealUseDto;
+import com.fjhx.oa.entity.seal.dto.SealUseSelectDto;
+import com.fjhx.oa.entity.seal.po.SealUse;
+import com.fjhx.oa.entity.seal.vo.SealUseVo;
+import com.ruoyi.common.core.service.BaseService;
+
+
+/**
+ * <p>
+ * 用印申请 服务类
+ * </p>
+ *
+ * @author
+ * @since 2024-04-09
+ */
+public interface SealUseService extends BaseService<SealUse> {
+
+    /**
+     * 用印申请分页
+     */
+    Page<SealUseVo> getPage(SealUseSelectDto dto);
+
+    /**
+     * 用印申请明细
+     */
+    SealUseVo detail(Long id);
+
+    /**
+     * 用印申请新增
+     */
+    void addOrEdit(SealUseDto sealUseDto);
+
+    /**
+     * 用印申请删除
+     */
+    void delete(Long id);
+
+    /**
+     * 用印归还
+     */
+
+    void returned(SealUseDto dto);
+
+    void cancellation(Long businessId);
+}

+ 128 - 0
hx-oa/src/main/java/com/fjhx/oa/service/seal/impl/SealUseServiceImpl.java

@@ -0,0 +1,128 @@
+package com.fjhx.oa.service.seal.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.dynamic.datasource.annotation.DSTransactional;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fjhx.common.enums.FlowStatusEnum1;
+import com.fjhx.file.utils.ObsFileUtil;
+import com.fjhx.flow.entity.flow.po.FlowExample;
+import com.fjhx.flow.enums.FlowStatusEnum;
+import com.fjhx.flow.service.flow.FlowExampleService;
+import com.fjhx.oa.entity.seal.dto.SealUseDto;
+import com.fjhx.oa.entity.seal.dto.SealUseSelectDto;
+import com.fjhx.oa.entity.seal.po.SealUse;
+import com.fjhx.oa.entity.seal.vo.SealUseVo;
+import com.fjhx.oa.mapper.seal.SealUseMapper;
+import com.fjhx.oa.service.seal.SealUseService;
+import com.ruoyi.common.core.domain.BasePo;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import com.ruoyi.common.utils.wrapper.SqlField;
+import com.ruoyi.system.utils.UserUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * <p>
+ * 用印申请 服务实现类
+ * </p>
+ *
+ * @author
+ * @since 2024-04-09
+ */
+@Service
+public class SealUseServiceImpl extends ServiceImpl<SealUseMapper, SealUse> implements SealUseService {
+
+    @Autowired
+    private FlowExampleService flowExampleService;
+
+    @Override
+    public Page<SealUseVo> getPage(SealUseSelectDto dto) {
+        IWrapper<SealUse> wrapper = getWrapper();
+
+        wrapper.keyword(dto.getKeyword(),
+                new SqlField("su", SealUse::getCode),
+                new SqlField("c.code")
+        );
+        wrapper.eq("su", SealUse::getStatus, dto.getStatus());
+        wrapper.eq("su", SealUse::getIsReturned, dto.getIsReturned());
+
+        wrapper.orderByDesc("su", SealUse::getId);
+        Page<SealUseVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
+        List<SealUseVo> records = page.getRecords();
+        setInfo(records);
+
+        return page;
+    }
+
+    @Override
+    public SealUseVo detail(Long id) {
+        SealUse SealUse = this.getById(id);
+        SealUseVo result = BeanUtil.toBean(SealUse, SealUseVo.class);
+
+        setInfo(Arrays.asList(result));
+        return result;
+    }
+
+    void setInfo(List<SealUseVo> records) {
+        if (ObjectUtil.isEmpty(records)) {
+            return;
+        }
+
+        UserUtil.assignmentNickName(records, SealUseVo::getCreateUser, SealUseVo::setCreateUserName);
+    }
+
+    @DSTransactional
+    @Override
+    public void addOrEdit(SealUseDto sealUseDto) {
+        this.save(sealUseDto);
+        ObsFileUtil.editFile(sealUseDto.getFileList(), sealUseDto.getId(), 10);
+        ObsFileUtil.editFile(sealUseDto.getCompanyFileList(), sealUseDto.getId(), 20);
+        ObsFileUtil.editFile(sealUseDto.getCustomerFileList(), sealUseDto.getId(), 30);
+    }
+
+
+    @Override
+    public void delete(Long id) {
+        this.removeById(id);
+    }
+
+    @Override
+    public void returned(SealUseDto dto) {
+        this.update(q -> q
+                .eq(SealUse::getId, dto.getId())
+                .set(SealUse::getIsReturned, 1)
+                .set(SealUse::getRealityReturnedTime, dto.getRealityReturnedTime())
+                .set(BasePo::getUpdateTime, new Date())
+                .set(BasePo::getUpdateUser, SecurityUtils.getUserId())
+        );
+    }
+
+    @Override
+    public void cancellation(Long businessId) {
+        SealUse byId = getById(businessId);
+        this.update(q -> q
+                .eq(SealUse::getId, businessId)
+                .set(SealUse::getStatus, FlowStatusEnum1.CANCELLATION.getKey())
+                .set(BasePo::getUpdateTime, new Date())
+                .set(BasePo::getUpdateUser, SecurityUtils.getUserId())
+        );
+
+        //销毁审批中的流程
+        flowExampleService.update(q -> q
+                .eq(FlowExample::getId, byId.getFlowId())
+                .in(FlowExample::getStatus, FlowStatusEnum.READY_START.getKey(), FlowStatusEnum.IN_PROGRESS.getKey())
+                .set(FlowExample::getStatus, FlowStatusEnum.CANCELLATION.getKey())
+                .set(BasePo::getUpdateUser, SecurityUtils.getUserId())
+                .set(BasePo::getUpdateTime, new Date())
+        );
+    }
+
+}

+ 36 - 0
hx-oa/src/main/resources/mapper/seal/SealUseMapper.xml

@@ -0,0 +1,36 @@
+<?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.fjhx.oa.mapper.seal.SealUseMapper">
+    <select id="getPage" resultType="com.fjhx.oa.entity.seal.vo.SealUseVo">
+        SELECT su.id,
+               su.`code`,
+               su.apply_time,
+               su.seal_ids,
+               su.use_method,
+               su.seal_type,
+               su.is_stamped,
+               su.stamped_type,
+               su.is_contract,
+               su.contract_id,
+               su.borrow_time,
+               su.returned_time,
+               su.remark,
+               su.is_returned,
+               su.returned_user_id,
+               su.reality_returned_time,
+               su.`status`,
+               su.flow_id,
+               su.create_user,
+               su.create_time,
+               su.update_user,
+               su.update_time,
+               c.`code`                                 AS contractCode,
+               (SELECT GROUP_CONCAT(sec.`name`)
+                FROM seal_config sec
+                WHERE FIND_IN_SET(sec.id, su.seal_ids)) AS sealNames
+        FROM seal_use su
+                 LEFT JOIN contract c ON su.contract_id = c.id
+            ${ew.customSqlSegment}
+    </select>
+
+</mapper>