|
@@ -1,20 +1,19 @@
|
|
|
package com.ruoyi.project.pssr.controller;
|
|
package com.ruoyi.project.pssr.controller;
|
|
|
|
|
|
|
|
-import java.io.FileOutputStream;
|
|
|
|
|
-import java.io.IOException;
|
|
|
|
|
-import java.io.InputStream;
|
|
|
|
|
-import java.io.OutputStream;
|
|
|
|
|
-import java.util.*;
|
|
|
|
|
-
|
|
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.common.utils.file.ExcelUtils;
|
|
import com.ruoyi.common.utils.file.ExcelUtils;
|
|
|
|
|
+import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
|
|
+import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
|
|
|
|
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
|
|
|
|
+import com.ruoyi.framework.web.controller.BaseController;
|
|
|
|
|
+import com.ruoyi.framework.web.domain.AjaxResult;
|
|
|
|
|
+import com.ruoyi.framework.web.page.TableDataInfo;
|
|
|
import com.ruoyi.project.pssr.domain.TPssrApprove;
|
|
import com.ruoyi.project.pssr.domain.TPssrApprove;
|
|
|
import com.ruoyi.project.pssr.domain.TPssrOverhaulExchanger;
|
|
import com.ruoyi.project.pssr.domain.TPssrOverhaulExchanger;
|
|
|
|
|
+import com.ruoyi.project.pssr.domain.TPssrOverhaulValve;
|
|
|
import com.ruoyi.project.pssr.domain.TPssrSubcontent;
|
|
import com.ruoyi.project.pssr.domain.TPssrSubcontent;
|
|
|
-import com.ruoyi.project.pssr.service.ITPssrApproveService;
|
|
|
|
|
-import com.ruoyi.project.pssr.service.ITPssrOverhaulExchangerService;
|
|
|
|
|
-import com.ruoyi.project.pssr.service.ITPssrSubcontentService;
|
|
|
|
|
|
|
+import com.ruoyi.project.pssr.service.*;
|
|
|
import com.ruoyi.project.system.domain.SysUser;
|
|
import com.ruoyi.project.system.domain.SysUser;
|
|
|
import com.ruoyi.project.system.service.ISysUserService;
|
|
import com.ruoyi.project.system.service.ISysUserService;
|
|
|
import org.activiti.engine.HistoryService;
|
|
import org.activiti.engine.HistoryService;
|
|
@@ -26,24 +25,15 @@ import org.apache.poi.ss.usermodel.CellStyle;
|
|
|
import org.apache.poi.ss.usermodel.Row;
|
|
import org.apache.poi.ss.usermodel.Row;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
|
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
-import org.springframework.web.bind.annotation.PutMapping;
|
|
|
|
|
-import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
-import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
|
|
|
|
-import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
|
|
|
|
-import com.ruoyi.project.pssr.domain.TPssrOverhaulValve;
|
|
|
|
|
-import com.ruoyi.project.pssr.service.ITPssrOverhaulValveService;
|
|
|
|
|
-import com.ruoyi.framework.web.controller.BaseController;
|
|
|
|
|
-import com.ruoyi.framework.web.domain.AjaxResult;
|
|
|
|
|
-import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
|
|
-import com.ruoyi.framework.web.page.TableDataInfo;
|
|
|
|
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
+
|
|
|
|
|
+import java.io.FileOutputStream;
|
|
|
|
|
+import java.io.IOException;
|
|
|
|
|
+import java.io.InputStream;
|
|
|
|
|
+import java.io.OutputStream;
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 检修项目-阀门Controller
|
|
* 检修项目-阀门Controller
|
|
@@ -53,8 +43,9 @@ import com.ruoyi.framework.web.page.TableDataInfo;
|
|
|
*/
|
|
*/
|
|
|
@RestController
|
|
@RestController
|
|
|
@RequestMapping("/pssr/overhaulValve")
|
|
@RequestMapping("/pssr/overhaulValve")
|
|
|
-public class TPssrOverhaulValveController extends BaseController
|
|
|
|
|
-{
|
|
|
|
|
|
|
+public class TPssrOverhaulValveController extends BaseController {
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ITPssrFileService tPssrFileService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ITPssrOverhaulValveService tPssrOverhaulValveService;
|
|
private ITPssrOverhaulValveService tPssrOverhaulValveService;
|
|
|
|
|
|
|
@@ -152,13 +143,15 @@ public class TPssrOverhaulValveController extends BaseController
|
|
|
*/
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('pssr:overhaulValve:list')")
|
|
@PreAuthorize("@ss.hasPermi('pssr:overhaulValve:list')")
|
|
|
@GetMapping("/list")
|
|
@GetMapping("/list")
|
|
|
- public TableDataInfo list(TPssrOverhaulValve tPssrOverhaulValve)
|
|
|
|
|
- {
|
|
|
|
|
- if ("1".equals(tPssrOverhaulValve.getIdentifyingPerson())){
|
|
|
|
|
|
|
+ public TableDataInfo list(TPssrOverhaulValve tPssrOverhaulValve) {
|
|
|
|
|
+ if ("1".equals(tPssrOverhaulValve.getIdentifyingPerson())) {
|
|
|
tPssrOverhaulValve.setIdentifyingPerson(getUserId().toString());
|
|
tPssrOverhaulValve.setIdentifyingPerson(getUserId().toString());
|
|
|
}
|
|
}
|
|
|
startPage();
|
|
startPage();
|
|
|
List<TPssrOverhaulValve> list = tPssrOverhaulValveService.selectTPssrOverhaulValveList(tPssrOverhaulValve);
|
|
List<TPssrOverhaulValve> list = tPssrOverhaulValveService.selectTPssrOverhaulValveList(tPssrOverhaulValve);
|
|
|
|
|
+ list.forEach(item -> {
|
|
|
|
|
+ item.setFileList(tPssrFileService.selectTPssrFileListByItem(item.getSubId(), item.getId(), "jxxm-fm"));
|
|
|
|
|
+ });
|
|
|
return getDataTable(list);
|
|
return getDataTable(list);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -168,8 +161,7 @@ public class TPssrOverhaulValveController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('pssr:overhaulValve:export')")
|
|
@PreAuthorize("@ss.hasPermi('pssr:overhaulValve:export')")
|
|
|
@Log(title = "检修项目-阀门", businessType = BusinessType.EXPORT)
|
|
@Log(title = "检修项目-阀门", businessType = BusinessType.EXPORT)
|
|
|
@GetMapping("/export")
|
|
@GetMapping("/export")
|
|
|
- public AjaxResult export(TPssrOverhaulValve tPssrOverhaulValve)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult export(TPssrOverhaulValve tPssrOverhaulValve) {
|
|
|
List<TPssrOverhaulValve> list = tPssrOverhaulValveService.selectTPssrOverhaulValveList(tPssrOverhaulValve);
|
|
List<TPssrOverhaulValve> list = tPssrOverhaulValveService.selectTPssrOverhaulValveList(tPssrOverhaulValve);
|
|
|
return AjaxResult.success(exportTmpl(list));
|
|
return AjaxResult.success(exportTmpl(list));
|
|
|
}
|
|
}
|
|
@@ -210,7 +202,7 @@ public class TPssrOverhaulValveController extends BaseController
|
|
|
row.createCell(10);
|
|
row.createCell(10);
|
|
|
try {
|
|
try {
|
|
|
SysUser sysUser = sysUserService.selectUserById(Long.valueOf(t.getIdentifyingPerson()));
|
|
SysUser sysUser = sysUserService.selectUserById(Long.valueOf(t.getIdentifyingPerson()));
|
|
|
- String confirm1 = sysUser.getSignUrl();
|
|
|
|
|
|
|
+ String confirm1 = sysUser.getSignUrl();
|
|
|
ExcelUtils.insertPicture(wb, sheet, confirm1, row.getRowNum(), 10, 1, 1);
|
|
ExcelUtils.insertPicture(wb, sheet, confirm1, row.getRowNum(), 10, 1, 1);
|
|
|
} catch (NumberFormatException e) {
|
|
} catch (NumberFormatException e) {
|
|
|
throw new RuntimeException(e);
|
|
throw new RuntimeException(e);
|
|
@@ -240,9 +232,10 @@ public class TPssrOverhaulValveController extends BaseController
|
|
|
*/
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('pssr:overhaulValve:query')")
|
|
@PreAuthorize("@ss.hasPermi('pssr:overhaulValve:query')")
|
|
|
@GetMapping(value = "/{id}")
|
|
@GetMapping(value = "/{id}")
|
|
|
- public AjaxResult getInfo(@PathVariable("id") Long id)
|
|
|
|
|
- {
|
|
|
|
|
- return AjaxResult.success(tPssrOverhaulValveService.selectTPssrOverhaulValveById(id));
|
|
|
|
|
|
|
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
|
|
|
|
|
+ TPssrOverhaulValve item = tPssrOverhaulValveService.selectTPssrOverhaulValveById(id);
|
|
|
|
|
+ item.setFileList(tPssrFileService.selectTPssrFileListByItem(item.getSubId(), item.getId(), "jxxm-fm"));
|
|
|
|
|
+ return AjaxResult.success(item);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -251,8 +244,7 @@ public class TPssrOverhaulValveController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('pssr:overhaulValve:add')")
|
|
@PreAuthorize("@ss.hasPermi('pssr:overhaulValve:add')")
|
|
|
@Log(title = "检修项目-阀门", businessType = BusinessType.INSERT)
|
|
@Log(title = "检修项目-阀门", businessType = BusinessType.INSERT)
|
|
|
@PostMapping
|
|
@PostMapping
|
|
|
- public AjaxResult add(@RequestBody TPssrOverhaulValve tPssrOverhaulValve)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult add(@RequestBody TPssrOverhaulValve tPssrOverhaulValve) {
|
|
|
tPssrOverhaulValve.setApproveStatus(0L);
|
|
tPssrOverhaulValve.setApproveStatus(0L);
|
|
|
return toAjax(tPssrOverhaulValveService.insertTPssrOverhaulValve(tPssrOverhaulValve));
|
|
return toAjax(tPssrOverhaulValveService.insertTPssrOverhaulValve(tPssrOverhaulValve));
|
|
|
}
|
|
}
|
|
@@ -263,8 +255,8 @@ public class TPssrOverhaulValveController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('pssr:overhaulValve:edit')")
|
|
@PreAuthorize("@ss.hasPermi('pssr:overhaulValve:edit')")
|
|
|
@Log(title = "检修项目-阀门", businessType = BusinessType.UPDATE)
|
|
@Log(title = "检修项目-阀门", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping
|
|
@PutMapping
|
|
|
- public AjaxResult edit(@RequestBody TPssrOverhaulValve tPssrOverhaulValve)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult edit(@RequestBody TPssrOverhaulValve tPssrOverhaulValve) {
|
|
|
|
|
+ tPssrFileService.updateFileRelevance(tPssrOverhaulValve.getFileIds(), "jxxm-fm", tPssrOverhaulValve.getId(), tPssrOverhaulValve.getSubId());
|
|
|
return toAjax(tPssrOverhaulValveService.updateTPssrOverhaulValve(tPssrOverhaulValve));
|
|
return toAjax(tPssrOverhaulValveService.updateTPssrOverhaulValve(tPssrOverhaulValve));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -273,9 +265,8 @@ public class TPssrOverhaulValveController extends BaseController
|
|
|
*/
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('pssr:overhaulValve:remove')")
|
|
@PreAuthorize("@ss.hasPermi('pssr:overhaulValve:remove')")
|
|
|
@Log(title = "检修项目-阀门", businessType = BusinessType.DELETE)
|
|
@Log(title = "检修项目-阀门", businessType = BusinessType.DELETE)
|
|
|
- @DeleteMapping("/{ids}")
|
|
|
|
|
- public AjaxResult remove(@PathVariable Long[] ids)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
|
|
+ public AjaxResult remove(@PathVariable Long[] ids) {
|
|
|
return toAjax(tPssrOverhaulValveService.deleteTPssrOverhaulValveByIds(ids));
|
|
return toAjax(tPssrOverhaulValveService.deleteTPssrOverhaulValveByIds(ids));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -286,7 +277,7 @@ public class TPssrOverhaulValveController extends BaseController
|
|
|
if (tPssrOverhaulValve.getIds() != null && tPssrOverhaulValve.getIds().length > 0) {
|
|
if (tPssrOverhaulValve.getIds() != null && tPssrOverhaulValve.getIds().length > 0) {
|
|
|
for (Long id : tPssrOverhaulValve.getIds()) {
|
|
for (Long id : tPssrOverhaulValve.getIds()) {
|
|
|
TPssrOverhaulValve valve = tPssrOverhaulValveService.selectTPssrOverhaulValveById(id);
|
|
TPssrOverhaulValve valve = tPssrOverhaulValveService.selectTPssrOverhaulValveById(id);
|
|
|
- if (valve.getDoneDate()==null){
|
|
|
|
|
|
|
+ if (valve.getDoneDate() == null) {
|
|
|
valve.setDoneDate(new Date());
|
|
valve.setDoneDate(new Date());
|
|
|
}
|
|
}
|
|
|
valve.setApproveStatus(2L);
|
|
valve.setApproveStatus(2L);
|
|
@@ -300,7 +291,7 @@ public class TPssrOverhaulValveController extends BaseController
|
|
|
valve.setIdentifyingPerson(getUserId().toString());
|
|
valve.setIdentifyingPerson(getUserId().toString());
|
|
|
valve.setApproveStatus(1L);
|
|
valve.setApproveStatus(1L);
|
|
|
for (TPssrOverhaulValve overhaulValve : tPssrOverhaulValveService.selectTPssrOverhaulValveList(valve)) {
|
|
for (TPssrOverhaulValve overhaulValve : tPssrOverhaulValveService.selectTPssrOverhaulValveList(valve)) {
|
|
|
- if (overhaulValve.getDoneDate()==null){
|
|
|
|
|
|
|
+ if (overhaulValve.getDoneDate() == null) {
|
|
|
overhaulValve.setDoneDate(new Date());
|
|
overhaulValve.setDoneDate(new Date());
|
|
|
}
|
|
}
|
|
|
overhaulValve.setApproveStatus(2L);
|
|
overhaulValve.setApproveStatus(2L);
|
|
@@ -314,7 +305,7 @@ public class TPssrOverhaulValveController extends BaseController
|
|
|
entity.setSubId(tPssrOverhaulValve.getSubId());
|
|
entity.setSubId(tPssrOverhaulValve.getSubId());
|
|
|
entity.setApproveStatus(1L);
|
|
entity.setApproveStatus(1L);
|
|
|
TPssrOverhaulExchanger exchanger = tPssrOverhaulExchangerService.selectAllConfirmedPersonBySubId(entity);
|
|
TPssrOverhaulExchanger exchanger = tPssrOverhaulExchangerService.selectAllConfirmedPersonBySubId(entity);
|
|
|
- if (exchanger!=null) {
|
|
|
|
|
|
|
+ if (exchanger != null) {
|
|
|
String confirmedPerson = exchanger.getConfirmedPerson();
|
|
String confirmedPerson = exchanger.getConfirmedPerson();
|
|
|
logger.info("===========confirmedPerson:{}", confirmedPerson);
|
|
logger.info("===========confirmedPerson:{}", confirmedPerson);
|
|
|
//如果当前用户还有待审批任务
|
|
//如果当前用户还有待审批任务
|
|
@@ -323,10 +314,10 @@ public class TPssrOverhaulValveController extends BaseController
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
//无待审批任务结束当前用户流程
|
|
//无待审批任务结束当前用户流程
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 因为流程关系所以approve一定会有且只有一条数据
|
|
// 因为流程关系所以approve一定会有且只有一条数据
|
|
|
TPssrApprove tPssrApprove = tPssrApproveService.selectTPssrApproveBySubId(tPssrOverhaulValve.getSubId());
|
|
TPssrApprove tPssrApprove = tPssrApproveService.selectTPssrApproveBySubId(tPssrOverhaulValve.getSubId());
|
|
|
- TPssrApproveController.handleConfirmApprove(tPssrApprove,getUserId().toString());
|
|
|
|
|
|
|
+ TPssrApproveController.handleConfirmApprove(tPssrApprove, getUserId().toString());
|
|
|
return AjaxResult.success();
|
|
return AjaxResult.success();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|