| | |
| | | package com.ycl.service; |
| | | |
| | | import com.ycl.domain.entity.ProcessCoding; |
| | | import com.ycl.domain.entity.ProcessConfigInfo; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ycl.common.base.Result; |
| | |
| | | * @return |
| | | */ |
| | | Result getPage(ProcessConfigInfoQuery query); |
| | | |
| | | } |
| | |
| | | } |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | | } |
| | |
| | | entity.setCreateBy(userId); |
| | | entity.setUpdateBy(userId); |
| | | //如果是储备项目(未开工项目)不需要审核 |
| | | if(ProjectConstant.COMMIT.equals(entity.getUsedStatus()) && ProjectStatusEnum.PENDDING.getType().equals(entity.getProjectStatus())){ |
| | | if (ProjectConstant.COMMIT.equals(entity.getUsedStatus()) && ProjectStatusEnum.PENDDING.getType().equals(entity.getProjectStatus())) { |
| | | entity.setUsedStatus(ProjectConstant.PASS); |
| | | } |
| | | baseMapper.insert(entity); |
| | |
| | | fileService.saveBatch(fileList); |
| | | |
| | | //添加项目中标单位 |
| | | saveUnit(entity.getId(),form.getWinUnitList()); |
| | | saveUnit(entity.getId(), form.getWinUnitList()); |
| | | //添加年度投资计划 |
| | | saveYearPlan(entity.getId(),form.getYearPlanList()); |
| | | saveYearPlan(entity.getId(), form.getYearPlanList()); |
| | | return Result.ok("添加成功").data(entity.getId()); |
| | | } |
| | | |
| | |
| | | city.add(item); |
| | | } else if (ImportanceTypeEnum.SHEHONG_KEY.getType().equals(item.getImportanceType())) { |
| | | county.add(item); |
| | | } else if (ImportanceTypeEnum.NORMAL.getType().equals(item.getImportanceType())) { |
| | | } else // if (ImportanceTypeEnum.NORMAL.getType().equals(item.getImportanceType())) |
| | | { |
| | | normal.add(item); |
| | | } |
| | | }); |
| | |
| | | proPhaseCountVO.add(new IndexProPhaseCountVO("储备规划阶段", reserve.size(), reserve.stream(). |
| | | filter(item -> !StringUtils.isEmpty(item.getTotalInvestment())) |
| | | .map(item -> new BigDecimal(item.getTotalInvestment()).setScale(2, RoundingMode.HALF_UP)) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("100000000"), 2, RoundingMode.HALF_UP).toString(), "储")); |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP).toString(), "储")); |
| | | |
| | | proPhaseCountVO.add(new IndexProPhaseCountVO("项目前期阶段", previous.size(), previous.stream(). |
| | | filter(item -> !StringUtils.isEmpty(item.getTotalInvestment())) |
| | | .map(item -> new BigDecimal(item.getTotalInvestment()).setScale(2, RoundingMode.HALF_UP)) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("100000000"), 2, RoundingMode.HALF_UP).toString(), "新")); |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP).toString(), "新")); |
| | | |
| | | proPhaseCountVO.add(new IndexProPhaseCountVO("实施阶段", implement.size(), implement.stream(). |
| | | filter(item -> !StringUtils.isEmpty(item.getTotalInvestment())) |
| | | .map(item -> new BigDecimal(item.getTotalInvestment()).setScale(2, RoundingMode.HALF_UP)) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("100000000"), 2, RoundingMode.HALF_UP).toString(), "建")); |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP).toString(), "建")); |
| | | |
| | | proPhaseCountVO.add(new IndexProPhaseCountVO("竣工投用阶段", finish.size(), finish.stream(). |
| | | filter(item -> !StringUtils.isEmpty(item.getTotalInvestment())) |
| | | .map(item -> new BigDecimal(item.getTotalInvestment()).setScale(2, RoundingMode.HALF_UP)) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("100000000"), 2, RoundingMode.HALF_UP).toString(), "竣")); |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP).toString(), "竣")); |
| | | |
| | | indexCountVO.setProPhaseCountVO(proPhaseCountVO); |
| | | |
| | |
| | | impTypeCountVO.add(new IndexImpTypeCountVO("一般项目", normal.size(), normal.stream(). |
| | | filter(item -> !StringUtils.isEmpty(item.getTotalInvestment())) |
| | | .map(item -> new BigDecimal(item.getTotalInvestment()).setScale(2, RoundingMode.HALF_UP)) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("100000000"), 2, RoundingMode.HALF_UP).toString(), "普")); |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP).toString(), "普")); |
| | | |
| | | impTypeCountVO.add(new IndexImpTypeCountVO("县重点项目", county.size(), county.stream(). |
| | | filter(item -> !StringUtils.isEmpty(item.getTotalInvestment())) |
| | | .map(item -> new BigDecimal(item.getTotalInvestment()).setScale(2, RoundingMode.HALF_UP)) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("100000000"), 2, RoundingMode.HALF_UP).toString(), "县")); |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP).toString(), "县")); |
| | | |
| | | impTypeCountVO.add(new IndexImpTypeCountVO("市重点项目", city.size(), city.stream(). |
| | | filter(item -> !StringUtils.isEmpty(item.getTotalInvestment())) |
| | | .map(item -> new BigDecimal(item.getTotalInvestment()).setScale(2, RoundingMode.HALF_UP)) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("100000000"), 2, RoundingMode.HALF_UP).toString(), "市")); |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP).toString(), "市")); |
| | | |
| | | impTypeCountVO.add(new IndexImpTypeCountVO("省重点项目", province.size(), province.stream(). |
| | | filter(item -> !StringUtils.isEmpty(item.getTotalInvestment())) |
| | | .map(item -> new BigDecimal(item.getTotalInvestment()).setScale(2, RoundingMode.HALF_UP)) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("100000000"), 2, RoundingMode.HALF_UP).toString(), "省")); |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP).toString(), "省")); |
| | | indexCountVO.setImpTypeCountVO(impTypeCountVO); |
| | | return indexCountVO; |
| | | } |
| | |
| | | private final ISysDeptService deptService; |
| | | private final ProcessLogService processLogService; |
| | | private final ISysDictTypeService dictTypeService; |
| | | private final ProcessConfigInfoService processConfigInfoService; |
| | | |
| | | /** |
| | | * 分页查询 |
| | |
| | | if (processLogService.taskIsHangup(task.getId(), task.getProcessInstanceId())) { |
| | | taskVO.setTaskStatus(TaskStatusEnum.HANGUP); |
| | | } |
| | | |
| | | // 计算办理时间 |
| | | ProcessCoding processCoding = processCodingService.getByTaskId(task.getId()); |
| | | if (processCoding != null) { |
| | | if (StringUtils.isNotBlank(processCoding.getOvertime())) { |
| | | Long overtime = getTime(processCoding.getOvertime()); |
| | | |
| | | long durationTime = ((new Date()).getTime() - processCoding.getStartTaskTime().getTime()) / 1000; |
| | | |
| | | taskVO.setRemainingTime((overtime - durationTime) / 3600 + "小时"); |
| | | } else { |
| | | taskVO.setRemainingTime("-"); |
| | | } |
| | | } |
| | | this.distinctVo(taskVO); |
| | | vos.add(taskVO); |
| | | } |
| | |
| | | result.total(vos.size()); |
| | | } |
| | | result.put("taskList", vos); |
| | | } |
| | | |
| | | private Long getTime(String timeStr) { |
| | | Long time = null; |
| | | if (StringUtils.isNotBlank(timeStr)) { |
| | | String[] timeArr = timeStr.split("-"); |
| | | // 解析天数和小时数 |
| | | int days = Integer.parseInt(timeArr[0]); |
| | | int hours = 0; |
| | | if (timeArr.length > 1) { |
| | | hours = Integer.parseInt(timeArr[1]); |
| | | } |
| | | time = (days * 24L + hours) * 3600L; |
| | | // //分-秒 |
| | | // time= (days * 60L) + hours; |
| | | } |
| | | return time; |
| | | } |
| | | |
| | | @Override |
| | |
| | | jsonData.setAfterHandlerIds(afterHandlerIds); |
| | | jsonData.setAfterHandlerType(form.getPeopleType()); |
| | | // 发布转办事件 |
| | | publisher.publishEvent(new TaskLogEvent(this, null,SecurityUtils.getUserId(), form.getProjectId(), form.getProcessInsId(), task.getId(), task.getName(),ProcessLogEventTypeEnum.DELEGATE, jsonData)); |
| | | publisher.publishEvent(new TaskLogEvent(this, null, SecurityUtils.getUserId(), form.getProjectId(), form.getProcessInsId(), task.getId(), task.getName(), ProcessLogEventTypeEnum.DELEGATE, jsonData)); |
| | | |
| | | return Result.ok("转办成功"); |
| | | } |
| | |
| | | Task task = taskService.createTaskQuery().taskId(form.getTaskId()).processInstanceId(form.getProcessInsId()).singleResult(); |
| | | if (Objects.nonNull(task)) { |
| | | // 添加跳过日志 |
| | | publisher.publishEvent(new TaskLogEvent(this, null,SecurityUtils.getUserId(), form.getProjectId(), form.getProcessInsId(), form.getTaskId(), task.getName(),ProcessLogEventTypeEnum.JUMP, new JumpData(form.getDesc()))); |
| | | publisher.publishEvent(new TaskLogEvent(this, null, SecurityUtils.getUserId(), form.getProjectId(), form.getProcessInsId(), form.getTaskId(), task.getName(), ProcessLogEventTypeEnum.JUMP, new JumpData(form.getDesc()))); |
| | | // 查出该任务绑定的表单 |
| | | |
| | | Map<String, Object> data = new HashMap<>(1); |
| | |
| | | } |
| | | dataList.add(jsonData); |
| | | //添加督办日志 |
| | | publisher.publishEvent(new TaskLogEvent(this, processLog.getId(), processLog.getUserId(), form.getProjectId(), form.getProcessInsId(), form.getTaskId(), task.getName(),ProcessLogEventTypeEnum.SUPERVISE, dataList)); |
| | | publisher.publishEvent(new TaskLogEvent(this, processLog.getId(), processLog.getUserId(), form.getProjectId(), form.getProcessInsId(), form.getTaskId(), task.getName(), ProcessLogEventTypeEnum.SUPERVISE, dataList)); |
| | | return Result.ok("操作成功"); |
| | | } |
| | | |
| | |
| | | task.getName(), |
| | | ProcessLogEventTypeEnum.HANGUP, |
| | | new HangupData(form.getReason()) |
| | | )); |
| | | )); |
| | | return Result.ok("操作成功"); |
| | | } |
| | | |
| | |
| | | newV.put(task.getTaskDefinitionKey() + "&" + key, form.getVariables().get(key)); |
| | | //字典里有就放入流程变量中 |
| | | if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(dictList) && dictList.contains(key)) { |
| | | processVariables.put(key,form.getVariables().get(key)); |
| | | processVariables.put(key, form.getVariables().get(key)); |
| | | } |
| | | } |
| | | } |
| | | if( !processVariables.isEmpty() ) { |
| | | if (!processVariables.isEmpty()) { |
| | | taskService.setVariables(form.getTaskId(), processVariables); |
| | | } |
| | | |
| | |
| | | private ProcessLogService processLogService; |
| | | @Autowired |
| | | private ProcessLogMapper processLogMapper; |
| | | |
| | | /** |
| | | * 赋码任务 |
| | | * 两个逻辑 改项目码、改节点颜色 |
| | |
| | | durationTime = subNodeHangupTime(hangupLogMap, task, durationTime); |
| | | |
| | | String status = GREEN; // 默认状态为绿色 |
| | | if (redTime != null && redTime !=0 && durationTime >= redTime) { |
| | | if (redTime != null && redTime != 0 && durationTime >= redTime) { |
| | | status = RED; // 如果超过红色时间阈值,则状态为红色 |
| | | } else if (yellowTime != null && yellowTime !=0 && durationTime >= yellowTime) { |
| | | } else if (yellowTime != null && yellowTime != 0 && durationTime >= yellowTime) { |
| | | status = YELLOW; // 否则,如果超过黄色时间阈值,则状态为黄色 |
| | | } |
| | | //处理办理期限 |
| | | String overtimeStatus = NORMAL; |
| | | if (overtime != null && overtime !=0 && durationTime >= overtime) { |
| | | if (overtime != null && overtime != 0 && durationTime >= overtime) { |
| | | overtimeStatus = OVERTIME; // 如果超过办理期限 |
| | | } |
| | | else if (overtime != null && overtime != 0 && durationTime >= (overtime - 12 * 60 * 60)) { |
| | | } else if (overtime != null && overtime != 0 && durationTime >= (overtime - 12 * 60 * 60)) { |
| | | overtimeStatus = WILLOVERTIME; // 如果临期(固定超时前12小时为临期) |
| | | } |
| | | // else if (overtime != null && overtime != 0 && durationDay >= (overtime - 60)) { |
| | |
| | | map.get(status).add(task.getProcessInstanceId()); |
| | | processCoding.setStatus(status); |
| | | processCoding.setOvertimeStatus(overtimeStatus); |
| | | processCoding.setStartTaskTime(task.getCreateTime()); |
| | | list.add(processCoding); |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage(),"赋码时间格式有误"); |
| | | log.error(e.getMessage(), "赋码时间格式有误"); |
| | | } |
| | | } |
| | | //更新项目码 |
| | |
| | | from t_project_plan_examine_record ppe |
| | | LEFT JOIN t_project_plan_info ppi on ppe.project_plan_info_id = ppi.id |
| | | LEFT JOIN t_project_plan_record ppr on ppe.project_plan_record_id = ppr.id |
| | | INNER JOIN t_project_info pi on ppr.project_info_id = pi.id AND pi.deleted = 0 |
| | | Left JOIN t_project_info pi on ppr.project_info_id = pi.id AND pi.deleted = 0 |
| | | WHERE ppe.department_user_id = #{userId} or manager_user_id = #{userId} |
| | | </select> |
| | | |
| | |
| | | import com.ycl.system.domain.base.AbsEntity; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * |
| | | * |
| | |
| | | @TableField("overtime_status") |
| | | /** 任务超时状态 */ |
| | | private String overtimeStatus; |
| | | |
| | | @TableField("start_task_time") |
| | | private Date startTaskTime; |
| | | } |
| | |
| | | * @param list |
| | | */ |
| | | void updateBatch(@Param("list") List<ProcessCoding> list); |
| | | |
| | | List<ProcessCoding> findByTaskId(@Param("taskId") String taskId); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | Result all(); |
| | | |
| | | |
| | | ProcessCoding getByTaskId(String id); |
| | | } |
| | |
| | | package com.ycl.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ycl.common.base.Result; |
| | | import com.ycl.domain.entity.ProcessCoding; |
| | |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 服务实现类 |
| | | * 服务实现类 |
| | | * |
| | | * @author flq |
| | | * @since 2025-01-02 |
| | |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @param form |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改 |
| | | * |
| | | * @param form |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * id删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 列表 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | |
| | | .collect(Collectors.toList()); |
| | | return Result.ok().data(vos); |
| | | } |
| | | |
| | | @Override |
| | | public ProcessCoding getByTaskId(String taskId) { |
| | | |
| | | List<ProcessCoding> list = baseMapper.findByTaskId(taskId); |
| | | if (list.size() > 0) { |
| | | return list.get(0); |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | WHERE |
| | | TPC.deleted = 0 |
| | | </select> |
| | | <select id="findByTaskId" resultType="com.ycl.domain.entity.ProcessCoding"> |
| | | SELECT * from t_process_coding where task_id = #{taskId} |
| | | </select> |
| | | |
| | | <!-- 自定义批量更新,使用前判断list是否为空 转换为sql |
| | | update t_process_coding |