|
|
@@ -1,6 +1,7 @@
|
|
1
|
1
|
package com.unissoft.ventilation.service.impl;
|
|
2
|
2
|
|
|
3
|
3
|
import com.unissoft.model.BasicsWarehouse;
|
|
|
4
|
+import com.unissoft.model.GrainConditionRecord;
|
|
4
|
5
|
import com.unissoft.model.ProcessAudit;
|
|
5
|
6
|
import com.unissoft.model.ProcessBasis;
|
|
6
|
7
|
import com.unissoft.model.ProcessBasisSon;
|
|
|
@@ -21,10 +22,13 @@ import com.unissoft.ventilation.service.ProcessBasisService;
|
|
21
|
22
|
import com.alibaba.fastjson.JSONArray;
|
|
22
|
23
|
import com.alibaba.fastjson.JSONObject;
|
|
23
|
24
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
25
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
24
|
26
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
25
|
27
|
import com.github.pagehelper.PageHelper;
|
|
26
|
28
|
import com.github.pagehelper.PageInfo;
|
|
27
|
29
|
import com.google.common.collect.Maps;
|
|
|
30
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
31
|
+
|
|
28
|
32
|
|
|
29
|
33
|
import java.util.ArrayList;
|
|
30
|
34
|
import java.util.HashMap;
|
|
|
@@ -138,11 +142,10 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
|
|
138
|
142
|
|
|
139
|
143
|
|
|
140
|
144
|
@Override
|
|
141
|
|
- public PageInfo<ProcessAudit> getPage(PageParam pageParam) throws JSONException {
|
|
|
145
|
+ public Page<ProcessAudit> getPage(PageParam pageParam) throws JSONException {
|
|
142
|
146
|
// TODO Auto-generated method stub
|
|
143
|
147
|
Integer pageIndex = pageParam.getPageIndex();
|
|
144
|
148
|
Integer pageSize = pageParam.getPageSize();
|
|
145
|
|
- // HashMap<String, Object> map = Maps.newHashMap();
|
|
146
|
149
|
QueryWrapper<ProcessAudit> ew = new QueryWrapper<>();
|
|
147
|
150
|
ew.eq("result", 1);//取第一条数据
|
|
148
|
151
|
if (!StringUtils.isEmpty(pageParam.getCondition())) {
|
|
|
@@ -169,11 +172,18 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
|
|
169
|
172
|
}
|
|
170
|
173
|
|
|
171
|
174
|
ew.orderByDesc("id");
|
|
172
|
|
- if (pageIndex != MyConstant.ZERO && pageSize != MyConstant.ZERO) {
|
|
|
175
|
+ /*if (pageIndex != MyConstant.ZERO && pageSize != MyConstant.ZERO) {
|
|
173
|
176
|
PageHelper.startPage(pageIndex, pageSize);
|
|
|
177
|
+ }*/
|
|
|
178
|
+
|
|
|
179
|
+ Page page = new Page();
|
|
|
180
|
+ if (pageIndex != MyConstant.ZERO && pageSize != MyConstant.ZERO) {
|
|
|
181
|
+ page = new Page(pageIndex, pageSize);
|
|
174
|
182
|
}
|
|
175
|
|
- List<ProcessAudit> page = processAuditMapper.selectList(ew);
|
|
176
|
|
- PageInfo<ProcessAudit> pageInfo = new PageInfo<>(page);
|
|
|
183
|
+
|
|
|
184
|
+ Page<ProcessAudit> pageInfo = processAuditMapper.selectPage(page, ew);
|
|
|
185
|
+ //PageInfo<ProcessAudit> pageInfo = (PageInfo<ProcessAudit>) processAuditMapper.selectPage(page,ew);
|
|
|
186
|
+ //PageInfo<ProcessAudit> pageInfo = new PageInfo<>(page);
|
|
177
|
187
|
return pageInfo;
|
|
178
|
188
|
}
|
|
179
|
189
|
|
|
|
@@ -222,7 +232,7 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
|
|
222
|
232
|
|
|
223
|
233
|
|
|
224
|
234
|
@Override
|
|
225
|
|
- public PageInfo<ProcessAudit> toDisposeList(PageParam pageParam) throws JSONException {
|
|
|
235
|
+ public Page<ProcessAudit> toDisposeList(PageParam pageParam) throws JSONException {
|
|
226
|
236
|
// TODO Auto-generated method stub
|
|
227
|
237
|
|
|
228
|
238
|
Integer pageIndex = pageParam.getPageIndex();
|
|
|
@@ -233,10 +243,16 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
|
|
233
|
243
|
QueryWrapper<ProcessAudit> ew = new QueryWrapper<>();
|
|
234
|
244
|
ew.eq("to_people", object.getInt("userId"));
|
|
235
|
245
|
ew.eq("audit_state", 0);//已提交
|
|
236
|
|
- List<ProcessAudit> list = processAuditMapper.selectList(ew);
|
|
|
246
|
+ //List<ProcessAudit> list = processAuditMapper.selectList(ew);
|
|
|
247
|
+ ew.orderByDesc("id");
|
|
237
|
248
|
|
|
238
|
|
- if(list.size()>0){
|
|
239
|
|
- for (ProcessAudit processAudit : list) {
|
|
|
249
|
+ Page page = new Page();
|
|
|
250
|
+ if (pageIndex != MyConstant.ZERO && pageSize != MyConstant.ZERO) {
|
|
|
251
|
+ page = new Page(pageIndex, pageSize);
|
|
|
252
|
+ }
|
|
|
253
|
+ Page<ProcessAudit> pageInfo = processAuditMapper.selectPage(page, ew);
|
|
|
254
|
+ if(pageInfo.getTotal()>0){
|
|
|
255
|
+ for (ProcessAudit processAudit : pageInfo.getRecords()) {
|
|
240
|
256
|
//根据仓房id获取仓房名称
|
|
241
|
257
|
BasicsWarehouse ware = systemFeign.getByIdHouse(processAudit.getHouseId());
|
|
242
|
258
|
if(null != ware){
|
|
|
@@ -254,12 +270,6 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
|
|
254
|
270
|
|
|
255
|
271
|
}
|
|
256
|
272
|
}
|
|
257
|
|
- ew.orderByDesc("id");
|
|
258
|
|
- if (pageIndex != MyConstant.ZERO && pageSize != MyConstant.ZERO) {
|
|
259
|
|
- PageHelper.startPage(pageIndex, pageSize);
|
|
260
|
|
- }
|
|
261
|
|
- List<ProcessAudit> page = processAuditMapper.selectList(ew);
|
|
262
|
|
- PageInfo<ProcessAudit> pageInfo = new PageInfo<>(page);
|
|
263
|
273
|
return pageInfo;
|
|
264
|
274
|
}
|
|
265
|
275
|
|
|
|
@@ -444,4 +454,84 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
|
|
444
|
454
|
return map;
|
|
445
|
455
|
}
|
|
446
|
456
|
|
|
|
457
|
+
|
|
|
458
|
+ @Override
|
|
|
459
|
+ public Page<ProcessAudit> applyList(PageParam pageParam) throws JSONException {
|
|
|
460
|
+ // TODO Auto-generated method stub
|
|
|
461
|
+
|
|
|
462
|
+ Integer pageIndex = pageParam.getPageIndex();
|
|
|
463
|
+ Integer pageSize = pageParam.getPageSize();
|
|
|
464
|
+
|
|
|
465
|
+ QueryWrapper<ProcessAudit> ew = new QueryWrapper<>();
|
|
|
466
|
+ org.json.JSONObject object = new org.json.JSONObject(pageParam.getCondition());
|
|
|
467
|
+ if(StringUtils.isNotBlank(object.optString("userId"))){
|
|
|
468
|
+ ew.eq("apply_people",object.optString("userId"));
|
|
|
469
|
+ }
|
|
|
470
|
+ ew.eq("result",1);//整个流程的第一条数据
|
|
|
471
|
+ ew.orderByDesc("id");
|
|
|
472
|
+
|
|
|
473
|
+ Page page = new Page();
|
|
|
474
|
+ if (pageIndex != MyConstant.ZERO && pageSize != MyConstant.ZERO) {
|
|
|
475
|
+ page = new Page(pageIndex, pageSize);
|
|
|
476
|
+ }
|
|
|
477
|
+
|
|
|
478
|
+ Page<ProcessAudit> pageInfo = processAuditMapper.selectPage(page, ew);
|
|
|
479
|
+
|
|
|
480
|
+
|
|
|
481
|
+ if(pageInfo.getTotal()>0){
|
|
|
482
|
+ for (ProcessAudit processAudit : pageInfo.getRecords()) {
|
|
|
483
|
+ //根据仓房id获取仓房名称
|
|
|
484
|
+ BasicsWarehouse ware = systemFeign.getByIdHouse(processAudit.getHouseId());
|
|
|
485
|
+ if(null != ware){
|
|
|
486
|
+ processAudit.setHouseName(ware.gethName());
|
|
|
487
|
+ }
|
|
|
488
|
+ //BasicsWarehouse ware = (BasicsWarehouse) resultView.getData();
|
|
|
489
|
+ //全局获取当前登录人的信息
|
|
|
490
|
+ SysUserPO currUserInfo = UserUtils.getCurrUserInfo();
|
|
|
491
|
+ //赋值
|
|
|
492
|
+ if(null != currUserInfo){
|
|
|
493
|
+ processAudit.setApplyName(currUserInfo.getuName());
|
|
|
494
|
+ processAudit.setCompanyName(currUserInfo.getCompanyName());
|
|
|
495
|
+ processAudit.setDepartmentName(currUserInfo.getDepartmentName());
|
|
|
496
|
+ }
|
|
|
497
|
+
|
|
|
498
|
+ }
|
|
|
499
|
+ }
|
|
|
500
|
+
|
|
|
501
|
+ return pageInfo;
|
|
|
502
|
+ }
|
|
|
503
|
+
|
|
|
504
|
+
|
|
|
505
|
+ @Override
|
|
|
506
|
+ public Page<ProcessAudit> completeList(PageParam pageParam) throws JSONException {
|
|
|
507
|
+ // TODO Auto-generated method stub
|
|
|
508
|
+
|
|
|
509
|
+ Integer pageIndex = pageParam.getPageIndex();
|
|
|
510
|
+ Integer pageSize = pageParam.getPageSize();
|
|
|
511
|
+
|
|
|
512
|
+
|
|
|
513
|
+ QueryWrapper<ProcessAudit> ew = new QueryWrapper<>();
|
|
|
514
|
+ org.json.JSONObject object = new org.json.JSONObject(pageParam.getCondition());
|
|
|
515
|
+ if(StringUtils.isNotBlank(object.optString("userId"))){
|
|
|
516
|
+ //如果是第一个审批人 则第一条数据中状态不为0(提交)
|
|
|
517
|
+ ew.eq("to_people",object.optString("userId"));
|
|
|
518
|
+ ew.eq("result",1);//整个流程的第一条数据
|
|
|
519
|
+ ew.ne("audit_state",0);
|
|
|
520
|
+
|
|
|
521
|
+ //第二个人审批 则 第一条数据的状态是,2:审批不通过,3:审批完成进行中
|
|
|
522
|
+ //ew.or("", consumer)
|
|
|
523
|
+ //ew.ne("result", 1);//不是第一条数据
|
|
|
524
|
+
|
|
|
525
|
+ }
|
|
|
526
|
+
|
|
|
527
|
+ ew.orderByDesc("id");
|
|
|
528
|
+ Page page = new Page();
|
|
|
529
|
+ if (pageIndex != MyConstant.ZERO && pageSize != MyConstant.ZERO) {
|
|
|
530
|
+ page = new Page(pageIndex, pageSize);
|
|
|
531
|
+ }
|
|
|
532
|
+ Page<ProcessAudit> pageInfo = processAuditMapper.selectPage(page, ew);
|
|
|
533
|
+
|
|
|
534
|
+ return pageInfo;
|
|
|
535
|
+ }
|
|
|
536
|
+
|
|
447
|
537
|
}
|