Kaynağa Gözat

新增出入库质量接口

my-csc-config-file.git 4 yıl önce
ebeveyn
işleme
073a1979d8

+ 16 - 0
src/main/java/com/unissoft/mapper/WarehousingQualityChildrenMapper.java

@@ -0,0 +1,16 @@
1
+package com.unissoft.mapper;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.unissoft.model.WarehousingQualityChildren;
5
+
6
+/**
7
+ * <p>
8
+ * 入库质量表名称字表 Mapper 接口
9
+ * </p>
10
+ *
11
+ * @author root
12
+ * @since 2021-04-12
13
+ */
14
+public interface WarehousingQualityChildrenMapper extends BaseMapper<WarehousingQualityChildren> {
15
+
16
+}

+ 24 - 0
src/main/java/com/unissoft/mapper/WarehousingQualityChildrenMapper.xml

@@ -0,0 +1,24 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.unissoft.mapper.WarehousingQualityChildrenMapper">
4
+
5
+    <!-- 通用查询映射结果 -->
6
+    <resultMap id="BaseResultMap" type="com.unissoft.model.WarehousingQualityChildren">
7
+        <id column="id" property="id" />
8
+        <result column="warehousing_id" property="warehousingId" />
9
+        <result column="w_index" property="wIndex" />
10
+        <result column="creation_time" property="creationTime" />
11
+        <result column="check_name" property="checkName" />
12
+        <result column="check_type" property="checkType" />
13
+        <result column="w_quality" property="wQuality" />
14
+        <result column="w_character" property="wCharacter" />
15
+        <result column="toxin_index" property="toxinIndex" />
16
+        <result column="spare_field" property="spareField" />
17
+    </resultMap>
18
+
19
+    <!-- 通用查询结果列 -->
20
+    <sql id="Base_Column_List">
21
+        id, warehousing_id, w_index, creation_time, check_name, check_type, w_quality, w_character, toxin_index, spare_field
22
+    </sql>
23
+
24
+</mapper>

+ 23 - 0
src/main/java/com/unissoft/mapper/WarehousingQualityMapper.java

@@ -0,0 +1,23 @@
1
+package com.unissoft.mapper;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.unissoft.model.WarehousingQuality;
6
+import com.unissoft.model.WarehousingQualityPO;
7
+import org.apache.ibatis.annotations.Param;
8
+
9
+import java.util.List;
10
+
11
+/**
12
+ * <p>
13
+ * 入库质量表名称 Mapper 接口
14
+ * </p>
15
+ *
16
+ * @author root
17
+ * @since 2021-04-12
18
+ */
19
+public interface WarehousingQualityMapper extends BaseMapper<WarehousingQuality> {
20
+    IPage<WarehousingQualityPO> getPage(IPage<WarehousingQualityPO> page, @Param("depotId") String depotId, @Param("warehouseId") String warehouseId, @Param("creationTimeStart") String creationTimeStart, @Param("creationTimeEnd") String creationTimeEnd);
21
+
22
+    List<WarehousingQualityPO> getByIdQality(@Param("id") int id);
23
+}

+ 99 - 0
src/main/java/com/unissoft/mapper/WarehousingQualityMapper.xml

