gaodd 5 年 前
コミット
ce0ce60119

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

@@ -1,16 +0,0 @@
1
-package com.unissoft.mapper;
2
-
3
-import com.unissoft.model.ProcessAudit;
4
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
-
6
-/**
7
- * <p>
8
- *  Mapper 接口
9
- * </p>
10
- *
11
- * @author My SunShine
12
- * @since 2020-12-19
13
- */
14
-public interface ProcessAuditMapper extends BaseMapper<ProcessAudit> {
15
-
16
-}

+ 0 - 31
src/main/java/com/unissoft/mapper/ProcessAuditMapper.xml

@@ -1,31 +0,0 @@
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.ProcessAuditMapper">
4
-
5
-    <!-- 通用查询映射结果 -->
6
-    <resultMap id="BaseResultMap" type="com.unissoft.model.ProcessAudit">
7
-        <id column="id" property="id" />
8
-        <result column="main_id" property="mainId" />
9
-        <result column="sub_id" property="subId" />
10
-        <result column="sub_data" property="subData" />
11
-        <result column="audit_state" property="auditState" />
12
-        <result column="operation_time" property="operationTime" />
13
-        <result column="type" property="type" />
14
-        <result column="house_id" property="houseId" />
15
-        <result column="depot_id" property="depotId" />
16
-        <result column="from_people" property="fromPeople" />
17
-        <result column="to_people" property="toPeople" />
18
-        <result column="result" property="result" />
19
-        <result column="apply_people" property="applyPeople" />
20
-        <result column="audit_time" property="auditTime" />
21
-        <result column="process_id" property="processId" />
22
-        <result column="ongoing_step" property="ongoingStep" />
23
-        <result column="apply_time" property="applyTime" />
24
-    </resultMap>
25
-
26
-    <!-- 通用查询结果列 -->
27
-    <sql id="Base_Column_List">
28
-        id, main_id, sub_id, sub_data, audit_state, operation_time, type, house_id, depot_id, from_people, to_people, result, apply_people, audit_time, process_id, ongoing_step, apply_time
29
-    </sql>
30
-
31
-</mapper>

+ 0 - 284
src/main/java/com/unissoft/model/ProcessAudit.java

