zhangyuewww 2 years ago
parent
commit
c7b7c64296

+ 1 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/GeneratorCodeByTables.java

@@ -53,7 +53,7 @@ public class GeneratorCodeByTables {
     }
 
     public static void main(String[] args) throws IOException {
-        generateByTables("Gdc", "com.yh.saas.plugin.yiliangyiyun","fixed_assets_info");
+        generateByTables("Gdc", "com.yh.saas.plugin.yiliangyiyun","general_audit_info");
     }
 
     /**

+ 76 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/GeneralAuditInfoController.java

@@ -0,0 +1,76 @@
+package com.yh.saas.plugin.yiliangyiyun.controller;
+
+
+import com.baomidou.mybatisplus.plugins.Page;
+import com.yh.saas.plugin.yiliangyiyun.entity.GeneralAuditInfo;
+import com.yh.saas.plugin.yiliangyiyun.service.IGeneralAuditInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * <p>
+ * 记录通用审核信息 前端控制器
+ * </p>
+ *
+ * @author Gdc
+ * @since 2022-11-16
+ */
+@RestController
+@RequestMapping("/generalAuditInfo")
+public class GeneralAuditInfoController {
+
+    @Autowired
+    private IGeneralAuditInfoService generalAuditInfoService;
+
+    /**
+     * 查看通用审核
+     * @param id
+     * @return
+     */
+    @GetMapping("/getGeneralAuditInfo")
+    public GeneralAuditInfo getGeneralAuditInfo(String id){
+        return generalAuditInfoService.getGeneralAuditInfo(id);
+    }
+
+    /**
+     * 编辑通用审核
+     * @param generalAuditInfo
+     * @return
+     */
+    @PostMapping("/api/editGeneralAuditInfo")
+    public String editGeneralAuditInfo(@RequestBody GeneralAuditInfo generalAuditInfo){
+        return generalAuditInfoService.editGeneralAuditInfo(generalAuditInfo);
+    }
+
+    /**
+     * 删除通用审核
+     *  @param generalAuditInfo
+     * @return
+     */
+    @PostMapping("/api/deleteGeneralAuditInfo")
+    public void deleteGeneralAuditInfo(@RequestBody GeneralAuditInfo generalAuditInfo) {
+        generalAuditInfoService.deleteGeneralAuditInfo(generalAuditInfo.getId());
+    }
+
+    /**
+     * 通用审核列表
+     * @param generalAuditInfo
+     * @return
+     */
+    @GetMapping("/selectGeneralAuditInfo")
+    public Page<GeneralAuditInfo> selectGeneralAuditInfo(GeneralAuditInfo generalAuditInfo) {
+        return generalAuditInfoService.selectGeneralAuditInfo(generalAuditInfo);
+    }
+
+    /**
+     * 添加通用审核
+     * @param generalAuditInfo
+     * @return
+     */
+    @PostMapping("/api/insertGeneralAuditInfo")
+    public String insertGeneralAuditInfo(@RequestBody GeneralAuditInfo generalAuditInfo) {
+        return generalAuditInfoService.insertGeneralAuditInfo(generalAuditInfo);
+    }
+
+}
+

+ 114 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/GeneralAuditInfo.java