@@ -0,0 +1,99 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.unissoft.mapper.WarehousingQualityMapper">
4
+
5
+    <!-- 通用查询映射结果 -->
6
+    <resultMap id="BaseResultMap" type="com.unissoft.model.WarehousingQuality">
7
+        <id column="id" property="id"/>
8
+        <result column="depot_id" property="depotId"/>
9
+        <result column="depot_name" property="depotName"/>
10
+        <result column="warehouse_id" property="warehouseId"/>
11
+        <result column="warehouse_name" property="warehouseName"/>
12
+        <result column="check_name" property="checkName"/>
13
+        <result column="check_type" property="checkType"/>
14
+        <result column="creation_time" property="creationTime"/>
15
+        <result column="end_time" property="endTime"/>
16
+        <result column="quality_state" property="qualityState"/>
17
+    </resultMap>
18
+
19
+    <!-- 通用查询映射结果 -->
20
+    <resultMap id="BaseResultMapPO" type="com.unissoft.model.WarehousingQualityPO">
21
+        <id column="id" property="id"/>
22
+        <result column="depot_id" property="depotId"/>
23
+        <result column="depot_name" property="depotName"/>
24
+        <result column="warehouse_id" property="warehouseId"/>
25
+        <result column="warehouse_name" property="warehouseName"/>
26
+        <result column="check_name" property="checkName"/>
27
+        <result column="check_type" property="checkType"/>
28
+        <result column="creation_time" property="creationTime"/>
29
+        <result column="end_time" property="endTime"/>
30
+        <result column="quality_state" property="qualityState"/>
31
+        <collection property="qualityChildrens" ofType="com.unissoft.model.WarehousingQualityChildren">
32
+            <id column="children_id" property="childrenId"/>
33
+            <result column="warehousing_id" property="warehousingId"/>
34
+            <result column="w_index" property="wIndex"/>
35
+            <result column="creation_time" property="creationTime"/>
36
+            <result column="check_name" property="checkName"/>
37
+            <result column="check_type" property="checkType"/>
38
+            <result column="w_quality" property="wQuality"/>
39
+            <result column="w_character" property="wCharacter"/>
40
+            <result column="toxin_index" property="toxinIndex"/>
41
+            <result column="spare_field" property="spareField"/>
42
+        </collection>
43
+    </resultMap>
44
+
45
+    <!-- 通用查询结果列 -->
46
+    <sql id="Base_Column_List">
47
+        id, depot_id, depot_name, warehouse_id, warehouse_name, check_name, check_type, creation_time, end_time, quality_state
48
+    </sql>
49
+
50
+    <sql id="Base_Column_ListPO">
51
+        a.id,
52
+	a.depot_id,
53
+	a.depot_name,
54
+	a.warehouse_id,
55
+	a.warehouse_name,
56
+	a.creation_time,
57
+	a.end_time,
58
+	b.id children_id,
59
+	b.warehousing_id,
60
+	b.creation_time,
61
+	b.w_index,
62
+	b.check_name,
63
+	b.check_type,
64
+	b.w_quality,
65
+	b.w_character,
66
+	b.toxin_index
67
+    </sql>
68
+
69
+    <select id="getPage" resultMap="BaseResultMapPO">
70
+        SELECT
71
+        <include refid="Base_Column_ListPO"/>
72
+        FROM
73
+        warehousing_quality a
74
+        LEFT JOIN warehousing_quality_children b ON a.id = b.warehousing_id
75
+        <where>
76
+            <if test="depotId != null and depotId != ''">
77
+                and a.depot_id = #{depotId}
78
+            </if>
79
+            <if test="warehouseId != null and warehouseId != ''">
80
+                and a.warehouse_id = #{warehouseId}
81
+            </if>
82
+            <if test="creationTimeStart != null and creationTimeStart != '' and creationTimeEnd != null and creationTimeEnd != ''">
83
+                and a.creation_time BETWEEN #{creationTimeStart} and #{creationTimeEnd}
84
+            </if>
85
+        </where>
86
+        ORDER BY a.creation_time desc,b.creation_time asc
87
+    </select>
88
+
89
+    <select id="getByIdQality" resultMap="BaseResultMapPO">
90
+        SELECT
91
+        <include refid="Base_Column_ListPO"/>
92
+        FROM
93
+        warehousing_quality a
94
+        LEFT JOIN warehousing_quality_children b ON a.id = b.warehousing_id
95
+        <where>
96
+            and a.id = #{id}
97
+        </where>
98
+    </select>
99
+</mapper>

+ 84 - 0
src/main/java/com/unissoft/model/WarehousingQuality.java

@@ -0,0 +1,84 @@
1
+package com.unissoft.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
5
+import com.baomidou.mybatisplus.annotation.TableId;
6
+import com.baomidou.mybatisplus.annotation.TableName;
7
+import io.swagger.annotations.ApiModel;
8
+import io.swagger.annotations.ApiModelProperty;
9
+import lombok.Data;
10
+import lombok.EqualsAndHashCode;
11
+
12
+import java.io.Serializable;
13
+import java.util.Date;
14
+
15
+/**
16
+ * <p>
17
+ * 入库质量表名称
18
+ * </p>
19
+ *
20
+ * @author root
21
+ * @since 2021-04-12
22
+ */
23
+@Data
24
+@EqualsAndHashCode(callSuper = false)
25
+@TableName("warehousing_quality")
26
+@ApiModel(value="WarehousingQuality对象", description="入库质量表名称")
27
+public class WarehousingQuality implements Serializable {
28
+
29
+    private static final long serialVersionUID = 1L;
30
+
31
+    @TableId(value = "id", type = IdType.AUTO)
32
+    private Integer id;
33
+
34
+    @ApiModelProperty(value = "库点id")
35
+    @TableField("depot_id")
36
+    private Integer depotId;
37
+
38
+    @ApiModelProperty(value = "库点名称")
39
+    @TableField("depot_name")
40
+    private String depotName;
41
+
42
+    @ApiModelProperty(value = "仓房id")
43
+    @TableField("warehouse_id")
44
+    private Integer warehouseId;
45
+
46
+    @ApiModelProperty(value = "仓房名称")
47
+    @TableField("warehouse_name")
48
+    private String warehouseName;
49
+
50
+    @ApiModelProperty(value = "检测名称当前处于类型")
51
+    @TableField("check_name")
52
+    private String checkName;
53
+
54
+    @ApiModelProperty(value = "检测类型(0:1/3,1:1/2,2:2/3,3:自验收,4:质检中心验收,5:质检中心巡检)")
55
+    @TableField("check_type")
56
+    private Integer checkType;
57
+
58
+    @ApiModelProperty(value = "创建时间")
59
+    @TableField("creation_time")
60
+    private Date creationTime;
61
+
62
+    @ApiModelProperty(value = "结束时间")
63
+    @TableField("end_time")
64
+    private Date endTime;
65
+
66
+    @ApiModelProperty(value = "0进行中,1完成")
67
+    @TableField("quality_state")
68
+    private Integer qualityState;
69
+
70
+    public WarehousingQuality() {
71
+    }
72
+
73
+    public WarehousingQuality(Integer depotId, String depotName, Integer warehouseId, String warehouseName, String checkName, Integer checkType, Date creationTime, Date endTime, Integer qualityState) {
74
+        this.depotId = depotId;
75
+        this.depotName = depotName;
76
+        this.warehouseId = warehouseId;
77
+        this.warehouseName = warehouseName;
78
+        this.checkName = checkName;
79
+        this.checkType = checkType;
80
+        this.creationTime = creationTime;
81
+        this.endTime = endTime;
82
+        this.qualityState = qualityState;
83
+    }
84
+}