@@ -1,284 +0,0 @@
1
-package com.unissoft.model;
2
-
3
-import com.baomidou.mybatisplus.annotation.TableName;
4
-import com.baomidou.mybatisplus.annotation.IdType;
5
-import com.baomidou.mybatisplus.annotation.TableId;
6
-import com.baomidou.mybatisplus.annotation.TableField;
7
-import java.io.Serializable;
8
-import io.swagger.annotations.ApiModel;
9
-import io.swagger.annotations.ApiModelProperty;
10
-
11
-/**
12
- * <p>
13
- * 
14
- * </p>
15
- *
16
- * @author My SunShine
17
- * @since 2020-12-19
18
- */
19
-@TableName("process_audit")
20
-@ApiModel(value="ProcessAudit对象", description="")
21
-public class ProcessAudit implements Serializable {
22
-
23
-    private static final long serialVersionUID = 1L;
24
-
25
-    
26
-
27
-    //业务字段
28
-    @TableField(exist = false)
29
-    private String houseName;
30
-    @TableField(exist = false)
31
-	private String applyName;
32
-    @TableField(exist = false)
33
-	private String departmentName;
34
-    @TableField(exist = false)
35
-	private String companyName;
36
-	
37
-	
38
-	
39
-	
40
-
41
-    public String getHouseName() {
42
-		return houseName;
43
-	}
44
-
45
-	public void setHouseName(String houseName) {
46
-		this.houseName = houseName;
47
-	}
48
-
49
-	public String getApplyName() {
50
-		return applyName;
51
-	}
52
-
53
-	public void setApplyName(String applyName) {
54
-		this.applyName = applyName;
55
-	}
56
-
57
-	public String getDepartmentName() {
58
-		return departmentName;
59
-	}
60
-
61
-	public void setDepartmentName(String departmentName) {
62
-		this.departmentName = departmentName;
63
-	}
64
-
65
-	public String getCompanyName() {
66
-		return companyName;
67
-	}
68
-
69
-	public void setCompanyName(String companyName) {
70
-		this.companyName = companyName;
71
-	}
72
-	
73
-	
74
-    @ApiModelProperty(value = "流程审批表")
75
-    @TableId(value = "id", type = IdType.AUTO)
76
-    private Integer id;
77
-
78
-    @ApiModelProperty(value = "主流程id")
79
-    @TableField("main_id")
80
-    private Integer mainId;
81
-
82
-    @ApiModelProperty(value = "子流程的id")
83
-    @TableField("sub_id")
84
-    private Integer subId;
85
-
86
-    @ApiModelProperty(value = "子流程的数据(1:是,0:否)")
87
-    @TableField("sub_data")
88
-    private Integer subData;
89
-
90
-    @ApiModelProperty(value = "审批状态(0:提交,1审批通过:,2:审批不通过,3:审批完成进行中,4已完成)")
91
-    @TableField("audit_state")
92
-    private Integer auditState;
93
-
94
-    @ApiModelProperty(value = "子流程的操作时间")
95
-    @TableField("operation_time")
96
-    private String operationTime;
97
-
98
-    @ApiModelProperty(value = "流程类型(如:tf)")
99
-    @TableField("type")
100
-    private String type;
101
-
102
-    @ApiModelProperty(value = "仓房id")
103
-    @TableField("house_id")
104
-    private Integer houseId;
105
-
106
-    @ApiModelProperty(value = "库id")
107
-    @TableField("depot_id")
108
-    private Integer depotId;
109
-
110
-    @ApiModelProperty(value = "提交人")
111
-    @TableField("from_people")
112
-    private Integer fromPeople;
113
-
114
-    @ApiModelProperty(value = "审批人")
115
-    @TableField("to_people")
116
-    private Integer toPeople;
117
-
118
-    @ApiModelProperty(value = "是否是整个业务的首条记录(1是0否)")
119
-    @TableField("result")
120
-    private Integer result;
121
-
122
-    @ApiModelProperty(value = "申请人")
123
-    @TableField("apply_people")
124
-    private Integer applyPeople;
125
-
126
-    @ApiModelProperty(value = "审批时间")
127
-    @TableField("audit_time")
128
-    private String auditTime;
129
-
130
-    @ApiModelProperty(value = "每一个业务流程的流程标识")
131
-    @TableField("process_id")
132
-    private String processId;
133
-
134
-    @ApiModelProperty(value = "进行到哪一步的主流程id")
135
-    @TableField("ongoing_step")
136
-    private String ongoingStep;
137
-
138
-    @ApiModelProperty(value = "申请时间")
139
-    @TableField("apply_time")
140
-    private String applyTime;
141
-
142
-    public Integer getId() {
143
-        return id;
144
-    }
145
-
146
-    public void setId(Integer id) {
147
-        this.id = id;
148
-    }
149
-    public Integer getMainId() {
150
-        return mainId;
151
-    }
152
-
153
-    public void setMainId(Integer mainId) {
154
-        this.mainId = mainId;
155
-    }
156
-    public Integer getSubId() {
157
-        return subId;
158
-    }
159
-
160
-    public void setSubId(Integer subId) {
161
-        this.subId = subId;
162
-    }
163
-    public Integer getSubData() {
164
-        return subData;
165
-    }
166
-
167
-    public void setSubData(Integer subData) {
168
-        this.subData = subData;
169
-    }
170
-    public Integer getAuditState() {
171
-        return auditState;
172
-    }
173
-
174
-    public void setAuditState(Integer auditState) {
175
-        this.auditState = auditState;
176
-    }
177
-    public String getOperationTime() {
178
-        return operationTime;
179
-    }
180
-
181
-    public void setOperationTime(String operationTime) {
182
-        this.operationTime = operationTime;
183
-    }
184
-    public String getType() {
185
-        return type;
186
-    }
187
-
188
-    public void setType(String type) {
189
-        this.type = type;
190
-    }
191
-    public Integer getHouseId() {
192
-        return houseId;
193
-    }
194
-
195
-    public void setHouseId(Integer houseId) {
196
-        this.houseId = houseId;
197
-    }
198
-    public Integer getDepotId() {
199
-        return depotId;
200
-    }
201
-
202
-    public void setDepotId(Integer depotId) {
203
-        this.depotId = depotId;
204
-    }
205
-    public Integer getFromPeople() {
206
-        return fromPeople;
207
-    }
208
-
209
-    public void setFromPeople(Integer fromPeople) {
210
-        this.fromPeople = fromPeople;
211
-    }
212
-    public Integer getToPeople() {
213
-        return toPeople;
214
-    }
215
-
216
-    public void setToPeople(Integer toPeople) {
217
-        this.toPeople = toPeople;
218
-    }
219
-    public Integer getResult() {
220
-        return result;
221
-    }
222
-
223
-    public void setResult(Integer result) {
224
-        this.result = result;
225
-    }
226
-    public Integer getApplyPeople() {
227
-        return applyPeople;
228
-    }
229
-
230
-    public void setApplyPeople(Integer applyPeople) {
231
-        this.applyPeople = applyPeople;
232
-    }
233
-    public String getAuditTime() {
234
-        return auditTime;
235
-    }
236
-
237
-    public void setAuditTime(String auditTime) {
238
-        this.auditTime = auditTime;
239
-    }
240
-    public String getProcessId() {
241
-        return processId;
242
-    }
243
-
244
-    public void setProcessId(String processId) {
245
-        this.processId = processId;
246
-    }
247
-    public String getOngoingStep() {
248
-        return ongoingStep;
249
-    }
250
-
251
-    public void setOngoingStep(String ongoingStep) {
252
-        this.ongoingStep = ongoingStep;
253
-    }
254
-    public String getApplyTime() {
255
-        return applyTime;
256
-    }
257
-
258
-    public void setApplyTime(String applyTime) {
259
-        this.applyTime = applyTime;
260
-    }
261
-
262
-    @Override
263
-    public String toString() {
264
-        return "ProcessAudit{" +
265
-            "id=" + id +
266
-            ", mainId=" + mainId +
267
-            ", subId=" + subId +
268
-            ", subData=" + subData +
269
-            ", auditState=" + auditState +
270
-            ", operationTime=" + operationTime +
271
-            ", type=" + type +
272
-            ", houseId=" + houseId +
273
-            ", depotId=" + depotId +
274
-            ", fromPeople=" + fromPeople +
275
-            ", toPeople=" + toPeople +
276
-            ", result=" + result +
277
-            ", applyPeople=" + applyPeople +
278
-            ", auditTime=" + auditTime +
279
-            ", processId=" + processId +
280
-            ", ongoingStep=" + ongoingStep +
281
-            ", applyTime=" + applyTime +
282
-        "}";
283
-    }
284
-}