@@ -0,0 +1,114 @@
+package com.yh.saas.plugin.yiliangyiyun.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+import com.baomidou.mybatisplus.annotations.TableField;
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.annotations.TableName;
+import com.baomidou.mybatisplus.enums.IdType;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.yh.saas.common.support.entity.BaseModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.springframework.format.annotation.DateTimeFormat;
+
+/**
+ * <p>
+ * 记录通用审核信息
+ * </p>
+ *
+ * @author Gdc
+ * @since 2022-11-16
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@TableName("general_audit_info")
+public class GeneralAuditInfo extends BaseModel<GeneralAuditInfo> {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.UUID)
+    private String id;
+    /**
+     * 公司id
+     */
+    private String compId;
+    /**
+     * 审核业务编号
+     */
+    private String auditBusinessNo;
+    /**
+     * 类型
+     */
+    private String businessType;
+    /**
+     * 附件地址
+     */
+    private String addressUrl;
+    /**
+     * 备注
+     */
+    private String remark;
+    /**
+     * 发起人
+     */
+    private String sponsor;
+    /**
+     * 状态
+     */
+    private String status;
+    /**
+     * 状态标识
+     */
+    private String statusFlag;
+    /**
+     * 审核状态
+     */
+    private String approveStatus;
+    /**
+     * 审核状态英文
+     */
+    private String approveStatusEn;
+    /**
+     * 工作流ID
+     */
+    private String workflowId;
+    /**
+     * 开始时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @TableField(exist = false)
+    private Date startDate;
+    /**
+     * 结束时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @TableField(exist = false)
+    private Date endDate;
+    /**
+     * 查询类型
+     */
+    @TableField(exist = false)
+    private String searchType;
+    /**
+     * 模糊查询
+     */
+    @TableField(exist = false)
+    private String searchKeyWord;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 35 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/GeneralAuditInfoMapper.java

@@ -0,0 +1,35 @@
+package com.yh.saas.plugin.yiliangyiyun.mapper;
+
+import com.yh.saas.plugin.yiliangyiyun.entity.GeneralAuditInfo;
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 记录通用审核信息 Mapper 接口
+ * </p>
+ *
+ * @author Gdc
+ * @since 2022-11-16
+ */
+public interface GeneralAuditInfoMapper extends BaseMapper<GeneralAuditInfo> {
+    /**
+     * 根据条件查询通用审核总数
+     *
+     * @param pageView
+     * @return
+     */
+    Integer getCountByCondition(Map<String, Object> pageView);
+
+    /**
+     * 根据条件查询通用审核列表
+     *
+     * @param pageView
+     * @return
+     */
+    List<GeneralAuditInfo> getListByCondition(Map<String, Object> pageView);
+
+
+}

+ 48 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IGeneralAuditInfoService.java

@@ -0,0 +1,48 @@
+package com.yh.saas.plugin.yiliangyiyun.service;
+
+import com.baomidou.mybatisplus.plugins.Page;
+import com.yh.saas.plugin.yiliangyiyun.entity.GeneralAuditInfo;
+import com.baomidou.mybatisplus.service.IService;
+
+/**
+ * <p>
+ * 记录通用审核信息 服务类
+ * </p>
+ *
+ * @author Gdc
+ * @since 2022-11-16
+ */
+public interface IGeneralAuditInfoService extends IService<GeneralAuditInfo> {
+    /**
+     * 查看通用审核
+     * @param id
+     */
+    GeneralAuditInfo getGeneralAuditInfo(String id);
+
+    /**
+     * 编辑通用审核
+     * @param generalAuditInfo
+     */
+    String editGeneralAuditInfo(GeneralAuditInfo generalAuditInfo);
+
+    /**
+     * 删除通用审核
+     * @param id
+     */
+    void deleteGeneralAuditInfo(String id);
+
+    /**
+     * 通用审核列表
+     * @param generalAuditInfo
+     * @return
+     */
+    Page<GeneralAuditInfo> selectGeneralAuditInfo(GeneralAuditInfo generalAuditInfo);
+
+    /**
+     * 添加通用审核
+     * @param generalAuditInfo
+     * @return
+     */
+    String insertGeneralAuditInfo(GeneralAuditInfo generalAuditInfo);
+
+}

+ 94 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/GeneralAuditInfoServiceImpl.java

