提交修改
This commit is contained in:
parent
d3924f5c24
commit
b12a01e820
@ -306,7 +306,7 @@ public class TestController {
|
||||
}
|
||||
|
||||
|
||||
// 重置:http://localhost:8080/lz_management/test/approval?resultRecordId=3702&status=9&menuName=cccc&flowRecordId=33987&resetFlag=0
|
||||
// 重置:http://localhost:8080/lz_management/test/approval?resultRecordId=3682&status=9&menuName=cccc&flowRecordId=33919&resetFlag=0
|
||||
@RequestMapping("/test/approval")
|
||||
public R approval(ApprovalDto approvalDto) {
|
||||
try {
|
||||
|
||||
@ -12,4 +12,5 @@ public class ApprovalDto {
|
||||
private Long transferStaffId; // 转交员工 id
|
||||
private Long flowRecordId;// 流程 id
|
||||
private int resetFlag;
|
||||
private int clearFlag;//0 全清,1 还是保留指标
|
||||
}
|
||||
|
||||
@ -99,4 +99,8 @@ public interface FlowRecordMapper extends BaseMapper<FlowRecord> {
|
||||
void deleteFlowRecordByRecordId(@Param("recordId") Long recordId);
|
||||
|
||||
void updateFlowRecordIdById(@Param("id") Long id, @Param("newId") Long newId);
|
||||
|
||||
FlowRecord selectPreFlowRecordByRecordIdMinIdStatusList(@Param("recordId") Long recordId, @Param("flowIndex") Integer flowIndex, @Param("statusList") List<Integer> statusList);
|
||||
|
||||
List<FlowRecord> selectFlowRecordByRecordIdFlowIndexStatusList(@Param("recordId") Long recordId, @Param("flowIndex") Integer flowIndex, @Param("statusList") List<Integer> statusList);
|
||||
}
|
||||
@ -94,5 +94,9 @@ public interface FlowRecordService extends IService<FlowRecord> {
|
||||
|
||||
void deleteFlowRecordByRecordId(Long recordId);
|
||||
|
||||
void updateFlowRecordIdById(@Param("id") Long id, @Param("newId") Long newId);
|
||||
void updateFlowRecordIdById(Long id, Long newId);
|
||||
|
||||
FlowRecord selectPreFlowRecordByRecordIdMinIdStatusList(Long recordId, Integer flowIndex, List<Integer> statusList);
|
||||
|
||||
List<FlowRecord> selectFlowRecordByRecordIdFlowIndexStatusList(Long recordId, Integer flowIndex, List<Integer> statusList);
|
||||
}
|
||||
@ -251,4 +251,14 @@ public class FlowRecordServiceImpl extends ServiceImpl<FlowRecordMapper, FlowRec
|
||||
flowRecordMapper.updateFlowRecordIdById(id,newId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FlowRecord selectPreFlowRecordByRecordIdMinIdStatusList(Long recordId, Integer flowIndex, List<Integer> statusList) {
|
||||
return flowRecordMapper.selectPreFlowRecordByRecordIdMinIdStatusList(recordId,flowIndex,statusList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FlowRecord> selectFlowRecordByRecordIdFlowIndexStatusList(Long recordId, Integer flowIndex, List<Integer> statusList) {
|
||||
return flowRecordMapper.selectFlowRecordByRecordIdFlowIndexStatusList(recordId,flowIndex,statusList);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -128,5 +128,5 @@ public interface ResultRecordService extends IService<ResultRecord> {
|
||||
|
||||
R getResetData(RecordDetailDto recordDetailDto);
|
||||
|
||||
R resetData(Long recordId);
|
||||
R resetData(Long recordId,int clearFlag);
|
||||
}
|
||||
@ -932,8 +932,8 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
}
|
||||
|
||||
private R resetNode(ApprovalDto approvalDto) {
|
||||
FlowRecord resultRecord = flowRecordService.selectFlowRecordById(approvalDto.getFlowRecordId());
|
||||
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdGeFlowIndex(resultRecord.getRecordId(),resultRecord.getFlowIndex());
|
||||
FlowRecord f = flowRecordService.selectFlowRecordById(approvalDto.getFlowRecordId());
|
||||
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdGeFlowIndex(f.getRecordId(),f.getFlowIndex());
|
||||
for(FlowRecord flowRecord:flowRecords){
|
||||
// 如果结果录入己经走了
|
||||
if (new Integer(3).equals(flowRecord.getFlowProcess()) && (flowRecord.getStatus() == 1 || flowRecord.getStatus() == 4) ) {
|
||||
@ -941,9 +941,19 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
}else{
|
||||
flowRecord.setStatus(0); //表示流程己经被重置
|
||||
}
|
||||
|
||||
flowRecordService.updateFlowRecordById(flowRecord);
|
||||
}
|
||||
FlowRecord preFlowRecord = flowRecordService.selectPreFlowRecordByRecordIdMinIdStatusList(f.getRecordId(), f.getFlowIndex() - 1, Arrays.asList(1, 2));
|
||||
List<FlowRecord> runing = new ArrayList<>();
|
||||
if (preFlowRecord != null) {
|
||||
runing = flowRecordService.selectFlowRecordByRecordIdFlowIndex(f.getRecordId(), preFlowRecord.getFlowIndex());
|
||||
} else {
|
||||
runing = flowRecordService.selectFlowRecordByRecordIdFlowIndex(f.getRecordId(), 0);
|
||||
}
|
||||
for (FlowRecord r : runing) {
|
||||
r.setStatus(2);
|
||||
flowRecordService.updateFlowRecordById(r);
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -973,7 +983,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
}
|
||||
}
|
||||
}
|
||||
resultRecordService.resetData(flowRecord.getRecordId());
|
||||
resultRecordService.resetData(flowRecord.getRecordId(),approvalDto.getClearFlag());
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -1432,7 +1442,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
}
|
||||
|
||||
@Override
|
||||
public R resetData(Long recordId) {
|
||||
public R resetData(Long recordId,int clearFlag) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -330,6 +330,26 @@
|
||||
select * from lz_flow_record where is_delete = 0 and record_id = #{recordId} and flow_index >= #{flowIndex}
|
||||
</select>
|
||||
|
||||
<select id="selectPreFlowRecordByRecordIdMinIdStatusList" resultType="com.lz.modules.flow.entity.FlowRecord">
|
||||
select * from lz_flow_record where is_delete = 0 and flow_index <![CDATA[<=]]> #{flowIndex}
|
||||
and record_id = #{recordId}
|
||||
and status in
|
||||
<foreach item="item" collection="statusList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
order by flow_index desc limit 1
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectFlowRecordByRecordIdFlowIndexStatusList" resultType="com.lz.modules.flow.entity.FlowRecord">
|
||||
select * from lz_flow_record where is_delete = 0 and flow_index = #{flowIndex}
|
||||
and record_id = #{recordId}
|
||||
and status in
|
||||
<foreach item="item" collection="statusList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<delete id="deleteFlowRecordByRecordId">
|
||||
delete from lz_flow_record where record_id = #{recordId}
|
||||
</delete>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user