+ 85 - 0
src/main/java/com/unissoft/model/WarehousingQualityChildren.java

@@ -0,0 +1,85 @@
1
+package com.unissoft.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
5
+import com.baomidou.mybatisplus.annotation.TableId;
6
+import com.baomidou.mybatisplus.annotation.TableName;
7
+import com.fasterxml.jackson.annotation.JsonFormat;
8
+import io.swagger.annotations.ApiModel;
9
+import io.swagger.annotations.ApiModelProperty;
10
+import lombok.Data;
11
+import lombok.EqualsAndHashCode;
12
+
13
+import java.io.Serializable;
14
+import java.util.Date;
15
+
16
+/**
17
+ * <p>
18
+ * 入库质量表名称字表
19
+ * </p>
20
+ *
21
+ * @author root
22
+ * @since 2021-04-12
23
+ */
24
+@Data
25
+@EqualsAndHashCode(callSuper = false)
26
+@TableName("warehousing_quality_children")
27
+@ApiModel(value="WarehousingQualityChildren对象", description="入库质量表名称字表")
28
+public class WarehousingQualityChildren implements Serializable {
29
+
30
+    private static final long serialVersionUID = 1L;
31
+
32
+    @TableId(value = "id", type = IdType.AUTO)
33
+    private Integer childrenId;
34
+
35
+    @ApiModelProperty(value = "入库质量表id")
36
+    @TableField("warehousing_id")
37
+    private Integer warehousingId;
38
+
39
+    @ApiModelProperty(value = "内置序列号")
40
+    @TableField("w_index")
41
+    private Integer wIndex;
42
+
43
+    @ApiModelProperty(value = "记录时间")
44
+    @JsonFormat(shape=JsonFormat.Shape.STRING,pattern="yyyy-MM-dd HH:mm",timezone="GMT+8")
45
+    @TableField("creation_time")
46
+    private Date creationTime;
47
+
48
+    @ApiModelProperty(value = "检测类型名称")
49
+    @TableField("check_name")
50
+    private String checkName;
51
+
52
+    @ApiModelProperty(value = "检测类型(0:1/3,1:1/2,2:2/3,3:自验收,4:质检中心验收,5:质检中心巡检)")
53
+    @TableField("check_type")
54
+    private Integer checkType;
55
+
56
+    @ApiModelProperty(value = "质量(0达标宜存,1不达标宜存,2不达标不宜存)")
57
+    @TableField("w_quality")
58
+    private Integer wQuality;
59
+
60
+    @ApiModelProperty(value = "品质(0达标宜存,1不达标宜存,2不达标不宜存)")
61
+    @TableField("w_character")
62
+    private Integer wCharacter;
63
+
64
+    @ApiModelProperty(value = "毒素指标(0达标宜存,1不达标宜存,2不达标不宜存)")
65
+    @TableField("toxin_index")
66
+    private Integer toxinIndex;
67
+
68
+    @ApiModelProperty(value = "备用字段")
69
+    @TableField("spare_field")
70
+    private String spareField;
71
+
72
+    public WarehousingQualityChildren() {
73
+    }
74
+
75
+    public WarehousingQualityChildren(Integer warehousingId, Integer wIndex, Date creationTime, String checkName, Integer checkType, Integer wQuality, Integer wCharacter, Integer toxinIndex) {
76
+        this.warehousingId = warehousingId;
77
+        this.wIndex = wIndex;
78
+        this.creationTime = creationTime;
79
+        this.checkName = checkName;
80
+        this.checkType = checkType;
81
+        this.wQuality = wQuality;
82
+        this.wCharacter = wCharacter;
83
+        this.toxinIndex = toxinIndex;
84
+    }
85
+}

+ 152 - 0
src/main/java/com/unissoft/model/WarehousingQualityPO.java