@@ -0,0 +1,94 @@
+package com.yh.saas.plugin.yiliangyiyun.service.impl;
+
+import com.baomidou.mybatisplus.plugins.Page;
+import com.google.common.collect.Lists;
+import com.yh.saas.common.support.util.IdGenerator;
+import com.yh.saas.plugin.yiliangyiyun.entity.GeneralAuditInfo;
+import com.yh.saas.plugin.yiliangyiyun.mapper.GeneralAuditInfoMapper;
+import com.yh.saas.plugin.yiliangyiyun.service.IGeneralAuditInfoService;
+import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import com.yh.saas.plugin.yiliangyiyun.service.INewWorkflowService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 记录通用审核信息 服务实现类
+ * </p>
+ *
+ * @author Gdc
+ * @since 2022-11-16
+ */
+@Service
+public class GeneralAuditInfoServiceImpl extends ServiceImpl<GeneralAuditInfoMapper, GeneralAuditInfo> implements IGeneralAuditInfoService {
+
+    @Autowired
+    private INewWorkflowService workflowService;
+
+    @Override
+    public GeneralAuditInfo getGeneralAuditInfo(String id) {
+        GeneralAuditInfo generalAuditInfo = this.selectById(id);
+        return generalAuditInfo;
+    }
+
+    @Override
+    public String editGeneralAuditInfo(GeneralAuditInfo generalAuditInfo) {
+        boolean one = this.updateById(generalAuditInfo);
+        if (one) {
+            return "OK";
+        } else {
+            return "NG";
+        }
+    }
+
+    @Override
+    public void deleteGeneralAuditInfo(String id) {
+        GeneralAuditInfo generalAuditInfo = this.selectById(id);
+        if (generalAuditInfo != null) {
+            this.deleteById(generalAuditInfo.getId());
+        }
+    }
+
+    @Override
+    public Page<GeneralAuditInfo> selectGeneralAuditInfo(GeneralAuditInfo generalAuditInfo) {
+        Map<String, Object> pageView = new HashMap<>();
+        List<String> businessKeys = null;
+        if ("1".equals(generalAuditInfo.getSearchType())) {
+            businessKeys = workflowService.getTaskBusinessKeysByCode("PAYMENT-MANAGEMENT-APPROVE");
+        }
+        pageView.put("startRecord", (generalAuditInfo.getCurrentPage() - 1)
+                * generalAuditInfo.getPageSize());
+        //公司id
+        pageView.put("compId", generalAuditInfo.getCompId());
+        pageView.put("searchKeyWord", generalAuditInfo.getSearchKeyWord());
+        pageView.put("searchType", generalAuditInfo.getSearchType());
+        pageView.put("businessType", generalAuditInfo.getBusinessType());
+        pageView.put("startDate", generalAuditInfo.getStartDate());
+        pageView.put("endDate", generalAuditInfo.getEndDate());
+        pageView.put("pageSize", generalAuditInfo.getPageSize());
+        pageView.put("currentPage", generalAuditInfo.getCurrentPage());
+        pageView.put("businessKeys", businessKeys);
+        Integer dataCount = baseMapper.getCountByCondition(pageView);
+        List<GeneralAuditInfo> dataList = baseMapper.getListByCondition(pageView);
+        Page<GeneralAuditInfo> page = new Page<>();
+        page.setRecords(dataList == null ? Lists.newArrayList() : dataList);
+        page.setTotal(dataCount == null ? 0 : dataCount);
+        page.setCurrent(generalAuditInfo.getCurrentPage());
+        page.setSize(generalAuditInfo.getPageSize());
+        return page;
+    }
+
+    @Override
+    public String insertGeneralAuditInfo(GeneralAuditInfo generalAuditInfo) {
+        //新增主键id
+        generalAuditInfo.setId(IdGenerator.generateUUID());
+        // 操作主表数据
+        this.insert(generalAuditInfo);
+        return generalAuditInfo.getId();
+    }
+}

+ 108 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/GeneralAuditInfoMapper.xml

