[修改] 流程重复发起问题 更改
This commit is contained in:
@@ -44,7 +44,7 @@ public interface TtReportManageActDao extends BaseMapper<TtReportManageAct> {
|
||||
*/
|
||||
List<TtReportManageAct> queryList(@Param("pageVO") TtReportManageActPageVO ttReportManageActPageVO);
|
||||
|
||||
TtReportManageAct selectByDataId(String dataId);
|
||||
List<TtReportManageAct> selectByDataId(String dataId);
|
||||
|
||||
TtReportManageAct selectByPrcId(String prcId);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
downloadCount.download AS download,
|
||||
AVG( trur.user_rating ) AS reportRating,
|
||||
IF(bpn.id is null,1,
|
||||
IF(bpn.end_time is null,0,1)
|
||||
IF(bpn.SUBMIT_STATUS = 1,0,1)
|
||||
) as isAct
|
||||
FROM
|
||||
TT_REPORT_MANAGE eo
|
||||
@@ -186,7 +186,7 @@
|
||||
t.confidentialLevel,
|
||||
t.privacyLevel,
|
||||
IF(bpn.id is null,1,
|
||||
IF(bpn.end_time is null,0,1)
|
||||
IF(bpn.SUBMIT_STATUS = 1,0,1)
|
||||
) as isAct
|
||||
FROM `tt_report_manage` AS t
|
||||
LEFT JOIN bus_process_name as bpn on bpn.data_id = t.id and bpn.prc_type = '5'
|
||||
|
||||
BIN
Binary file not shown.
+17
-9
@@ -226,14 +226,20 @@ public class TodoTaskController {
|
||||
reportEntity = reportDao.selectById(dataId);
|
||||
}else if("4".equals(prcType)){
|
||||
//上传
|
||||
TtReportManageAct ttReportManageAct = ttReportManageActDao.selectByDataId(dataId);
|
||||
reportEntity.setConfidentialLevel(ttReportManageAct.getConfidentialLevel());
|
||||
reportEntity.setPrivacyLevel(ttReportManageAct.getPrivacyLevel());
|
||||
List<TtReportManageAct> ttReportManageActList = ttReportManageActDao.selectByDataId(dataId);
|
||||
if (CollectionUtils.isNotEmpty(ttReportManageActList)){
|
||||
TtReportManageAct ttReportManageAct = ttReportManageActList.get(0);
|
||||
reportEntity.setConfidentialLevel(ttReportManageAct.getConfidentialLevel());
|
||||
reportEntity.setPrivacyLevel(ttReportManageAct.getPrivacyLevel());
|
||||
}
|
||||
}else if("5".equals(prcType)){
|
||||
//上传
|
||||
TtReportManageAct ttReportManageAct = ttReportManageActDao.selectByDataId(dataId);
|
||||
reportEntity.setConfidentialLevel(ttReportManageAct.getConfidentialLevel());
|
||||
reportEntity.setPrivacyLevel(ttReportManageAct.getPrivacyLevel());
|
||||
// 编辑
|
||||
List<TtReportManageAct> ttReportManageActList = ttReportManageActDao.selectByDataId(dataId);
|
||||
if (CollectionUtils.isNotEmpty(ttReportManageActList)){
|
||||
TtReportManageAct ttReportManageAct = ttReportManageActList.get(0);
|
||||
reportEntity.setConfidentialLevel(ttReportManageAct.getConfidentialLevel());
|
||||
reportEntity.setPrivacyLevel(ttReportManageAct.getPrivacyLevel());
|
||||
}
|
||||
}else {
|
||||
throw new AdcDaBaseException("没有流程类型"+prcType);
|
||||
}
|
||||
@@ -566,7 +572,8 @@ public class TodoTaskController {
|
||||
//上传
|
||||
TtReportManageAct ttReportManageAct = new TtReportManageAct();
|
||||
if (StringUtils.isBlank(pId)){
|
||||
ttReportManageAct = ttReportManageActDao.selectByDataId(dataId);
|
||||
List<TtReportManageAct> ttReportManageActs = ttReportManageActDao.selectByDataId(dataId);
|
||||
ttReportManageAct = ttReportManageActs.get(0);
|
||||
}else {
|
||||
ttReportManageAct = ttReportManageActDao.selectByPrcId(pId);
|
||||
}
|
||||
@@ -579,7 +586,8 @@ public class TodoTaskController {
|
||||
//编辑
|
||||
TtReportManageAct ttReportManageAct = new TtReportManageAct();
|
||||
if (StringUtils.isBlank(pId)){
|
||||
ttReportManageAct = ttReportManageActDao.selectByDataId(dataId);
|
||||
List<TtReportManageAct> ttReportManageActs = ttReportManageActDao.selectByDataId(dataId);
|
||||
ttReportManageAct = ttReportManageActs.get(0);
|
||||
}else {
|
||||
ttReportManageAct = ttReportManageActDao.selectByPrcId(pId);
|
||||
}
|
||||
|
||||
+1
-1
@@ -113,7 +113,7 @@ public class BusProcessName implements Serializable {
|
||||
@TableField(exist = false)
|
||||
private String privacyLevel;
|
||||
|
||||
//提交状态 0:草稿、1:提交 对应枚举 SubmitStatusEnum
|
||||
//提交状态 0:草稿、1:提交 2:删除 3:结束 对应枚举 SubmitStatusEnum
|
||||
@TableField("SUBMIT_STATUS")
|
||||
private String submitStatus;
|
||||
|
||||
|
||||
+2
@@ -24,4 +24,6 @@ public interface IBusProcessNameService extends IService<BusProcessName> {
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> ruleGeneratePrcNumAndPrcNum(String prcType);
|
||||
|
||||
void stopAct(String processInstanceId);
|
||||
}
|
||||
|
||||
+11
@@ -4,7 +4,9 @@ import com.adc.da.wkflow.business_main.entity.BusProcessName;
|
||||
import com.adc.da.wkflow.business_main.mapper.BusProcessNameMapper;
|
||||
import com.adc.da.wkflow.business_main.service.IBusProcessNameService;
|
||||
import com.adc.da.wkflow.enums.FlowTypeEnum;
|
||||
import com.adc.da.wkflow.enums.SubmitStatusEnum;
|
||||
import com.adc.da.wkflow.util.ImpulseSenderUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.activiti.engine.ActivitiException;
|
||||
@@ -83,4 +85,13 @@ public class BusProcessNameServiceImpl extends ServiceImpl<BusProcessNameMapper,
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopAct(String processInstanceId) {
|
||||
LambdaQueryWrapper<BusProcessName> busProcessNameLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
busProcessNameLambdaQueryWrapper.eq(BusProcessName::getPrcId,processInstanceId);
|
||||
BusProcessName busProcessName = new BusProcessName();
|
||||
busProcessName.setSubmitStatus(SubmitStatusEnum.STOP.getValue());
|
||||
baseMapper.update(busProcessName,busProcessNameLambdaQueryWrapper);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ public enum SubmitStatusEnum {
|
||||
DRAFT("0","草稿"),
|
||||
SUBMIT("1","提交"),
|
||||
DELETE("2","删除"),
|
||||
STOP("3","完成"),
|
||||
;
|
||||
|
||||
private String value;
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.adc.da.report.service.ITtReportManageActService;
|
||||
import com.adc.da.wkflow.business_main.entity.BusProcessApprove;
|
||||
import com.adc.da.wkflow.business_main.entity.BusProcessNew;
|
||||
import com.adc.da.wkflow.business_main.service.IBusProcessApproveService;
|
||||
import com.adc.da.wkflow.business_main.service.IBusProcessNameService;
|
||||
import com.adc.da.wkflow.business_main.service.IBusProcessNewService;
|
||||
import com.adc.da.wkflow.listener.FlagEnum;
|
||||
import com.adc.da.wkflow.util.SpringContextUtil;
|
||||
@@ -28,6 +29,7 @@ public class oneApplyAfter implements TaskListener {
|
||||
TtReportManageActDao ttReportManageActDao = SpringContextUtil.getBean(TtReportManageActDao.class);
|
||||
ReportDao reportDao = SpringContextUtil.getBean(ReportDao.class);
|
||||
IBusProcessNewService busBean = SpringContextUtil.getBean(IBusProcessNewService.class);
|
||||
IBusProcessNameService busProcessNameService = SpringContextUtil.getBean(IBusProcessNameService.class);
|
||||
IBusProcessApproveService approveService = SpringContextUtil.getBean(IBusProcessApproveService.class);
|
||||
ITtReportManageActService ttReportManageActService = SpringContextUtil.getBean(ITtReportManageActService.class);
|
||||
//查询task任务
|
||||
@@ -58,6 +60,7 @@ public class oneApplyAfter implements TaskListener {
|
||||
delegateTask.setVariable("flag",s);
|
||||
if ("1".equals(s)){
|
||||
ttReportManageActService.saveOrUpdataReport(ttReportManageAct);
|
||||
busProcessNameService.stopAct(delegateTask.getProcessInstanceId());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+3
-2
@@ -7,6 +7,7 @@ import com.adc.da.report.eo.PowerApplyAct;
|
||||
import com.adc.da.wkflow.business_main.entity.BusProcessApprove;
|
||||
import com.adc.da.wkflow.business_main.entity.BusProcessNew;
|
||||
import com.adc.da.wkflow.business_main.service.IBusProcessApproveService;
|
||||
import com.adc.da.wkflow.business_main.service.IBusProcessNameService;
|
||||
import com.adc.da.wkflow.business_main.service.IBusProcessNewService;
|
||||
import com.adc.da.wkflow.listener.FlagEnum;
|
||||
import com.adc.da.wkflow.util.SpringContextUtil;
|
||||
@@ -27,6 +28,7 @@ public class twoApplyAfter implements TaskListener {
|
||||
PowerApplyActDao powerApplyActDao = SpringContextUtil.getBean(PowerApplyActDao.class);
|
||||
PowerApplyDao powerApplyDao = SpringContextUtil.getBean(PowerApplyDao.class);
|
||||
IBusProcessNewService busBean = SpringContextUtil.getBean(IBusProcessNewService.class);
|
||||
IBusProcessNameService busProcessNameService = SpringContextUtil.getBean(IBusProcessNameService.class);
|
||||
IBusProcessApproveService approveService = SpringContextUtil.getBean(IBusProcessApproveService.class);
|
||||
//查询task任务
|
||||
LambdaQueryWrapper<PowerApplyAct> queryWrapper = new LambdaQueryWrapper<>();
|
||||
@@ -60,8 +62,7 @@ public class twoApplyAfter implements TaskListener {
|
||||
delegateTask.setVariable("flag",s);
|
||||
if ("1".equals(s)){
|
||||
powerApplyDao.savePowerAct(powerApplyAct);
|
||||
// List<String> collect = powerApplyActs.stream().map(e -> e.getId()).collect(Collectors.toList());
|
||||
// powerApplyActDao.batchDel(collect);
|
||||
busProcessNameService.stopAct(delegateTask.getProcessInstanceId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Reference in New Issue
Block a user