@@ -0,0 +1,152 @@
1
+package com.unissoft.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
5
+import com.baomidou.mybatisplus.annotation.TableId;
6
+import com.baomidou.mybatisplus.annotation.TableName;
7
+import com.fasterxml.jackson.annotation.JsonFormat;
8
+import io.swagger.annotations.ApiModel;
9
+import io.swagger.annotations.ApiModelProperty;
10
+import lombok.Data;
11
+import lombok.EqualsAndHashCode;
12
+
13
+import java.io.Serializable;
14
+import java.util.Date;
15
+import java.util.List;
16
+
17
+/**
18
+ * <p>
19
+ * 入库质量表名称
20
+ * </p>
21
+ *
22
+ * @author root
23
+ * @since 2021-04-12
24
+ */
25
+@Data
26
+@EqualsAndHashCode(callSuper = false)
27
+@ApiModel(value="WarehousingQualityPO", description="入库质量表名称包装实体")
28
+public class WarehousingQualityPO implements Serializable {
29
+
30
+    private static final long serialVersionUID = 1L;
31
+
32
+    private Integer id;
33
+
34
+    @ApiModelProperty(value = "库点id")
35
+    private Integer depotId;
36
+
37
+    @ApiModelProperty(value = "库点名称")
38
+    private String depotName;
39
+
40
+    @ApiModelProperty(value = "仓房id")
41
+    private Integer warehouseId;
42
+
43
+    @ApiModelProperty(value = "仓房名称")
44
+    private String warehouseName;
45
+
46
+    @ApiModelProperty(value = "检测名称当前处于类型")
47
+    private String checkName;
48
+
49
+    @ApiModelProperty(value = "检测类型(0:1/3,1:1/2,2:2/3,3:自验收,4:质检中心验收,5:质检中心巡检)")
50
+    private Integer checkType;
51
+
52
+    @ApiModelProperty(value = "创建时间")
53
+    @JsonFormat(shape=JsonFormat.Shape.STRING,pattern="yyyy-MM-dd HH:mm",timezone="GMT+8")
54
+    private Date creationTime;
55
+
56
+    @ApiModelProperty(value = "结束时间")
57
+    @JsonFormat(shape=JsonFormat.Shape.STRING,pattern="yyyy-MM-dd HH:mm",timezone="GMT+8")
58
+    private Date endTime;
59
+
60
+    @ApiModelProperty(value = "0进行中,1完成")
61
+    private Integer qualityState;
62
+
63
+    private List<WarehousingQualityChildren> qualityChildrens;
64
+
65
+    public Integer getId() {
66
+        return id;
67
+    }
68
+
69
+    public void setId(Integer id) {
70
+        this.id = id;
71
+    }
72
+
73
+    public Integer getDepotId() {
74
+        return depotId;
75
+    }
76
+
77
+    public void setDepotId(Integer depotId) {
78
+        this.depotId = depotId;
79
+    }
80
+
81
+    public String getDepotName() {
82
+        return depotName;
83
+    }
84
+
85
+    public void setDepotName(String depotName) {
86
+        this.depotName = depotName;
87
+    }
88
+
89
+    public Integer getWarehouseId() {
90
+        return warehouseId;
91
+    }
92
+
93
+    public void setWarehouseId(Integer warehouseId) {
94
+        this.warehouseId = warehouseId;
95
+    }
96
+
97
+    public String getWarehouseName() {
98
+        return warehouseName;
99
+    }
100
+
101
+    public void setWarehouseName(String warehouseName) {
102
+        this.warehouseName = warehouseName;
103
+    }
104
+
105
+    public String getCheckName() {
106
+        return checkName;
107
+    }
108
+
109
+    public void setCheckName(String checkName) {
110
+        this.checkName = checkName;
111
+    }
112
+
113
+    public Integer getCheckType() {
114
+        return checkType;
115
+    }
116
+
117
+    public void setCheckType(Integer checkType) {
118
+        this.checkType = checkType;
119
+    }
120
+
121
+    public Date getCreationTime() {
122
+        return creationTime;
123
+    }
124
+
125
+    public void setCreationTime(Date creationTime) {
126
+        this.creationTime = creationTime;
127
+    }
128
+
129
+    public Date getEndTime() {
130
+        return endTime;
131
+    }
132
+
133
+    public void setEndTime(Date endTime) {
134
+        this.endTime = endTime;
135
+    }
136
+
137
+    public Integer getQualityState() {
138
+        return qualityState;
139
+    }
140
+
141
+    public void setQualityState(Integer qualityState) {
142
+        this.qualityState = qualityState;
143
+    }
144
+
145
+    public List<WarehousingQualityChildren> getQualityChildrens() {
146
+        return qualityChildrens;
147
+    }
148
+
149
+    public void setQualityChildrens(List<WarehousingQualityChildren> qualityChildrens) {
150
+        this.qualityChildrens = qualityChildrens;
151
+    }
152
+}

+ 206 - 0
src/main/java/com/unissoft/model/WarehousingQualityVO.java