@@ -0,0 +1,108 @@
+<?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.yh.saas.plugin.yiliangyiyun.mapper.GeneralAuditInfoMapper">
+
+    <select id="getCountByCondition" parameterType="Map" resultType="java.lang.Integer">
+        SELECT
+        COUNT(id)
+        FROM general_audit_info
+        WHERE delete_flag = '0'
+        <if test="searchKeyWord != null and searchKeyWord != ''">
+            AND (lower(sponsor) like lower(CONCAT('%',#{searchKeyWord},'%'))
+            OR lower(audit_business_no) like lower(CONCAT('%',#{searchKeyWord},'%')))
+        </if>
+        <if test="searchType != null and searchType != ''">
+            <if test="searchType == 1">
+                AND approve_status is not null
+            </if>
+            <if test="searchType == 2">
+                AND status='已驳回'  and approve_status not null
+            </if>
+            <if test="searchType == 3">
+                AND status='已通过'  and approve_status not null
+            </if>
+        </if>
+        <if test="businessType != null and businessType != ''">
+            AND business_type = #{businessType}
+        </if>
+        <if test="startDate != null">
+            AND (DATE_FORMAT(create_date,"%Y%m%d") &gt;=
+            DATE_FORMAT(#{startDate},"%Y%m%d"))
+        </if>
+        <if test="endDate != null">
+            AND (DATE_FORMAT(create_date,"%Y%m%d") &lt;=
+            DATE_FORMAT(#{endDate},"%Y%m%d"))
+        </if>
+        <if test="businessKeys != null and businessKeys.size > 0">
+            and(
+            <foreach collection="businessKeys" item="businessValue" open="(" close=")" separator="or">
+                id = #{businessValue}
+            </foreach>
+            )
+        </if>
+    </select>
+    <select id="getListByCondition" parameterType="Map" resultType="com.yh.saas.plugin.yiliangyiyun.entity.GeneralAuditInfo">
+        SELECT
+            id,
+            sale_plan_no as salePlanNo,
+            sale_plan_type as salePlanType,
+            comp_id as compId,
+            title,
+            goods_name as goodsName,
+            weight,
+            basis_price as basisPrice,
+            unit_price as unitPrice,
+            send_private as sendPrivate,
+            sale_price as salePrice,
+            planned_sale_volume as plannedSaleVolume,
+            send_city as sendCity,
+            send_area as sendArea,
+            send_warehouse as sendWarehouse,
+            status,
+            status_flag as statusFlag,
+            seller,
+            seller_phone as sellerPhone,
+            pc_flag as pcFlag,
+            show_flag as showFlag,
+            update_date as updateDate
+        FROM general_audit_info
+        WHERE delete_flag = '0'
+        <if test="searchKeyWord != null and searchKeyWord != ''">
+            AND (lower(sponsor) like lower(CONCAT('%',#{searchKeyWord},'%'))
+            OR lower(audit_business_no) like lower(CONCAT('%',#{searchKeyWord},'%')))
+        </if>
+        <if test="searchType != null and searchType != ''">
+            <if test="searchType == 1">
+                AND approve_status is not null
+            </if>
+            <if test="searchType == 2">
+                AND status='已驳回'  and approve_status not null
+            </if>
+            <if test="searchType == 3">
+                AND status='已通过'  and approve_status not null
+            </if>
+        </if>
+        <if test="businessType != null and businessType != ''">
+            AND business_type = #{businessType}
+        </if>
+        <if test="startDate != null">
+            AND (DATE_FORMAT(create_date,"%Y%m%d") &gt;=
+            DATE_FORMAT(#{startDate},"%Y%m%d"))
+        </if>
+        <if test="endDate != null">
+            AND (DATE_FORMAT(create_date,"%Y%m%d") &lt;=
+            DATE_FORMAT(#{endDate},"%Y%m%d"))
+        </if>
+        <if test="businessKeys != null and businessKeys.size > 0">
+            and(
+            <foreach collection="businessKeys" item="businessValue" open="(" close=")" separator="or">
+                id = #{businessValue}
+            </foreach>
+            )
+        </if>
+        ORDER BY create_date DESC
+        <if test="currentPage != null and currentPage != ''">
+            LIMIT ${startRecord}, ${pageSize}
+        </if>
+    </select>
+</mapper>