+ 35 - 0
src/main/java/com/unissoft/ventilation/controller/ProcessAuditController.java

@@ -2,6 +2,7 @@ package com.unissoft.ventilation.controller;
2 2
 
3 3
 
4 4
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5
+import com.unissoft.dto.ProcessToBeDone;
5 6
 import com.unissoft.model.ProcessAudit;
6 7
 import com.unissoft.result.PageParam;
7 8
 import com.unissoft.result.ResultView;
@@ -147,4 +148,38 @@ public class ProcessAuditController {
147 148
         return ResultView.success(page);
148 149
     }
149 150
     
151
+    /**
152
+     * 粮情生成待办事项
153
+     */
154
+    @ApiOperation(value = "粮情生成待办事项", notes = "")
155
+    @PostMapping("/toBeDone")
156
+    public void toBeDone(@RequestBody ProcessToBeDone processToBeDone) {
157
+		processAuditService.toBeDone(processToBeDone);
158
+    }
159
+    
160
+    
161
+    /**
162
+     * 根据待办id,将流程设成已办
163
+       同时要存储具体办理时的时间,因为要计算该流程办理的周期(或计算逾期时间)
164
+     * @param id
165
+     */
166
+    @ApiOperation(value = "根据待办id,将流程设成已办", notes = "")
167
+    @GetMapping("/haveDone/{id}")
168
+    public void haveDone(@PathVariable Integer id) {
169
+    	 processAuditService.haveDone(id);
170
+    }
171
+    
172
+    
173
+    /**
174
+     * 根据用户id、流程类型(如科长每2周粮情检查的类型:xxxx1),按时间倒序查出待办流程,将最近日期的流程设成已办
175
+       同时要存储具体办理时的时间,因为要计算该流程办理的周期(或计算逾期时间)
176
+     * @param id
177
+     */
178
+    @ApiOperation(value = "根据待办id,将流程设成已办", notes = "")
179
+    @GetMapping("/haveDone/{userId}/{type}/{depotId}/{houseId}")
180
+    public void haveDone(@PathVariable Integer userId, @PathVariable String type, @PathVariable Integer depotId, @PathVariable Integer houseId) {
181
+    	 processAuditService.haveDone(userId,type,depotId,houseId);
182
+    }
183
+    
184
+	
150 185
 }