@@ -0,0 +1,206 @@
1
+package com.unissoft.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
5
+import com.baomidou.mybatisplus.annotation.TableId;
6
+import io.swagger.annotations.ApiModel;
7
+import io.swagger.annotations.ApiModelProperty;
8
+import lombok.Data;
9
+import lombok.EqualsAndHashCode;
10
+
11
+import java.io.Serializable;
12
+import java.util.Date;
13
+import java.util.List;
14
+
15
+/**
16
+ * <p>
17
+ * 入库质量表名称
18
+ * </p>
19
+ *
20
+ * @author root
21
+ * @since 2021-04-12
22
+ */
23
+@Data
24
+@EqualsAndHashCode(callSuper = false)
25
+@ApiModel(value="WarehousingQualityVO", description="入库质量表名称包装实体")
26
+public class WarehousingQualityVO implements Serializable {
27
+
28
+    private static final long serialVersionUID = 1L;
29
+
30
+    private Integer id;
31
+
32
+    private Integer childrenId;
33
+
34
+    @ApiModelProperty(value = "标识是否第一次新增,0代表第一次,1代表n次")
35
+    private Integer saveType;
36
+
37
+    @ApiModelProperty(value = "库点id")
38
+    private Integer depotId;
39
+
40
+    @ApiModelProperty(value = "库点名称")
41
+    private String depotName;
42
+
43
+    @ApiModelProperty(value = "仓房id")
44
+    private Integer warehouseId;
45
+
46
+    @ApiModelProperty(value = "仓房名称")
47
+    private String warehouseName;
48
+
49
+    @ApiModelProperty(value = "检测名称当前处于类型")
50
+    private String checkName;
51
+
52
+    @ApiModelProperty(value = "检测类型(0:1/3,1:1/2,2:2/3,3:自验收,4:质检中心验收,5:质检中心巡检)")
53
+    private Integer checkType;
54
+
55
+    @ApiModelProperty(value = "创建时间")
56
+    private Date creationTime;
57
+
58
+    @ApiModelProperty(value = "结束时间")
59
+    private Date endTime;
60
+
61
+    @ApiModelProperty(value = "0进行中,1完成")
62
+    private Integer qualityState;
63
+
64
+    @ApiModelProperty(value = "入库质量表id")
65
+    private Integer warehousingId;
66
+
67
+    @ApiModelProperty(value = "内置序列号")
68
+    private Integer wIndex;
69
+
70
+    @ApiModelProperty(value = "质量(0达标宜存,1不达标宜存,2不达标不宜存)")
71
+    private Integer wQuality;
72
+
73
+    @ApiModelProperty(value = "品质(0达标宜存,1不达标宜存,2不达标不宜存)")
74
+    private Integer wCharacter;
75
+
76
+    @ApiModelProperty(value = "毒素指标(0达标宜存,1不达标宜存,2不达标不宜存)")
77
+    private Integer toxinIndex;
78
+
79
+    public Integer getId() {
80
+        return id;
81
+    }
82
+
83
+    public void setId(Integer id) {
84
+        this.id = id;
85
+    }
86
+
87
+    public Integer getDepotId() {
88
+        return depotId;
89
+    }
90
+
91
+    public void setDepotId(Integer depotId) {
92
+        this.depotId = depotId;
93
+    }
94
+
95
+    public String getDepotName() {
96
+        return depotName;
97
+    }
98
+
99
+    public void setDepotName(String depotName) {
100
+        this.depotName = depotName;
101
+    }
102
+
103
+    public Integer getWarehouseId() {
104
+        return warehouseId;
105
+    }
106
+
107
+    public void setWarehouseId(Integer warehouseId) {
108
+        this.warehouseId = warehouseId;
109
+    }
110
+
111
+    public String getWarehouseName() {
112
+        return warehouseName;
113
+    }
114
+
115
+    public void setWarehouseName(String warehouseName) {
116
+        this.warehouseName = warehouseName;
117
+    }
118
+
119
+    public String getCheckName() {
120
+        return checkName;
121
+    }
122
+
123
+    public void setCheckName(String checkName) {
124
+        this.checkName = checkName;
125
+    }
126
+
127
+    public Integer getCheckType() {
128
+        return checkType;
129
+    }
130
+
131
+    public void setCheckType(Integer checkType) {
132
+        this.checkType = checkType;
133
+    }
134
+
135
+    public Date getCreationTime() {
136
+        return creationTime;
137
+    }
138
+
139
+    public void setCreationTime(Date creationTime) {
140
+        this.creationTime = creationTime;
141
+    }
142
+
143
+    public Date getEndTime() {
144
+        return endTime;
145
+    }
146
+
147
+    public void setEndTime(Date endTime) {
148
+        this.endTime = endTime;
149
+    }
150
+
151
+    public Integer getQualityState() {
152
+        return qualityState;
153
+    }
154
+
155
+    public void setQualityState(Integer qualityState) {
156
+        this.qualityState = qualityState;
157
+    }
158
+
159
+    public Integer getWarehousingId() {
160
+        return warehousingId;
161
+    }
162
+
163
+    public void setWarehousingId(Integer warehousingId) {
164
+        this.warehousingId = warehousingId;
165
+    }
166
+
167
+    public Integer getwIndex() {
168
+        return wIndex;
169
+    }
170
+
171
+    public void setwIndex(Integer wIndex) {
172
+        this.wIndex = wIndex;
173
+    }
174
+
175
+    public Integer getwQuality() {
176
+        return wQuality;
177
+    }
178
+
179
+    public void setwQuality(Integer wQuality) {
180
+        this.wQuality = wQuality;
181
+    }
182
+
183
+    public Integer getwCharacter() {
184
+        return wCharacter;
185
+    }
186
+
187
+    public void setwCharacter(Integer wCharacter) {
188
+        this.wCharacter = wCharacter;
189
+    }
190
+
191
+    public Integer getToxinIndex() {
192
+        return toxinIndex;
193
+    }
194
+
195
+    public void setToxinIndex(Integer toxinIndex) {
196
+        this.toxinIndex = toxinIndex;
197
+    }
198
+
199
+    public Integer getChildrenId() {
200
+        return childrenId;
201
+    }
202
+
203
+    public void setChildrenId(Integer childrenId) {
204
+        this.childrenId = childrenId;
205
+    }
206
+}

