|
|
|
|
@ -1,24 +1,22 @@
|
|
|
|
|
package com.biutag.supervision.service.Report; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
|
import cn.hutool.core.date.LocalDateTimeUtil; |
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
|
import com.alibaba.fastjson2.JSONObject; |
|
|
|
|
import com.baomidou.dynamic.datasource.annotation.DSTransactional; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
import com.biutag.supervision.common.UserContextHolder; |
|
|
|
|
import com.biutag.supervision.controller.warning.WarningController; |
|
|
|
|
import com.biutag.supervision.constants.enums.WarningStateEnum; |
|
|
|
|
import com.biutag.supervision.mapper.InformMessageMapper; |
|
|
|
|
import com.biutag.supervision.mapper.Invest.InvertRecordMapper; |
|
|
|
|
import com.biutag.supervision.mapper.Report.ReportFlowMapper; |
|
|
|
|
import com.biutag.supervision.mapper.Report.ReportProjectMapper; |
|
|
|
|
import com.biutag.supervision.mapper.Report.ReportReviewMapper; |
|
|
|
|
import com.biutag.supervision.mapper.Warning.WarningRecordMapper; |
|
|
|
|
import com.biutag.supervision.mapper.serviceUnit.ServiceUnitMapper; |
|
|
|
|
import com.biutag.supervision.pojo.Result; |
|
|
|
|
import com.biutag.supervision.pojo.entity.InformMessage; |
|
|
|
|
import com.biutag.supervision.pojo.entity.InvertRecord; |
|
|
|
|
import com.biutag.supervision.pojo.entity.report.ReportFlow; |
|
|
|
|
@ -32,27 +30,21 @@ import com.biutag.supervision.pojo.enums.FlowWarningEnum;
|
|
|
|
|
import com.biutag.supervision.pojo.model.UserAuth; |
|
|
|
|
import com.biutag.supervision.pojo.param.ApprovalFlowQueryParam; |
|
|
|
|
import com.biutag.supervision.pojo.param.Report.FlowQueryParam; |
|
|
|
|
import com.biutag.supervision.pojo.request.warning.WarningEndRequest; |
|
|
|
|
import com.biutag.supervision.pojo.vo.warning.WaringVo; |
|
|
|
|
import com.biutag.supervision.service.InformMessageService; |
|
|
|
|
import com.biutag.supervision.service.InvertRecord.InvertRecordService; |
|
|
|
|
import com.biutag.supervision.service.Negative.NegativeService; |
|
|
|
|
import com.biutag.supervision.service.ServiceUnit.ServiceUnitService; |
|
|
|
|
import com.biutag.supervision.service.Warning.WarningRecordService; |
|
|
|
|
import com.biutag.supervision.util.BigDecimalUtils; |
|
|
|
|
import jakarta.validation.constraints.Negative; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
import java.beans.Transient; |
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.concurrent.Flow; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @author weipeng |
|
|
|
|
@ -245,7 +237,7 @@ public class ReportFlowService extends ServiceImpl<ReportFlowMapper,ReportFlow>
|
|
|
|
|
new LambdaUpdateWrapper<WarningRecord>() |
|
|
|
|
.eq(WarningRecord::getId, queryParam.getReportId()) |
|
|
|
|
.set(WarningRecord::getArchiving, LocalDateTime.now()) |
|
|
|
|
.set(WarningRecord::getFlowState,"0") |
|
|
|
|
// .set(WarningRecord::getFlowState,"0")
|
|
|
|
|
.set(WarningRecord::getNode,FlowStateEnum.End.getLabel()) |
|
|
|
|
); |
|
|
|
|
//版本存储
|
|
|
|
|
@ -480,5 +472,41 @@ public class ReportFlowService extends ServiceImpl<ReportFlowMapper,ReportFlow>
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 直接结束预警 |
|
|
|
|
* @param queryParam |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
public Result<Boolean> auditEndWarning(WarningEndRequest queryParam) { |
|
|
|
|
ReportProject project = projectMapper.selectById(queryParam.getReportId()); |
|
|
|
|
project.setWarningState(WarningStateEnum.YWJ.getCode()); |
|
|
|
|
projectMapper.updateById(project); |
|
|
|
|
if (ObjectUtil.isNull(project)) { |
|
|
|
|
throw new RuntimeException("操作失败,没有找到对应项目"+ project.getReportName()); |
|
|
|
|
} |
|
|
|
|
project.setWarningState(WarningStateEnum.YWJ.getCode()); |
|
|
|
|
boolean ok1 = projectMapper.updateById(project) > 0; |
|
|
|
|
|
|
|
|
|
UserAuth currentUser = UserContextHolder.getCurrentUser(); |
|
|
|
|
|
|
|
|
|
// 留痕:写一条结束记录
|
|
|
|
|
ReportFlow endFlow = new ReportFlow(); |
|
|
|
|
endFlow.setReportId(queryParam.getReportId()); |
|
|
|
|
endFlow.setReportLink(FlowWarningEnum.end.getLabel()); |
|
|
|
|
endFlow.setReportCode(FlowWarningEnum.end.getValue()); |
|
|
|
|
endFlow.setAreportTime(LocalDateTime.now()); |
|
|
|
|
|
|
|
|
|
endFlow.setApprover(currentUser.getUserName()); |
|
|
|
|
endFlow.setApproverId(currentUser.getEmpNo()); |
|
|
|
|
endFlow.setApproverUnit(currentUser.getDepartName()); |
|
|
|
|
endFlow.setApproverUnitId(currentUser.getDepartId()); |
|
|
|
|
|
|
|
|
|
endFlow.setApproverTime(LocalDateTime.now()); |
|
|
|
|
endFlow.setApproverMessage(queryParam.getMessage()); |
|
|
|
|
endFlow.setApproverState(FlowStateEnum.End.getLabel()); |
|
|
|
|
//
|
|
|
|
|
endFlow.setType("end"); |
|
|
|
|
boolean ok2 = baseMapper.insert(endFlow) > 0; |
|
|
|
|
return Result.success(ok1 && ok2); } |
|
|
|
|
} |
|
|
|
|
|