+ 7 - 0
src/main/java/com/unissoft/ventilation/service/ProcessAuditService.java

@@ -1,5 +1,6 @@
1 1
 package com.unissoft.ventilation.service;
2 2
 
3
+import com.unissoft.dto.ProcessToBeDone;
3 4
 import com.unissoft.model.ProcessAudit;
4 5
 import com.unissoft.result.PageParam;
5 6
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -42,4 +43,10 @@ public interface ProcessAuditService extends IService<ProcessAudit> {
42 43
 
43 44
 	Page<ProcessAudit> completeList(PageParam pageParam) throws JSONException;
44 45
 
46
+	void toBeDone(ProcessToBeDone processToBeDone);
47
+
48
+	void haveDone(Integer id);
49
+
50
+	void haveDone(Integer userId, String type, Integer depotId, Integer houseId);
51
+
45 52
 }

+ 80 - 1
src/main/java/com/unissoft/ventilation/service/impl/ProcessAuditServiceImpl.java

@@ -10,6 +10,7 @@ import com.unissoft.model.SysUserPO;
10 10
 import com.unissoft.result.PageParam;
11 11
 import com.unissoft.utils.UserUtils;
12 12
 import com.unissoft.MyConstant;
13
+import com.unissoft.dto.ProcessToBeDone;
13 14
 import com.unissoft.feign.SystemFeign;
14 15
 import com.unissoft.mapper.ProcessAuditMapper;
15 16
 import com.unissoft.mapper.ProcessBasisMapper;
@@ -25,8 +26,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
25 26
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
26 27
 import com.google.common.collect.Maps;
27 28
 
28
-
29
+import java.text.SimpleDateFormat;
29 30
 import java.util.ArrayList;
31
+import java.util.Date;
30 32
 import java.util.HashMap;
31 33
 import java.util.List;
32 34
 import java.util.Map;
@@ -124,6 +126,10 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
124 126
 			processAudit.setApplyTime(applyTime);
125 127
 			processAudit.setAuditState(0);//已提交
126 128
 			processAudit.setOngoingStep(ongoingStep);
