diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/ProcessStandardInterpretClauseMapper.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/ProcessStandardInterpretClauseMapper.java index 8abfa8ca..790934ad 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/ProcessStandardInterpretClauseMapper.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/ProcessStandardInterpretClauseMapper.java @@ -25,5 +25,11 @@ public interface ProcessStandardInterpretClauseMapper extends BaseMapper queryList(@Param(Constants.WRAPPER) QueryWrapper queryWrapper); + + /** + * 物理删除 + * @param id + */ + void physicalDeleteByMasterInterpretId(String id); } diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/ProcessStandardInterpretClauseSublistMapper.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/ProcessStandardInterpretClauseSublistMapper.java index 4aa7ed6d..8af7302b 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/ProcessStandardInterpretClauseSublistMapper.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/ProcessStandardInterpretClauseSublistMapper.java @@ -25,5 +25,11 @@ public interface ProcessStandardInterpretClauseSublistMapper extends BaseMapper< */ List queryList(@Param(Constants.WRAPPER) QueryWrapper queryWrapper); + + /** + * 物理删除 + * @param standardInterpretClauseIdList + */ + void physicalDeleteBystandardInterpretClauseIdList(@Param("list") List standardInterpretClauseIdList); } diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/ProcessStandardInterpretMapper.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/ProcessStandardInterpretMapper.java index 82d2c750..6ccfcb06 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/ProcessStandardInterpretMapper.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/ProcessStandardInterpretMapper.java @@ -31,5 +31,11 @@ public interface ProcessStandardInterpretMapper extends BaseMapper homeNewestStandardInterpret(Page page); + + /** + * 物理删除 + * @param id + */ + void physicalDeleteById(String id); } diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretClauseMapper.xml b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretClauseMapper.xml index a448e753..e6b738a4 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretClauseMapper.xml +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretClauseMapper.xml @@ -19,5 +19,8 @@ where psic.del_flag = 0) t ${ew.customSqlSegment} + + delete from process_standard_interpret_clause where standard_interpret_id = #{id} + diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretClauseSublistMapper.xml b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretClauseSublistMapper.xml index 9dbfa1d2..794ccd2f 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretClauseSublistMapper.xml +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretClauseSublistMapper.xml @@ -57,5 +57,12 @@ on psics.standard_interpret_clause_id = psic2.interpret_clause_id ${ew.customSqlSegment} + + + delete from process_standard_interpret_clause_sublist where standard_interpret_clause_id in + + #{item} + + diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretMapper.xml b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretMapper.xml index de1d9334..4c83f22a 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretMapper.xml +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretMapper.xml @@ -50,5 +50,9 @@ and i.create_time >= date_format(date_add(now(), interval -90 day), '%Y-%m-%d') order by i.create_time desc + + + delete from process_standard_interpret where id = #{id} + diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/ProcessStandardInterpretClauseService.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/ProcessStandardInterpretClauseService.java index ee5d9707..88518ddd 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/ProcessStandardInterpretClauseService.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/ProcessStandardInterpretClauseService.java @@ -18,5 +18,11 @@ public interface ProcessStandardInterpretClauseService extends IService queryList(ProcessStandardInterpretClause processStandardInterpretClause); + + /** + * 物理删除 + * @param id + */ + void physicalDeleteByMasterInterpretId(String id); } diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/ProcessStandardInterpretClauseSublistService.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/ProcessStandardInterpretClauseSublistService.java index b49c13ab..0bebceaf 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/ProcessStandardInterpretClauseSublistService.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/ProcessStandardInterpretClauseSublistService.java @@ -20,5 +20,11 @@ public interface ProcessStandardInterpretClauseSublistService extends IService

