|
@@ -1,5 +1,6 @@
|
|
|
package org.springblade.business.controller;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
@@ -20,6 +21,8 @@ import org.springblade.business.feign.MessageWarningClient;
|
|
|
import org.springblade.business.feign.OperationLogClient;
|
|
|
import org.springblade.business.feign.TaskClient;
|
|
|
import org.springblade.business.service.IContractLogWbsService;
|
|
|
+import org.springblade.business.service.ITaskService;
|
|
|
+import org.springblade.business.socket.WebSocket;
|
|
|
import org.springblade.business.utils.FileUtils;
|
|
|
import org.springblade.business.utils.YearTreeUtils;
|
|
|
import org.springblade.business.vo.*;
|
|
@@ -29,6 +32,7 @@ import org.springblade.core.oss.model.BladeFile;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
+import org.springblade.core.tool.utils.ObjectUtil;
|
|
|
import org.springblade.manager.entity.ContractInfo;
|
|
|
import org.springblade.manager.entity.ProjectInfo;
|
|
|
import org.springblade.manager.feign.ContractClient;
|
|
@@ -41,7 +45,9 @@ import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springblade.business.service.IContractLogService;
|
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
|
+import springfox.documentation.spring.web.json.Json;
|
|
|
|
|
|
+import java.io.IOException;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -57,144 +63,148 @@ import java.util.stream.Collectors;
|
|
|
@Api(value = "日志通用表", tags = "日志通用表接口")
|
|
|
public class ContractLogController extends BladeController {
|
|
|
|
|
|
- private final IContractLogService contractLogService;
|
|
|
-
|
|
|
- private final IContractLogWbsService contractLogWbsService;
|
|
|
-
|
|
|
- private final WbsTreeContractClient wbsTreeContractClient;
|
|
|
-
|
|
|
- private final TaskClient taskClient;
|
|
|
-
|
|
|
- private final OperationLogClient operationLogClient;
|
|
|
-
|
|
|
- private final MessageWarningClient messageWarningClient;
|
|
|
-
|
|
|
- private final NewIOSSClient newIOSSClient;
|
|
|
-
|
|
|
- private final ContractClient contractClient;
|
|
|
-
|
|
|
- private final ProjectClient projectClient;
|
|
|
-
|
|
|
- /**
|
|
|
- * 获取填报记录
|
|
|
- */
|
|
|
- @GetMapping("/queryLogList")
|
|
|
- @ApiOperationSupport(order = 19)
|
|
|
- @ApiOperation(value = "获取填报记录")
|
|
|
- @ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "contractId", value = "合同段ID"),
|
|
|
- @ApiImplicitParam(name = "nodePrimaryKeyId", value = "左侧填报日志节点primaryKeyId"),
|
|
|
- @ApiImplicitParam(name = "time", value = "所选的时间,格式为yyyy-MM-dd、yyyy-MM、yyyy")
|
|
|
- })
|
|
|
- public R<List<ContractLog>> queryLogByContractIdAndNodePrimaryKeyId(@RequestParam String contractId, @RequestParam String nodePrimaryKeyId, @RequestParam String time){
|
|
|
- return R.data(this.contractLogService.list(Wrappers.<ContractLog>lambdaQuery().eq(ContractLog::getContractId, contractId).eq(ContractLog::getWbsNodeId, nodePrimaryKeyId).like(ContractLog::getRecordTime, time)));
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 获取当前合同段下本日志节点的填报资料日期树
|
|
|
- */
|
|
|
- @GetMapping("/queryReportLogTimeTree")
|
|
|
- @ApiOperationSupport(order = 18)
|
|
|
- @ApiOperation(value = "获取当前合同段下本日志节点的填报资料日期树")
|
|
|
- @ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "contractId", value = "合同段ID"),
|
|
|
- @ApiImplicitParam(name = "nodePrimaryKeyId", value = "左侧填报的日志节点primaryKeyId")
|
|
|
- })
|
|
|
- public R<List<TreeVo>> queryReportLogTimeTree(@RequestParam String contractId, @RequestParam String nodePrimaryKeyId){
|
|
|
- //获取填报时间
|
|
|
- List<String> recordTimeList = this.contractLogService.queryReportLogTimeTree(contractId, nodePrimaryKeyId);
|
|
|
- //转成结构树
|
|
|
- return R.data(YearTreeUtils.yearMonthDayTree(recordTimeList, "ASC"));
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 删除日志
|
|
|
- */
|
|
|
- @PostMapping("/removeByIds")
|
|
|
- @ApiOperationSupport(order = 12)
|
|
|
- @ApiOperation(value = "删除日志")
|
|
|
- @ApiImplicitParam(name = "ids", value = "删除的数据ID", required = true)
|
|
|
- public R<Boolean> removeByIds(@RequestBody JSONObject json){
|
|
|
- if(json.containsKey("ids")){
|
|
|
- Object ids = json.get("ids");
|
|
|
- List<Long> idList;
|
|
|
- if(ids instanceof List){
|
|
|
- //如果是集合,按集合处理
|
|
|
- idList = JSONArray.parseArray(JSONObject.toJSONString(ids), Long.class);
|
|
|
- } else {
|
|
|
- //否则均按字符串处理
|
|
|
- idList = Func.toLongList(ids.toString());
|
|
|
- }
|
|
|
-
|
|
|
- return R.status(this.contractLogService.deleteLogic(idList));
|
|
|
- }
|
|
|
- return R.data(300, false, "未找到具体数据");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 单个废除(填报页)
|
|
|
- */
|
|
|
- @GetMapping("/oneAbolish")
|
|
|
- @ApiOperationSupport(order = 11)
|
|
|
- @ApiOperation(value = " 单个废除(填报页)")
|
|
|
- @ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true),
|
|
|
- @ApiImplicitParam(name = "nodePrimaryKeyId", value = "当前操作的日志类型ID,即左侧列表的节点primaryKeyId", required = true),
|
|
|
- @ApiImplicitParam(name = "recordTime", value = "当前选择的填写日期,即右侧日期控件所选日期,格式为 yyyy-MM-dd", required = true)
|
|
|
- })
|
|
|
- public R<Boolean> oneAbolish(@RequestParam String nodePrimaryKeyId, @RequestParam String recordTime, @RequestParam String contractId){
|
|
|
- //查询数据
|
|
|
- ContractLog log = this.contractLogService.getOne(Wrappers.<ContractLog>lambdaQuery().eq(ContractLog::getWbsNodeId, nodePrimaryKeyId)
|
|
|
- .eq(ContractLog::getCreateUser, AuthUtil.getUserId())
|
|
|
- .eq(ContractLog::getRecordTime, recordTime)
|
|
|
- .eq(ContractLog::getContractId, contractId));
|
|
|
- if(log != null){
|
|
|
- //调用批量废除接口
|
|
|
- return this.batchAbolish(log.getId().toString());
|
|
|
- }
|
|
|
- return R.data(300, false, "废除失败");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 获取当前资料的任务状态
|
|
|
- */
|
|
|
- @GetMapping("/checkTheLogTaskStatus")
|
|
|
- @ApiOperationSupport(order = 10)
|
|
|
- @ApiOperation(value = "获取当前资料的任务状态")
|
|
|
- @ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true),
|
|
|
- @ApiImplicitParam(name = "nodePrimaryKeyId", value = "当前操作的日志类型ID,即左侧列表的节点primaryKeyId", required = true),
|
|
|
- @ApiImplicitParam(name = "recordTime", value = "当前选择的填写日期,即右侧日期控件所选日期,格式为 yyyy-MM-dd", required = true)
|
|
|
- })
|
|
|
- public R<Integer> checkTheLogTaskStatus(@RequestParam String nodePrimaryKeyId, @RequestParam String recordTime, @RequestParam String contractId){
|
|
|
- ContractLog log = this.contractLogService.getOne(Wrappers.<ContractLog>lambdaQuery()
|
|
|
- .eq(ContractLog::getWbsNodeId, nodePrimaryKeyId)
|
|
|
- .eq(ContractLog::getContractId, contractId)
|
|
|
- .eq(ContractLog::getRecordTime, recordTime)
|
|
|
- .eq(ContractLog::getCreateUser, AuthUtil.getUserId()));
|
|
|
- //默认未上报
|
|
|
- int status = 1;
|
|
|
-
|
|
|
- if(log != null){
|
|
|
- switch (log.getStatus()){
|
|
|
- case 0:
|
|
|
- case 3:
|
|
|
- //已填报未上报 或 已填报已废除
|
|
|
- status = 2;
|
|
|
- break;
|
|
|
- case 1:
|
|
|
- //待审批
|
|
|
- status = 3;
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- //已审批
|
|
|
- status = 4;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return R.data(status);
|
|
|
- }
|
|
|
+ private final IContractLogService contractLogService;
|
|
|
+
|
|
|
+ private final IContractLogWbsService contractLogWbsService;
|
|
|
+
|
|
|
+ private final WbsTreeContractClient wbsTreeContractClient;
|
|
|
+
|
|
|
+ private final TaskClient taskClient;
|
|
|
+
|
|
|
+ private final OperationLogClient operationLogClient;
|
|
|
+
|
|
|
+ private final MessageWarningClient messageWarningClient;
|
|
|
+
|
|
|
+ private final NewIOSSClient newIOSSClient;
|
|
|
+
|
|
|
+ private final ContractClient contractClient;
|
|
|
+
|
|
|
+ private final ProjectClient projectClient;
|
|
|
+
|
|
|
+ private final ITaskService iTaskService;
|
|
|
+
|
|
|
+ private final WebSocket webSocket;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取填报记录
|
|
|
+ */
|
|
|
+ @GetMapping("/queryLogList")
|
|
|
+ @ApiOperationSupport(order = 19)
|
|
|
+ @ApiOperation(value = "获取填报记录")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "contractId", value = "合同段ID"),
|
|
|
+ @ApiImplicitParam(name = "nodePrimaryKeyId", value = "左侧填报日志节点primaryKeyId"),
|
|
|
+ @ApiImplicitParam(name = "time", value = "所选的时间,格式为yyyy-MM-dd、yyyy-MM、yyyy")
|
|
|
+ })
|
|
|
+ public R<List<ContractLog>> queryLogByContractIdAndNodePrimaryKeyId(@RequestParam String contractId, @RequestParam String nodePrimaryKeyId, @RequestParam String time) {
|
|
|
+ return R.data(this.contractLogService.list(Wrappers.<ContractLog>lambdaQuery().eq(ContractLog::getContractId, contractId).eq(ContractLog::getWbsNodeId, nodePrimaryKeyId).like(ContractLog::getRecordTime, time)));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取当前合同段下本日志节点的填报资料日期树
|
|
|
+ */
|
|
|
+ @GetMapping("/queryReportLogTimeTree")
|
|
|
+ @ApiOperationSupport(order = 18)
|
|
|
+ @ApiOperation(value = "获取当前合同段下本日志节点的填报资料日期树")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "contractId", value = "合同段ID"),
|
|
|
+ @ApiImplicitParam(name = "nodePrimaryKeyId", value = "左侧填报的日志节点primaryKeyId")
|
|
|
+ })
|
|
|
+ public R<List<TreeVo>> queryReportLogTimeTree(@RequestParam String contractId, @RequestParam String nodePrimaryKeyId) {
|
|
|
+ //获取填报时间
|
|
|
+ List<String> recordTimeList = this.contractLogService.queryReportLogTimeTree(contractId, nodePrimaryKeyId);
|
|
|
+ //转成结构树
|
|
|
+ return R.data(YearTreeUtils.yearMonthDayTree(recordTimeList, "ASC"));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除日志
|
|
|
+ */
|
|
|
+ @PostMapping("/removeByIds")
|
|
|
+ @ApiOperationSupport(order = 12)
|
|
|
+ @ApiOperation(value = "删除日志")
|
|
|
+ @ApiImplicitParam(name = "ids", value = "删除的数据ID", required = true)
|
|
|
+ public R<Boolean> removeByIds(@RequestBody JSONObject json) {
|
|
|
+ if (json.containsKey("ids")) {
|
|
|
+ Object ids = json.get("ids");
|
|
|
+ List<Long> idList;
|
|
|
+ if (ids instanceof List) {
|
|
|
+ //如果是集合,按集合处理
|
|
|
+ idList = JSONArray.parseArray(JSONObject.toJSONString(ids), Long.class);
|
|
|
+ } else {
|
|
|
+ //否则均按字符串处理
|
|
|
+ idList = Func.toLongList(ids.toString());
|
|
|
+ }
|
|
|
+
|
|
|
+ return R.status(this.contractLogService.deleteLogic(idList));
|
|
|
+ }
|
|
|
+ return R.data(300, false, "未找到具体数据");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 单个废除(填报页)
|
|
|
+ */
|
|
|
+ @GetMapping("/oneAbolish")
|
|
|
+ @ApiOperationSupport(order = 11)
|
|
|
+ @ApiOperation(value = " 单个废除(填报页)")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true),
|
|
|
+ @ApiImplicitParam(name = "nodePrimaryKeyId", value = "当前操作的日志类型ID,即左侧列表的节点primaryKeyId", required = true),
|
|
|
+ @ApiImplicitParam(name = "recordTime", value = "当前选择的填写日期,即右侧日期控件所选日期,格式为 yyyy-MM-dd", required = true)
|
|
|
+ })
|
|
|
+ public R<Boolean> oneAbolish(@RequestParam String nodePrimaryKeyId, @RequestParam String recordTime, @RequestParam String contractId) throws IOException {
|
|
|
+ //查询数据
|
|
|
+ ContractLog log = this.contractLogService.getOne(Wrappers.<ContractLog>lambdaQuery().eq(ContractLog::getWbsNodeId, nodePrimaryKeyId)
|
|
|
+ .eq(ContractLog::getCreateUser, AuthUtil.getUserId())
|
|
|
+ .eq(ContractLog::getRecordTime, recordTime)
|
|
|
+ .eq(ContractLog::getContractId, contractId));
|
|
|
+ if (log != null) {
|
|
|
+ //调用批量废除接口
|
|
|
+ return this.batchAbolish(log.getId().toString());
|
|
|
+ }
|
|
|
+ return R.data(300, false, "废除失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取当前资料的任务状态
|
|
|
+ */
|
|
|
+ @GetMapping("/checkTheLogTaskStatus")
|
|
|
+ @ApiOperationSupport(order = 10)
|
|
|
+ @ApiOperation(value = "获取当前资料的任务状态")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true),
|
|
|
+ @ApiImplicitParam(name = "nodePrimaryKeyId", value = "当前操作的日志类型ID,即左侧列表的节点primaryKeyId", required = true),
|
|
|
+ @ApiImplicitParam(name = "recordTime", value = "当前选择的填写日期,即右侧日期控件所选日期,格式为 yyyy-MM-dd", required = true)
|
|
|
+ })
|
|
|
+ public R<Integer> checkTheLogTaskStatus(@RequestParam String nodePrimaryKeyId, @RequestParam String recordTime, @RequestParam String contractId) {
|
|
|
+ ContractLog log = this.contractLogService.getOne(Wrappers.<ContractLog>lambdaQuery()
|
|
|
+ .eq(ContractLog::getWbsNodeId, nodePrimaryKeyId)
|
|
|
+ .eq(ContractLog::getContractId, contractId)
|
|
|
+ .eq(ContractLog::getRecordTime, recordTime)
|
|
|
+ .eq(ContractLog::getCreateUser, AuthUtil.getUserId()));
|
|
|
+ //默认未上报
|
|
|
+ int status = 1;
|
|
|
+
|
|
|
+ if (log != null) {
|
|
|
+ switch (log.getStatus()) {
|
|
|
+ case 0:
|
|
|
+ case 3:
|
|
|
+ //已填报未上报 或 已填报已废除
|
|
|
+ status = 2;
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ //待审批
|
|
|
+ status = 3;
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ //已审批
|
|
|
+ status = 4;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return R.data(status);
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 日志上报(填报页)
|
|
@@ -202,253 +212,255 @@ public class ContractLogController extends BladeController {
|
|
|
@PostMapping("/startTaskTheLog")
|
|
|
@ApiOperationSupport(order = 9)
|
|
|
@ApiOperation(value = "日志上报(填报页)")
|
|
|
- @ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "startTaskVO", value = "流程参数", required = true),
|
|
|
- @ApiImplicitParam(name = "nodePrimaryKeyId", value = "当前操作的日志类型ID,即左侧列表的节点primaryKeyId", required = true),
|
|
|
- @ApiImplicitParam(name = "recordTime", value = "当前选择的填写日期,即右侧日期控件所选日期,格式为 yyyy-MM-dd", required = true)
|
|
|
- })
|
|
|
- public R<Boolean> startTaskTheLog(@RequestBody JSONObject json){
|
|
|
-
|
|
|
- if(json != null){
|
|
|
- StartTaskVO startTaskVO = JSONObject.parseObject(JSONObject.toJSONString(json), StartTaskVO.class);
|
|
|
-
|
|
|
- String nodePrimaryKeyId = "", recordTime = "";
|
|
|
- if(json.containsKey("nodePrimaryKeyId")){
|
|
|
- nodePrimaryKeyId = json.getString("nodePrimaryKeyId");
|
|
|
- }
|
|
|
- if(json.containsKey("recordTime")){
|
|
|
- recordTime = json.getString("recordTime");
|
|
|
- }
|
|
|
-
|
|
|
- if(StringUtils.isEmpty(startTaskVO.getIds())){
|
|
|
- if(StringUtils.isEmpty(nodePrimaryKeyId) && StringUtils.isEmpty(recordTime)){
|
|
|
- return R.fail("未找到业务数据");
|
|
|
- }
|
|
|
- //如果ids为空,说明是填报页上报,那么需要根据 nodePrimaryKeyId 和 recordTime 获取当前用户的填写记录
|
|
|
- ContractLog log = this.contractLogService.getOne(Wrappers.<ContractLog>lambdaQuery().eq(ContractLog::getWbsNodeId, nodePrimaryKeyId)
|
|
|
- .eq(ContractLog::getRecordTime, recordTime).eq(ContractLog::getContractId, startTaskVO.getContractId())
|
|
|
- .eq(ContractLog::getCreateUser, AuthUtil.getUserId()));
|
|
|
- if(log == null){
|
|
|
- return R.fail("未找到业务数据");
|
|
|
- }
|
|
|
- startTaskVO.setIds(String.valueOf(log.getId()));
|
|
|
- }
|
|
|
- return this.batchTask(startTaskVO);
|
|
|
-
|
|
|
- }
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "startTaskVO", value = "流程参数", required = true),
|
|
|
+ @ApiImplicitParam(name = "nodePrimaryKeyId", value = "当前操作的日志类型ID,即左侧列表的节点primaryKeyId", required = true),
|
|
|
+ @ApiImplicitParam(name = "recordTime", value = "当前选择的填写日期,即右侧日期控件所选日期,格式为 yyyy-MM-dd", required = true)
|
|
|
+ })
|
|
|
+ public R<Boolean> startTaskTheLog(@RequestBody JSONObject json) throws IOException {
|
|
|
+
|
|
|
+ if (json != null) {
|
|
|
+ StartTaskVO startTaskVO = JSONObject.parseObject(JSONObject.toJSONString(json), StartTaskVO.class);
|
|
|
+
|
|
|
+ String nodePrimaryKeyId = "", recordTime = "";
|
|
|
+ if (json.containsKey("nodePrimaryKeyId")) {
|
|
|
+ nodePrimaryKeyId = json.getString("nodePrimaryKeyId");
|
|
|
+ }
|
|
|
+ if (json.containsKey("recordTime")) {
|
|
|
+ recordTime = json.getString("recordTime");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isEmpty(startTaskVO.getIds())) {
|
|
|
+ if (StringUtils.isEmpty(nodePrimaryKeyId) && StringUtils.isEmpty(recordTime)) {
|
|
|
+ return R.fail("未找到业务数据");
|
|
|
+ }
|
|
|
+ //如果ids为空,说明是填报页上报,那么需要根据 nodePrimaryKeyId 和 recordTime 获取当前用户的填写记录
|
|
|
+ ContractLog log = this.contractLogService.getOne(Wrappers.<ContractLog>lambdaQuery().eq(ContractLog::getWbsNodeId, nodePrimaryKeyId)
|
|
|
+ .eq(ContractLog::getRecordTime, recordTime).eq(ContractLog::getContractId, startTaskVO.getContractId())
|
|
|
+ .eq(ContractLog::getCreateUser, AuthUtil.getUserId()));
|
|
|
+ if (log == null) {
|
|
|
+ return R.fail("未找到业务数据");
|
|
|
+ }
|
|
|
+ startTaskVO.setIds(String.valueOf(log.getId()));
|
|
|
+ }
|
|
|
+ return this.batchTask(startTaskVO);
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
return R.data(300, false, "上报失败");
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 预览、打印
|
|
|
- */
|
|
|
- @PostMapping("/theLogPreviewAndPrint")
|
|
|
- @ApiOperationSupport(order = 8)
|
|
|
- @ApiOperation(value = "预览、打印")
|
|
|
- @ApiImplicitParam(name = "json", value = "key为 ids数组,ids的数据为勾选的列表数据id集合")
|
|
|
- public R<String> theLogPreviewAndPrint(@RequestBody JSONObject json){
|
|
|
- //获取配置的路径
|
|
|
- String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
-
|
|
|
- if(json.containsKey("ids")){
|
|
|
- //id集合
|
|
|
- List<String> ids = JSONArray.parseArray(JSONObject.toJSONString(json.getJSONArray("ids")), String.class);
|
|
|
- //查询具体数据
|
|
|
- List<ContractLog> logList = this.contractLogService.list(Wrappers.<ContractLog>lambdaQuery().in(ContractLog::getId, ids));
|
|
|
- //获取pdf路径
|
|
|
- List<String> pdfUrls = logList.stream().map(log -> StringUtils.isNotEmpty(log.getEVisaPdfUrl()) ? log.getEVisaPdfUrl() : log.getPdfUrl()).distinct().collect(Collectors.toList());
|
|
|
-
|
|
|
- //删除空数据
|
|
|
- pdfUrls.removeIf(StringUtils::isEmpty);
|
|
|
-
|
|
|
- if(pdfUrls.size() > 0){
|
|
|
- //合并的pdf路径
|
|
|
- String fileName = SnowFlakeUtil.getId() + "-" + new Date().getTime() + ".pdf";
|
|
|
- String mergePdfPath = file_path + "/pdf//" + fileName;
|
|
|
- FileUtils.mergePdfPublicMethods(pdfUrls, mergePdfPath);
|
|
|
-
|
|
|
- //上传
|
|
|
- BladeFile file = this.newIOSSClient.uploadFile(fileName, mergePdfPath);
|
|
|
- if(file != null){
|
|
|
- return R.data(file.getLink());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- return R.fail("未找到数据");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 获取当前日志资料关联的工序节点信息
|
|
|
- */
|
|
|
- @PostMapping("/queryCurrentLogSelectProcessList")
|
|
|
- @ApiOperationSupport(order = 7)
|
|
|
- @ApiOperation(value = "获取当前日志资料关联的工序节点信息")
|
|
|
+ /**
|
|
|
+ * 预览、打印
|
|
|
+ */
|
|
|
+ @PostMapping("/theLogPreviewAndPrint")
|
|
|
+ @ApiOperationSupport(order = 8)
|
|
|
+ @ApiOperation(value = "预览、打印")
|
|
|
+ @ApiImplicitParam(name = "json", value = "key为 ids数组,ids的数据为勾选的列表数据id集合")
|
|
|
+ public R<String> theLogPreviewAndPrint(@RequestBody JSONObject json) {
|
|
|
+ //获取配置的路径
|
|
|
+ String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
+
|
|
|
+ if (json.containsKey("ids")) {
|
|
|
+ //id集合
|
|
|
+ List<String> ids = JSONArray.parseArray(JSONObject.toJSONString(json.getJSONArray("ids")), String.class);
|
|
|
+ //查询具体数据
|
|
|
+ List<ContractLog> logList = this.contractLogService.list(Wrappers.<ContractLog>lambdaQuery().in(ContractLog::getId, ids));
|
|
|
+ //获取pdf路径
|
|
|
+ List<String> pdfUrls = logList.stream().map(log -> StringUtils.isNotEmpty(log.getEVisaPdfUrl()) ? log.getEVisaPdfUrl() : log.getPdfUrl()).distinct().collect(Collectors.toList());
|
|
|
+
|
|
|
+ //删除空数据
|
|
|
+ pdfUrls.removeIf(StringUtils::isEmpty);
|
|
|
+
|
|
|
+ if (pdfUrls.size() > 0) {
|
|
|
+ //合并的pdf路径
|
|
|
+ String fileName = SnowFlakeUtil.getId() + "-" + new Date().getTime() + ".pdf";
|
|
|
+ String mergePdfPath = file_path + "/pdf//" + fileName;
|
|
|
+ FileUtils.mergePdfPublicMethods(pdfUrls, mergePdfPath);
|
|
|
+
|
|
|
+ //上传
|
|
|
+ BladeFile file = this.newIOSSClient.uploadFile(fileName, mergePdfPath);
|
|
|
+ if (file != null) {
|
|
|
+ return R.data(file.getLink());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ return R.fail("未找到数据");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取当前日志资料关联的工序节点信息
|
|
|
+ */
|
|
|
+ @PostMapping("/queryCurrentLogSelectProcessList")
|
|
|
+ @ApiOperationSupport(order = 7)
|
|
|
+ @ApiOperation(value = "获取当前日志资料关联的工序节点信息")
|
|
|
@ApiImplicitParam(name = "businessId", value = "数据ID")
|
|
|
- public R<List<JSONObject>> querySelectProcessList(String businessId){
|
|
|
- List<JSONObject> jsonResult = new ArrayList<>();
|
|
|
-
|
|
|
- if(StringUtils.isNotEmpty(businessId)){
|
|
|
- List<ContractLogWbs> result = this.contractLogWbsService.list(Wrappers.<ContractLogWbs>lambdaQuery().eq(ContractLogWbs::getBusinessId, businessId));
|
|
|
- if(result != null && result.size() > 0){
|
|
|
- result.forEach(logWbs -> {
|
|
|
- JSONObject json = new JSONObject();
|
|
|
- json.put("primaryKeyId", logWbs.getTreePrimaryKeyId());
|
|
|
- json.put("path", logWbs.getTitle());
|
|
|
-
|
|
|
- jsonResult.add(json);
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return R.data(jsonResult);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 获取合同段当前日志节点下的填报日期记录
|
|
|
- */
|
|
|
- @PostMapping("/getSubmitLogDateList")
|
|
|
- @ApiOperationSupport(order = 6)
|
|
|
- @ApiOperation(value = "获取合同段当前日志节点下的填报日期记录")
|
|
|
- public R<List<String>> getSubmitLogDateList(@RequestParam String contractId, @RequestParam String primaryKeyId, @RequestParam String year){
|
|
|
- return R.data(this.contractLogService.getSubmitLogDateList(contractId, primaryKeyId, year));
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 批量废除
|
|
|
- */
|
|
|
- @PostMapping("/batchAbolish")
|
|
|
- @ApiOperationSupport(order = 5)
|
|
|
- @ApiOperation(value = "批量废除")
|
|
|
- public R<Boolean> batchAbolish(@RequestParam String ids){
|
|
|
- //获取所有相关任务记录
|
|
|
- List<Task> taskList = this.taskClient.queryTaskListByFormDataId(ids);
|
|
|
- if(taskList != null && taskList.size() > 0){
|
|
|
- //执行废除
|
|
|
- for(Task task : taskList){
|
|
|
- if(new Integer("1").equals(task.getStatus())){
|
|
|
- //正在审批,调用废除
|
|
|
- this.taskClient.abolishTask(task);
|
|
|
- } else if(new Integer("2").equals(task.getStatus())) {
|
|
|
- //已审批的任务,修改业务数据的审批状态为未上报并撤签即可
|
|
|
- this.contractLogService.update(Wrappers.<ContractLog>lambdaUpdate().set(ContractLog::getAuditUserIdAndName, null).set(ContractLog::getEVisaPdfUrl, null).set(ContractLog::getStatus, 3).in(ContractLog::getId, Arrays.asList(task.getFormDataId().split(","))));
|
|
|
- }
|
|
|
-
|
|
|
- List<ContractLog> contractLogs = this.contractLogService.getBaseMapper().selectBatchIds(Arrays.asList(task.getFormDataId().split(",")));
|
|
|
- List<String> fileNameList = new ArrayList<>();
|
|
|
- for(ContractLog contractLog : contractLogs){
|
|
|
-
|
|
|
- if(!fileNameList.contains(contractLog.getFileName())){
|
|
|
- fileNameList.add(contractLog.getFileName());
|
|
|
- }
|
|
|
-
|
|
|
- ProjectInfo projectInfo = this.projectClient.queryProjectList(Func.toStrList(contractLog.getProjectId().toString())).get(0);
|
|
|
- ContractInfo contractInfo = this.contractClient.getContractById(contractLog.getContractId());
|
|
|
-
|
|
|
- try{
|
|
|
- //保存推送记录
|
|
|
- this.messageWarningClient.savePushUserMessageWarning(new MessageWarningVO(
|
|
|
- contractLog.getProjectId(),
|
|
|
- contractLog.getContractId(),
|
|
|
- //废除通知
|
|
|
- 3,
|
|
|
- //内容
|
|
|
- (StringUtils.isNotEmpty(projectInfo.getProjectAlias()) ? projectInfo.getProjectAlias() : projectInfo.getProjectName()) + contractInfo.getContractName() + "的用户" + AuthUtil.getNickName() + "废除了【" + contractLog.getFileName() + "】流程,请及时查看",
|
|
|
- //推送的目标人
|
|
|
- contractLog.getCreateUser(),
|
|
|
- //默认未读
|
|
|
- 0
|
|
|
- ));
|
|
|
-
|
|
|
- //保存操作记录
|
|
|
- JSONObject json = new JSONObject();
|
|
|
- json.put("operationObjIds", Func.toStrList(task.getFormDataId()));
|
|
|
- json.put("operationObjName", contractLog.getFileName());
|
|
|
-
|
|
|
- this.operationLogClient.saveUserOperationLog(9, "台账日志", "日志填报", json);
|
|
|
-
|
|
|
-
|
|
|
- }catch (Exception e){
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- try{
|
|
|
- //获取当前任务的环节审批人
|
|
|
- List<TaskParallel> linkList = this.taskClient.queryApprovalUserByTaskId(task.getProcessInstanceId());
|
|
|
- if(linkList != null && linkList.size() > 0){
|
|
|
- ProjectInfo projectInfo = this.projectClient.queryProjectList(Func.toStrList(task.getProjectId())).get(0);
|
|
|
- ContractInfo contractInfo = this.contractClient.getContractById(Long.parseLong(task.getContractId()));
|
|
|
-
|
|
|
- List<MessageWarningVO> messageList = new ArrayList<>();
|
|
|
- for(String fileName : fileNameList){
|
|
|
- for(TaskParallel taskParallel : linkList){
|
|
|
- messageList.add(new MessageWarningVO(
|
|
|
- Long.parseLong(task.getProjectId()),
|
|
|
- Long.parseLong(task.getContractId()),
|
|
|
- //废除通知
|
|
|
- 3,
|
|
|
- //内容
|
|
|
- (StringUtils.isNotEmpty(projectInfo.getProjectAlias()) ? projectInfo.getProjectAlias() : projectInfo.getProjectName()) + contractInfo.getContractName() + "的用户" + AuthUtil.getNickName() + "废除了【" + fileName + "】流程,请及时查看",
|
|
|
- //推送的目标人
|
|
|
- Long.parseLong(taskParallel.getTaskUser()),
|
|
|
- //默认未读
|
|
|
- 0
|
|
|
- ));
|
|
|
- }
|
|
|
- }
|
|
|
- if(messageList.size() > 0){
|
|
|
- this.messageWarningClient.savePushUserMessageWarning(messageList);
|
|
|
- }
|
|
|
- }
|
|
|
- }catch (Exception e){
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return R.data(true);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 批量上报
|
|
|
- */
|
|
|
- @PostMapping("/batchTask")
|
|
|
- @ApiOperationSupport(order = 4)
|
|
|
- @ApiOperation(value = "批量上报")
|
|
|
- public R<Boolean> batchTask(@RequestBody StartTaskVO startTaskVO){
|
|
|
- if(StringUtils.isNotEmpty(startTaskVO.getIds())){
|
|
|
- //获取数据源id
|
|
|
- String[] ids = startTaskVO.getIds().split(",");
|
|
|
- if(ids.length > 0){
|
|
|
- List<ContractLog> logList = this.contractLogService.list(Wrappers.<ContractLog>lambdaQuery().in(ContractLog::getId, Arrays.asList(ids)));
|
|
|
- Map<String, String> logMap = new HashMap<>();
|
|
|
- logList.forEach(log -> logMap.put(log.getId().toString(), log.getFileName()));
|
|
|
-
|
|
|
- for(String id : ids){
|
|
|
- //生成任务实体
|
|
|
- TaskVO taskVO = new TaskVO();
|
|
|
- BeanUtils.copyProperties(startTaskVO, taskVO);
|
|
|
- if(taskVO.getUserTasks() != null && taskVO.getUserTasks().size() > 0){
|
|
|
- //标记为自定义流程
|
|
|
- taskVO.setFixedFlowId(Long.parseLong("0"));
|
|
|
- }
|
|
|
- //设置任务名称
|
|
|
- if(StringUtils.isNotEmpty(logMap.get(id))){
|
|
|
- taskVO.setTaskName(logMap.get(id));
|
|
|
- }
|
|
|
- //设置数据源指向
|
|
|
- taskVO.setFormDataId(id);
|
|
|
- //设置上报类型
|
|
|
- taskVO.setApprovalType(3);
|
|
|
- //上报
|
|
|
- if(this.taskClient.startTask(taskVO).getData()){
|
|
|
+ public R<List<JSONObject>> querySelectProcessList(String businessId) {
|
|
|
+ List<JSONObject> jsonResult = new ArrayList<>();
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(businessId)) {
|
|
|
+ List<ContractLogWbs> result = this.contractLogWbsService.list(Wrappers.<ContractLogWbs>lambdaQuery().eq(ContractLogWbs::getBusinessId, businessId));
|
|
|
+ if (result != null && result.size() > 0) {
|
|
|
+ result.forEach(logWbs -> {
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ json.put("primaryKeyId", logWbs.getTreePrimaryKeyId());
|
|
|
+ json.put("path", logWbs.getTitle());
|
|
|
+
|
|
|
+ jsonResult.add(json);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return R.data(jsonResult);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取合同段当前日志节点下的填报日期记录
|
|
|
+ */
|
|
|
+ @PostMapping("/getSubmitLogDateList")
|
|
|
+ @ApiOperationSupport(order = 6)
|
|
|
+ @ApiOperation(value = "获取合同段当前日志节点下的填报日期记录")
|
|
|
+ public R<List<String>> getSubmitLogDateList(@RequestParam String contractId, @RequestParam String primaryKeyId, @RequestParam String year) {
|
|
|
+ return R.data(this.contractLogService.getSubmitLogDateList(contractId, primaryKeyId, year));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量废除
|
|
|
+ */
|
|
|
+ @PostMapping("/batchAbolish")
|
|
|
+ @ApiOperationSupport(order = 5)
|
|
|
+ @ApiOperation(value = "批量废除")
|
|
|
+ public R<Boolean> batchAbolish(@RequestParam String ids) throws IOException {
|
|
|
+ //获取所有相关任务记录
|
|
|
+ List<Task> taskList = this.taskClient.queryTaskListByFormDataId(ids);
|
|
|
+ if (taskList != null && taskList.size() > 0) {
|
|
|
+ //执行废除
|
|
|
+ for (Task task : taskList) {
|
|
|
+ if (new Integer("1").equals(task.getStatus())) {
|
|
|
+ //正在审批,调用废除
|
|
|
+ this.taskClient.abolishTask(task);
|
|
|
+ } else if (new Integer("2").equals(task.getStatus())) {
|
|
|
+ //已审批的任务,修改业务数据的审批状态为未上报并撤签即可
|
|
|
+ this.contractLogService.update(Wrappers.<ContractLog>lambdaUpdate().set(ContractLog::getAuditUserIdAndName, null).set(ContractLog::getEVisaPdfUrl, null).set(ContractLog::getStatus, 3).in(ContractLog::getId, Arrays.asList(task.getFormDataId().split(","))));
|
|
|
+ }
|
|
|
+
|
|
|
+ List<ContractLog> contractLogs = this.contractLogService.getBaseMapper().selectBatchIds(Arrays.asList(task.getFormDataId().split(",")));
|
|
|
+ List<String> fileNameList = new ArrayList<>();
|
|
|
+ for (ContractLog contractLog : contractLogs) {
|
|
|
+
|
|
|
+ if (!fileNameList.contains(contractLog.getFileName())) {
|
|
|
+ fileNameList.add(contractLog.getFileName());
|
|
|
+ }
|
|
|
+
|
|
|
+ ProjectInfo projectInfo = this.projectClient.queryProjectList(Func.toStrList(contractLog.getProjectId().toString())).get(0);
|
|
|
+ ContractInfo contractInfo = this.contractClient.getContractById(contractLog.getContractId());
|
|
|
+
|
|
|
+ try {
|
|
|
+ //保存推送记录
|
|
|
+ this.messageWarningClient.savePushUserMessageWarning(new MessageWarningVO(
|
|
|
+ contractLog.getProjectId(),
|
|
|
+ contractLog.getContractId(),
|
|
|
+ //废除通知
|
|
|
+ 3,
|
|
|
+ //内容
|
|
|
+ (StringUtils.isNotEmpty(projectInfo.getProjectAlias()) ? projectInfo.getProjectAlias() : projectInfo.getProjectName()) + contractInfo.getContractName() + "的用户" + AuthUtil.getNickName() + "废除了【" + contractLog.getFileName() + "】流程,请及时查看",
|
|
|
+ //推送的目标人
|
|
|
+ contractLog.getCreateUser(),
|
|
|
+ //默认未读
|
|
|
+ 0
|
|
|
+ ));
|
|
|
+
|
|
|
+ //保存操作记录
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ json.put("operationObjIds", Func.toStrList(task.getFormDataId()));
|
|
|
+ json.put("operationObjName", contractLog.getFileName());
|
|
|
+
|
|
|
+ this.operationLogClient.saveUserOperationLog(9, "台账日志", "日志填报", json);
|
|
|
+
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ //获取当前任务的环节审批人
|
|
|
+ List<TaskParallel> linkList = this.taskClient.queryApprovalUserByTaskId(task.getProcessInstanceId());
|
|
|
+ if (linkList != null && linkList.size() > 0) {
|
|
|
+ ProjectInfo projectInfo = this.projectClient.queryProjectList(Func.toStrList(task.getProjectId())).get(0);
|
|
|
+ ContractInfo contractInfo = this.contractClient.getContractById(Long.parseLong(task.getContractId()));
|
|
|
+
|
|
|
+ List<MessageWarningVO> messageList = new ArrayList<>();
|
|
|
+ for (String fileName : fileNameList) {
|
|
|
+ for (TaskParallel taskParallel : linkList) {
|
|
|
+ messageList.add(new MessageWarningVO(
|
|
|
+ Long.parseLong(task.getProjectId()),
|
|
|
+ Long.parseLong(task.getContractId()),
|
|
|
+ //废除通知
|
|
|
+ 3,
|
|
|
+ //内容
|
|
|
+ (StringUtils.isNotEmpty(projectInfo.getProjectAlias()) ? projectInfo.getProjectAlias() : projectInfo.getProjectName()) + contractInfo.getContractName() + "的用户" + AuthUtil.getNickName() + "废除了【" + fileName + "】流程,请及时查看",
|
|
|
+ //推送的目标人
|
|
|
+ Long.parseLong(taskParallel.getTaskUser()),
|
|
|
+ //默认未读
|
|
|
+ 0
|
|
|
+ ));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (messageList.size() > 0) {
|
|
|
+ //通过WebSocket推送数量条数
|
|
|
+ this.messageWarningClient.savePushUserMessageWarning(messageList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return R.data(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量上报
|
|
|
+ */
|
|
|
+ @PostMapping("/batchTask")
|
|
|
+ @ApiOperationSupport(order = 4)
|
|
|
+ @ApiOperation(value = "批量上报")
|
|
|
+ public R<Boolean> batchTask(@RequestBody StartTaskVO startTaskVO) throws IOException {
|
|
|
+ if (StringUtils.isNotEmpty(startTaskVO.getIds())) {
|
|
|
+ //获取数据源id
|
|
|
+ String[] ids = startTaskVO.getIds().split(",");
|
|
|
+ if (ids.length > 0) {
|
|
|
+ List<ContractLog> logList = this.contractLogService.list(Wrappers.<ContractLog>lambdaQuery().in(ContractLog::getId, Arrays.asList(ids)));
|
|
|
+ Map<String, String> logMap = new HashMap<>();
|
|
|
+ logList.forEach(log -> logMap.put(log.getId().toString(), log.getFileName()));
|
|
|
+
|
|
|
+ for (String id : ids) {
|
|
|
+ //生成任务实体
|
|
|
+ TaskVO taskVO = new TaskVO();
|
|
|
+ BeanUtils.copyProperties(startTaskVO, taskVO);
|
|
|
+ if (taskVO.getUserTasks() != null && taskVO.getUserTasks().size() > 0) {
|
|
|
+ //标记为自定义流程
|
|
|
+ taskVO.setFixedFlowId(Long.parseLong("0"));
|
|
|
+ }
|
|
|
+ //设置任务名称
|
|
|
+ if (StringUtils.isNotEmpty(logMap.get(id))) {
|
|
|
+ taskVO.setTaskName(logMap.get(id));
|
|
|
+ }
|
|
|
+ //设置数据源指向
|
|
|
+ taskVO.setFormDataId(id);
|
|
|
+ //设置上报类型
|
|
|
+ taskVO.setApprovalType(3);
|
|
|
+ //上报
|
|
|
+ if (this.taskClient.startTask(taskVO).getData()) {
|
|
|
LambdaUpdateWrapper<ContractLog> wrappers = Wrappers.lambdaUpdate();
|
|
|
wrappers.set(ContractLog::getBatch, taskVO.getBatch()).set(ContractLog::getStatus, 1);
|
|
|
|
|
|
//查询审批人
|
|
|
List<TaskParallel> taskUsers = this.taskClient.queryApprovalUser(id);
|
|
|
- if(taskUsers.size() > 0){
|
|
|
+ if (taskUsers.size() > 0) {
|
|
|
//生成审批人信息
|
|
|
StringBuilder stringBuilder = new StringBuilder();
|
|
|
taskUsers.forEach(users -> stringBuilder.append(",").append(users.getTaskUser()).append("-").append(users.getTaskUserName()));
|
|
@@ -457,75 +469,86 @@ public class ContractLogController extends BladeController {
|
|
|
}
|
|
|
wrappers.eq(ContractLog::getId, id);
|
|
|
|
|
|
- //修改记录
|
|
|
- this.contractLogService.update(wrappers);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- List<ContractLog> contractLogs = this.contractLogService.getBaseMapper().selectBatchIds(Arrays.asList(startTaskVO.getIds().split(",")));
|
|
|
- String title = "批量上报";
|
|
|
- if(contractLogs != null && contractLogs.size() > 0){
|
|
|
- title = contractLogs.stream().map(ContractLog::getFileName).distinct().collect(Collectors.joining());
|
|
|
- }
|
|
|
-
|
|
|
- try{
|
|
|
- //保存操作记录
|
|
|
- JSONObject json = new JSONObject();
|
|
|
- json.put("operationObjIds", Func.toStrList(startTaskVO.getIds()));
|
|
|
- json.put("operationObjName", title);
|
|
|
-
|
|
|
- this.operationLogClient.saveUserOperationLog(8, "台账日志", "日志填报", json);
|
|
|
- }catch (Exception e){
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
-
|
|
|
- return R.data(true);
|
|
|
- }
|
|
|
- }
|
|
|
- return R.data(false);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 获取当前日志类型的填报人
|
|
|
- * @return 结果
|
|
|
- */
|
|
|
- @GetMapping("/queryFillUser")
|
|
|
- @ApiOperationSupport(order = 3)
|
|
|
- @ApiOperation(value = "获取当前日志类型的填报人")
|
|
|
- @ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "primaryKeyId", value = "分类列表的primaryKeyId", required = true),
|
|
|
- @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
|
|
|
- })
|
|
|
- public R<List<FileUserVO>> queryFillUser(@RequestParam Long primaryKeyId, @RequestParam Long contractId){
|
|
|
- ContractLogVO logVo = new ContractLogVO();
|
|
|
- logVo.setWbsNodeId(primaryKeyId);
|
|
|
- logVo.setContractId(contractId);
|
|
|
- return R.data(this.contractLogService.queryFillUser(logVo));
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 施工日志分页
|
|
|
- * @param logVo 查询条件
|
|
|
- * @return 结果
|
|
|
- */
|
|
|
- @PostMapping("/constructionLogPage")
|
|
|
- @ApiOperationSupport(order = 2)
|
|
|
- @ApiOperation(value = "施工日志分页")
|
|
|
- public R<IPage<ContractLogVO>> constructionLogPage(@RequestBody ContractLogVO logVo){
|
|
|
- return R.data(this.contractLogService.constructionLogPage(logVo));
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 获取当前合同段下的日志类型
|
|
|
- * @param contractId 合同段ID
|
|
|
- * @return 结果
|
|
|
- */
|
|
|
- @GetMapping("/queryCurrentContractLogList")
|
|
|
- @ApiOperationSupport(order = 1)
|
|
|
- @ApiOperation(value = "获取当前合同段下的日志类型")
|
|
|
- @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
|
|
|
- public R<List<WbsTreeContractTreeVOS>> queryCurrentContractLogList(@RequestParam String contractId){
|
|
|
- return R.data(this.wbsTreeContractClient.queryCurrentContractLogList(contractId));
|
|
|
- }
|
|
|
+ //修改记录
|
|
|
+ this.contractLogService.update(wrappers);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ List<ContractLog> contractLogs = this.contractLogService.getBaseMapper().selectBatchIds(Arrays.asList(startTaskVO.getIds().split(",")));
|
|
|
+ String title = "批量上报";
|
|
|
+ if (contractLogs != null && contractLogs.size() > 0) {
|
|
|
+ title = contractLogs.stream().map(ContractLog::getFileName).distinct().collect(Collectors.joining());
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ //保存操作记录
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ json.put("operationObjIds", Func.toStrList(startTaskVO.getIds()));
|
|
|
+ json.put("operationObjName", title);
|
|
|
+
|
|
|
+ this.operationLogClient.saveUserOperationLog(8, "台账日志", "日志填报", json);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ //通过WebSocket推送数量条数
|
|
|
+ if (ObjectUtil.isNotEmpty(startTaskVO.getUserTasks())) {
|
|
|
+ for (StartTaskVO.CustomUserTask userTask : startTaskVO.getUserTasks()) {
|
|
|
+ Map<String, String> stringMap = iTaskService.getTaskCount(startTaskVO.getProjectId(), startTaskVO.getContractId(), userTask.getUserId());
|
|
|
+ webSocket.sendMessageByUserId(userTask.getUserId(), JSON.toJSONString(stringMap));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return R.data(true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return R.data(false);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取当前日志类型的填报人
|
|
|
+ *
|
|
|
+ * @return 结果
|
|
|
+ */
|
|
|
+ @GetMapping("/queryFillUser")
|
|
|
+ @ApiOperationSupport(order = 3)
|
|
|
+ @ApiOperation(value = "获取当前日志类型的填报人")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "primaryKeyId", value = "分类列表的primaryKeyId", required = true),
|
|
|
+ @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
|
|
|
+ })
|
|
|
+ public R<List<FileUserVO>> queryFillUser(@RequestParam Long primaryKeyId, @RequestParam Long contractId) {
|
|
|
+ ContractLogVO logVo = new ContractLogVO();
|
|
|
+ logVo.setWbsNodeId(primaryKeyId);
|
|
|
+ logVo.setContractId(contractId);
|
|
|
+ return R.data(this.contractLogService.queryFillUser(logVo));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 施工日志分页
|
|
|
+ *
|
|
|
+ * @param logVo 查询条件
|
|
|
+ * @return 结果
|
|
|
+ */
|
|
|
+ @PostMapping("/constructionLogPage")
|
|
|
+ @ApiOperationSupport(order = 2)
|
|
|
+ @ApiOperation(value = "施工日志分页")
|
|
|
+ public R<IPage<ContractLogVO>> constructionLogPage(@RequestBody ContractLogVO logVo) {
|
|
|
+ return R.data(this.contractLogService.constructionLogPage(logVo));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取当前合同段下的日志类型
|
|
|
+ *
|
|
|
+ * @param contractId 合同段ID
|
|
|
+ * @return 结果
|
|
|
+ */
|
|
|
+ @GetMapping("/queryCurrentContractLogList")
|
|
|
+ @ApiOperationSupport(order = 1)
|
|
|
+ @ApiOperation(value = "获取当前合同段下的日志类型")
|
|
|
+ @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
|
|
|
+ public R<List<WbsTreeContractTreeVOS>> queryCurrentContractLogList(@RequestParam String contractId) {
|
|
|
+ return R.data(this.wbsTreeContractClient.queryCurrentContractLogList(contractId));
|
|
|
+ }
|
|
|
|
|
|
}
|