129
+			if(type.equals("tf")){
130
+				processAudit.setWorkName("机械通风申请");
131
+			}
132
+			
127 133
 			if(i==0){
128 134
 				processAudit.setResult(1);//第一条数据 保存并审批  1是0否
129 135
 				processAudit.setProcessId(UUID.randomUUID().toString());//唯一的流程标识
@@ -587,4 +593,77 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
587 593
 		return pageInfo;
588 594
 	}
589 595
 
596
+
597
+	@Override
598
+	public void toBeDone(ProcessToBeDone processToBeDone) {
599
+		// TODO Auto-generated method stub
600
+		ProcessAudit processAudit = new ProcessAudit();
601
+		if(null != processToBeDone){
602
+			processAudit.setResult(1);//是首条记录
603
+			processAudit.setAuditState(0);//提交待审批
604
+	        // 获得SimpleDateFormat类
605
+	        SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
606
+			processAudit.setApplyTime(sf.format(new Date()));//申请时间
607
+			
608
+			if(null != processToBeDone.getHouseId()){//仓id
609
+				processAudit.setHouseId(processToBeDone.getHouseId());
610
+			}
611
+			if(null != processToBeDone.getDepotId()){//库id
612
+				processAudit.setDepotId(processToBeDone.getDepotId());
613
+			}
614
+			if(null != processToBeDone.getType()){//类型(例如:tf)
615
+				processAudit.setType(processToBeDone.getType());
616
+			}
617
+			if(null != processToBeDone.getUserId()){//待办人员ID
618
+				processAudit.setToPeople(processToBeDone.getUserId());
619
+			}
620
+			if(null != processToBeDone.getTitle()){//流程名称,如 科长每2周粮情检查
621
+				processAudit.setWorkName(processToBeDone.getTitle());
622
+			}
623
+			if(null != processToBeDone.getStartDate()){//办理开始时间
624
+				processAudit.setStartDate(processToBeDone.getStartDate());
625
+			}
626
+			if(null != processToBeDone.getEndDate()){//办理结束时间
627
+				processAudit.setEndDate(processToBeDone.getEndDate());
628
+			}
629
+			if(null != processToBeDone.getToPage()){//办理页面url
630
+				processAudit.setToPage(processToBeDone.getToPage());
631
+			}
632
+			processAuditMapper.insert(processAudit);
633
+		}
634
+	}
635
+
636
+
637
+	@Override
638
+	public void haveDone(Integer id) {
639
+		// TODO Auto-generated method stub
640
+		ProcessAudit processAudit = processAuditMapper.selectById(id);
641
+		processAudit.setAuditState(1);
642
+		 // 获得SimpleDateFormat类
643
+        SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
644
+		processAudit.setOperationTime(sf.format(new Date()));//具体办理时的时间
645
+		processAuditMapper.updateById(processAudit);
646
+	}
647
+
648
+
649
+	@Override
650
+	public void haveDone(Integer userId, String type, Integer depotId, Integer houseId) {
651
+		// TODO Auto-generated method stub
652
+		//根据用户id、流程类型(如科长每2周粮情检查的类型:xxxx1),按时间倒序查出待办流程,将最近日期的流程设成已办
653
+		//同时要存储具体办理时的时间,因为要计算该流程办理的周期(或计算逾期时间)
654
+		QueryWrapper<ProcessAudit> ew = new QueryWrapper<>();
655
+		ew.eq("to_people",userId);
656
+		ew.eq("type",type);
657
+		ew.eq("depot_id",depotId);
658
+		ew.eq("house_id",houseId);
659
+		ew.orderByDesc("start_date");//根据时间倒叙
660
+		List<ProcessAudit> auditList  = processAuditMapper.selectList(ew);
661
+		auditList.get(0).setAuditState(1);//设置为已办
662
+		 // 获得SimpleDateFormat类
663
+        SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
664
+        auditList.get(0).setOperationTime(sf.format(new Date()));//具体办理时的时间
665
+        processAuditMapper.updateById(auditList.get(0));
666
+		
667
+	}
668
+
590 669
 }