+ 65 - 0
src/main/java/com/unissoft/quantityQuality/controller/WarehousingQualityController.java

@@ -0,0 +1,65 @@
1
+package com.unissoft.quantityQuality.controller;
2
+
3
+
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.unissoft.model.WarehousingQualityPO;
6
+import com.unissoft.model.WarehousingQualityVO;
7
+import com.unissoft.quantityQuality.service.WarehousingQualityService;
8
+import com.unissoft.result.PageParam;
9
+import com.unissoft.result.ResultView;
10
+import io.swagger.annotations.Api;
11
+import io.swagger.annotations.ApiOperation;
12
+import org.springframework.beans.factory.annotation.Autowired;
13
+import org.springframework.web.bind.annotation.*;
14
+
15
+/**
16
+ * <p>
17
+ * 入库质量表名称 前端控制器
18
+ * </p>
19
+ *
20
+ * @author root
21
+ * @since 2021-04-12
22
+ */
23
+@Api(description = "入库质量控制类")
24
+@RestController
25
+@RequestMapping("/warehousingQuality")
26
+public class WarehousingQualityController {
27
+
28
+    @Autowired
29
+    private WarehousingQualityService qualityService;
30
+
31
+    @ApiOperation(value = "分页条件查询", notes = "提交参数:{\"pageIndex\":1,\"pageSize\":10,\"condition\":\"{'depotId':'','warehouseId':'','creationTimeStart':'','creationTimeEnd':''}\"}")
32
+    @PostMapping("/authority/getPage")
33
+    public ResultView getPage(@RequestBody PageParam pageParam) {
34
+        IPage<WarehousingQualityPO> page = qualityService.getPage(pageParam);
35
+        return ResultView.success(page);
36
+    }
37
+
38
+    @ApiOperation(value = "根据id查询", notes = "")
39
+    @GetMapping("/authority/getById")
40
+    public ResultView getById(@RequestParam int id) {
41
+        WarehousingQualityPO byIdQality = qualityService.getByIdQality(id);
42
+        return ResultView.success(byIdQality);
43
+    }
44
+
45
+    @ApiOperation(value = "新增", notes = "")
46
+    @PostMapping("/authority_button/add")
47
+    public ResultView add(@RequestBody WarehousingQualityVO model) {
48
+        qualityService.saveWarehousingQuality(model);
49
+        return ResultView.success(model);
50
+    }
51
+
52
+    @ApiOperation(value = "修改", notes = "")
53
+    @PostMapping("/authority_button/update")
54
+    public ResultView update(@RequestBody WarehousingQualityVO model) {
55
+        qualityService.updateWarehousingQuality(model);
56
+        return ResultView.success(model);
57
+    }
58
+
59
+    @ApiOperation(value = "根据id删除", notes = "")
60
+    @DeleteMapping("/authority_button/deleteById")
61
+    public ResultView deleteById(@RequestParam int id) {
62
+        qualityService.deleteById(id);
63
+        return ResultView.success();
64
+    }
65
+}

+ 21 - 0
src/main/java/com/unissoft/quantityQuality/service/WarehousingQualityChildrenService.java

@@ -0,0 +1,21 @@
1
+package com.unissoft.quantityQuality.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.unissoft.model.WarehousingQualityChildren;
5
+import com.unissoft.model.WarehousingQualityVO;
6
+
7
+/**
8
+ * <p>
9
+ * 入库质量表名称字表 服务类
10
+ * </p>
11
+ *
12
+ * @author root
13
+ * @since 2021-04-12
14
+ */
15
+public interface WarehousingQualityChildrenService extends IService<WarehousingQualityChildren> {
16
+    void deleteByQualityId(int id);
17
+
18
+    void saveWarehousingQualityChildren(WarehousingQualityVO model);
19
+
20
+    void updateWarehousingQualityChildren(WarehousingQualityVO model);
21
+}