queryList( ProcessStandardInterpretClauseSublist processStandardInterpretClauseSublist); + + /** + * 物理删除 + * @param processStandardInterpretClauseSublistList + */ + void physicalDeleteBystandardInterpretClauseIdList(List processStandardInterpretClauseSublistList); } diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/ProcessStandardInterpretService.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/ProcessStandardInterpretService.java index 25d1dd2b..b96f4868 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/ProcessStandardInterpretService.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/ProcessStandardInterpretService.java @@ -16,5 +16,11 @@ public interface ProcessStandardInterpretService extends IService standardInterpretClauseIdList) { + processStandardInterpretClauseSublistMapper.physicalDeleteBystandardInterpretClauseIdList(standardInterpretClauseIdList); + } } diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/ProcessStandardInterpretServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/ProcessStandardInterpretServiceImpl.java index bc3345bb..dbf85e43 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/ProcessStandardInterpretServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/ProcessStandardInterpretServiceImpl.java @@ -33,5 +33,10 @@ public class ProcessStandardInterpretServiceImpl queryWrapper.eq("psi.del_flag", CommonConstant.DEL_FLAG_0); return processStandardInterpretMapper.queryOne(queryWrapper); } + + @Override + public void physicalDeleteById(String id) { + processStandardInterpretMapper.physicalDeleteById(id); + } } diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/StandardInterpretFlow.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/StandardInterpretFlow.java index 9d4a6548..b49b70f8 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/StandardInterpretFlow.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/StandardInterpretFlow.java @@ -9,7 +9,9 @@ import com.jero.modules.activiti.enums.FinishFlagEnum; import com.jero.modules.activiti.process.standardinterpret.common.StandardInterpretCommon; import com.jero.modules.activiti.process.standardinterpret.dto.StandardInterpretDTO; import com.jero.modules.activiti.process.standardinterpret.entity.ProcessStandardInterpret; +import com.jero.modules.activiti.process.standardinterpret.entity.ProcessStandardInterpretClause; import com.jero.modules.activiti.process.standardinterpret.entity.ProcessStandardInterpretClauseSublist; +import com.jero.modules.activiti.process.standardinterpret.service.ProcessStandardInterpretClauseService; import com.jero.modules.activiti.process.standardinterpret.service.ProcessStandardInterpretClauseSublistService; import com.jero.modules.activiti.process.standardinterpret.service.ProcessStandardInterpretService; import com.jero.modules.activiti.process.standardinterpret.service.StandardInterpretFlowService; @@ -19,10 +21,14 @@ import com.jero.modules.activiti.service.WorkCenterService; import com.jero.modules.activiti.util.SpringContextUtil; import com.jero.modules.activiti.vo.DelegateTaskParam; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** * @ClassName: EsInspectPlanFlowService @@ -42,9 +48,34 @@ public class StandardInterpretFlow implements WorkCenterService { @Override public void changeToDraft(ProcessAll processAll) { // 删除业务表数据 - ProcessAllService processAllService = SpringContextUtil.getBean(ProcessAllService.class); - processAllService.physicalDeleteByProjectId("process_standard_interpret", processAll.getProjectId()); + // 删除 标准解读流程 + ProcessStandardInterpretService processStandardInterpretService = + SpringContextUtil.getBean(ProcessStandardInterpretService.class); + ProcessStandardInterpret processStandardInterpret = processStandardInterpretService.getOne( + new LambdaQueryWrapper() + .eq(ProcessStandardInterpret::getProjectId, processAll.getProjectId())); + if (!Objects.isNull(processStandardInterpret) && StringUtils.isNotBlank(processStandardInterpret.getId())){ + processStandardInterpretService.physicalDeleteById(processStandardInterpret.getId()); + // 删除 标准解读流程_条款中间表 + ProcessStandardInterpretClauseService processStandardInterpretClauseService = + SpringContextUtil.getBean(ProcessStandardInterpretClauseService.class); + List processStandardInterpretClauseList = processStandardInterpretClauseService.list( + new LambdaQueryWrapper() + .eq(ProcessStandardInterpretClause::getStandardInterpretId, processStandardInterpret.getId())); + + // // 删除 标准解读流程_条款中间表_子表 + if (CollectionUtils.isNotEmpty(processStandardInterpretClauseList)){ + processStandardInterpretClauseService.physicalDeleteByMasterInterpretId(processStandardInterpret.getId()); + List processStandardInterpretClauseSublistList = + processStandardInterpretClauseList.stream().map(ProcessStandardInterpretClause::getId).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(processStandardInterpretClauseSublistList)){ + ProcessStandardInterpretClauseSublistService processStandardInterpretClauseSublistService = + SpringContextUtil.getBean(ProcessStandardInterpretClauseSublistService.class); + processStandardInterpretClauseSublistService.physicalDeleteBystandardInterpretClauseIdList(processStandardInterpretClauseSublistList); + } + } + } // 更新子流程进行中的为未处理 ProcessApprovalRecordService processApprovalRecordService = SpringContextUtil.getBean(ProcessApprovalRecordService.class);