+ 30 - 0
src/main/java/com/unissoft/quantityQuality/service/WarehousingQualityService.java

@@ -0,0 +1,30 @@
1
+package com.unissoft.quantityQuality.service;
2
+
3
+import com.baomidou.mybatisplus.core.metadata.IPage;
4
+import com.baomidou.mybatisplus.extension.service.IService;
5
+import com.unissoft.model.WarehousingQuality;
6
+import com.unissoft.model.WarehousingQualityPO;
7
+import com.unissoft.model.WarehousingQualityVO;
8
+import com.unissoft.result.PageParam;
9
+
10
+/**
11
+ * <p>
12
+ * 入库质量表名称 服务类
13
+ * </p>
14
+ *
15
+ * @author root
16
+ * @since 2021-04-12
17
+ */
18
+public interface WarehousingQualityService extends IService<WarehousingQuality> {
19
+
20
+    IPage<WarehousingQualityPO> getPage(PageParam pageParam);
21
+
22
+    WarehousingQualityPO getByIdQality(int id);
23
+
24
+    void saveWarehousingQuality(WarehousingQualityVO model);
25
+
26
+    void updateWarehousingQuality(WarehousingQualityVO model);
27
+
28
+    void deleteById(int id);
29
+
30
+}

+ 45 - 0
src/main/java/com/unissoft/quantityQuality/service/impl/WarehousingQualityChildrenServiceImpl.java

@@ -0,0 +1,45 @@
1
+package com.unissoft.quantityQuality.service.impl;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5
+import com.unissoft.mapper.WarehousingQualityChildrenMapper;
6
+import com.unissoft.model.WarehousingQualityChildren;
7
+import com.unissoft.model.WarehousingQualityVO;
8
+import com.unissoft.quantityQuality.service.WarehousingQualityChildrenService;
9
+import org.springframework.beans.factory.annotation.Autowired;
10
+import org.springframework.stereotype.Service;
11
+
12
+/**
13
+ * <p>
14
+ * 入库质量表名称字表 服务实现类
15
+ * </p>
16
+ *
17
+ * @author root
18
+ * @since 2021-04-12
19
+ */
20
+@Service
21
+public class WarehousingQualityChildrenServiceImpl extends ServiceImpl<WarehousingQualityChildrenMapper, WarehousingQualityChildren> implements WarehousingQualityChildrenService {
22
+
23
+    @Autowired
24
+    private WarehousingQualityChildrenMapper qualityChildrenMapper;
25
+
26
+    @Override
27
+    public void deleteByQualityId(int id) {
28
+        QueryWrapper<WarehousingQualityChildren> qw = new QueryWrapper<>();
29
+        qw.eq("warehousing_id", id);
30
+        qualityChildrenMapper.delete(qw);
31
+    }
32
+
33
+    @Override
34
+    public void saveWarehousingQualityChildren(WarehousingQualityVO model) {
35
+        WarehousingQualityChildren qualityChildren = new WarehousingQualityChildren(model.getId(), model.getwIndex(), model.getCreationTime(), model.getCheckName(), model.getCheckType(), model.getwQuality(), model.getwCharacter(), model.getToxinIndex());
36
+        qualityChildrenMapper.insert(qualityChildren);
37
+    }
38
+
39
+    @Override
40
+    public void updateWarehousingQualityChildren(WarehousingQualityVO model) {
41
+        WarehousingQualityChildren qualityChildren = new WarehousingQualityChildren(model.getId(), model.getwIndex(), model.getCreationTime(), model.getCheckName(), model.getCheckType(), model.getwQuality(), model.getwCharacter(), model.getToxinIndex());
42
+        qualityChildren.setChildrenId(model.getChildrenId());
43
+        qualityChildrenMapper.updateById(qualityChildren);
44
+    }
45
+}

+ 117 - 0
src/main/java/com/unissoft/quantityQuality/service/impl/WarehousingQualityServiceImpl.java

@@ -0,0 +1,117 @@
1
+package com.unissoft.quantityQuality.service.impl;
2
+
3
+import com.baomidou.mybatisplus.core.metadata.IPage;
4
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
6
+import com.unissoft.MyConstant;
7
+import com.unissoft.mapper.WarehousingQualityMapper;
8
+import com.unissoft.model.WarehousingQuality;
9
+import com.unissoft.model.WarehousingQualityPO;
10
+import com.unissoft.model.WarehousingQualityVO;
11
+import com.unissoft.quantityQuality.service.WarehousingQualityChildrenService;
12
+import com.unissoft.quantityQuality.service.WarehousingQualityService;
13
+import com.unissoft.result.PageParam;
14
+import org.apache.commons.lang.StringUtils;
15
+import org.json.JSONObject;
16
+import org.springframework.beans.factory.annotation.Autowired;
17
+import org.springframework.stereotype.Service;
18
+import org.springframework.transaction.annotation.Transactional;
19
+
20
+import java.util.Date;
21
+import java.util.List;
22
+
23
+/**
24
+ * <p>
25
+ * 入库质量表名称 服务实现类
26
+ * </p>
27
+ *
28
+ * @author root
29
+ * @since 2021-04-12
30
+ */
31
+@Service
32
+public class WarehousingQualityServiceImpl extends ServiceImpl<WarehousingQualityMapper, WarehousingQuality> implements WarehousingQualityService {
33
+
34
+    @Autowired
35
+    private WarehousingQualityMapper qualityMapper;
36
+
37
+    @Autowired
38
+    private WarehousingQualityChildrenService qualityChildrenService;
39
+
40
+    @Override
41
+    public IPage<WarehousingQualityPO> getPage(PageParam pageParam) {
42
+        Integer pageIndex = pageParam.getPageIndex();
43
+        Integer pageSize = pageParam.getPageSize();
44
+        Page<WarehousingQualityPO> page = null;
45
+        if (pageIndex != MyConstant.ZERO && pageSize != MyConstant.ZERO) {
46
+            page = new Page<WarehousingQualityPO>(pageIndex, pageSize);
47
+        }
48
+        String depotId = null, warehouseId = null, creationTimeStart = null, creationTimeEnd = null;
49
+        if (StringUtils.isNotBlank(pageParam.getCondition())) {
50
+            JSONObject object = new JSONObject(pageParam.getCondition());
51
+            depotId = object.optString("depotId");
52
+            warehouseId = object.optString("warehouseId");
53
+            creationTimeStart = object.optString("creationTimeStart").trim();
54
+            creationTimeEnd = object.optString("creationTimeEnd").trim();
55
+        }
56
+
57
+        if (!StringUtils.isEmpty(creationTimeStart) && !StringUtils.isEmpty(creationTimeEnd)) {
58
+            creationTimeStart += MyConstant.STR_TIME_TWO;
59
+            creationTimeEnd += MyConstant.STR_TIME_TWO;
60
+        }
61
+        IPage<WarehousingQualityPO> page1 = qualityMapper.getPage(page, depotId, warehouseId, creationTimeStart, creationTimeEnd);
62
+        return page1;
63
+    }
64
+
65
+    @Override
66
+    public WarehousingQualityPO getByIdQality(int id) {
67
+        List<WarehousingQualityPO> byIdQality = qualityMapper.getByIdQality(id);
68
+        WarehousingQualityPO warehousingQualityPO = null;
69
+        if (byIdQality.size() > MyConstant.ZERO) {
70
+            warehousingQualityPO = byIdQality.get(MyConstant.ZERO);
71
+        }
72
+        return warehousingQualityPO;
73
+    }
74
+
75
+    @Transactional
76
+    @Override
77
+    public void saveWarehousingQuality(WarehousingQualityVO model) {
78
+        Date date = new Date();
79
+        WarehousingQuality quality = null;
80
+        //标识是否第一次新增,0代表第一次,1代表n次
81
+        if (model.getSaveType() == MyConstant.ZERO) {
82
+            quality = new WarehousingQuality(model.getDepotId(), model.getDepotName(), model.getWarehouseId(), model.getWarehouseName(), model.getCheckName(), model.getCheckType(), date, null, MyConstant.ZERO);
83
+            qualityMapper.insert(quality);
84
+        } else {
85
+            Date endTime = null;
86
+            Integer qualityState = null;
87
+            //检测类型(0:1/3,1:1/2,2:2/3,3:自验收,4:质检中心验收,5:质检中心巡检)
88
+            if (model.getCheckType() == MyConstant.FOUR) {
89
+                endTime = new Date();
90
+                qualityState = MyConstant.ONE;
91
+            }
92
+            quality = new WarehousingQuality(model.getDepotId(), model.getDepotName(), model.getWarehouseId(), model.getWarehouseName(), model.getCheckName(), model.getCheckType(), null, endTime, qualityState);
93
+            quality.setId(model.getId());
94
+            qualityMapper.updateById(quality);
95
+        }
96
+        //操作字表
97
+        model.setCreationTime(date);
98
+        model.setId(quality.getId());
99
+        qualityChildrenService.saveWarehousingQualityChildren(model);
100
+    }
101
+
102
+    @Transactional
103
+    @Override
104
+    public void updateWarehousingQuality(WarehousingQualityVO model) {
105
+        WarehousingQuality quality = new WarehousingQuality(model.getDepotId(), model.getDepotName(), model.getWarehouseId(), model.getWarehouseName(), model.getCheckName(), model.getCheckType(), null, null, null);
106
+        quality.setId(model.getId());
107
+        qualityMapper.updateById(quality);
108
+        qualityChildrenService.updateWarehousingQualityChildren(model);
109
+    }
110
+
111
+    @Transactional
112
+    @Override
113
+    public void deleteById(int id) {
114
+//        qualityMapper.deleteById(id);
115
+        qualityChildrenService.removeById(id);
116
+    }
117
+}