|
|
|
|
@ -9,6 +9,7 @@ import org.flowable.engine.history.HistoricProcessInstance; |
|
|
|
|
import org.flowable.task.api.history.HistoricTaskInstance; |
|
|
|
|
import org.flowable.task.api.history.HistoricTaskInstanceQuery; |
|
|
|
|
import org.flowable.variable.api.history.HistoricVariableInstance; |
|
|
|
|
import org.springblade.core.cache.utils.CacheUtil; |
|
|
|
|
import org.springblade.core.mp.base.BaseEntity; |
|
|
|
|
import org.springblade.core.mp.base.BaseService; |
|
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
|
@ -28,11 +29,14 @@ import org.springblade.plugin.operation.system.service.IModuleInfoService; |
|
|
|
|
import org.springblade.plugin.operation.system.service.IProjectInfoService; |
|
|
|
|
import org.springblade.plugin.operation.task.entity.TaskInfo; |
|
|
|
|
import org.springblade.plugin.operation.task.service.ITaskInfoService; |
|
|
|
|
import org.springblade.plugin.workbench.cache.FlowCache; |
|
|
|
|
import org.springblade.plugin.workbench.entity.AutoStartModel; |
|
|
|
|
import org.springblade.plugin.workbench.mapper.BladeManMadeMapper; |
|
|
|
|
import org.springblade.plugin.workbench.service.IAutoStartModelService; |
|
|
|
|
import org.springblade.plugin.workbench.vo.AutoStartModelVO; |
|
|
|
|
import org.springblade.system.cache.DictBizCache; |
|
|
|
|
import org.springblade.system.cache.SysCache; |
|
|
|
|
import org.springblade.system.entity.Dept; |
|
|
|
|
import org.springblade.system.feign.ISysClient; |
|
|
|
|
import org.springblade.system.user.cache.UserCache; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
@ -71,7 +75,8 @@ public class AutoStartModelServiceImpl extends BaseServiceImpl<BladeManMadeMappe |
|
|
|
|
@Override |
|
|
|
|
public List<Map<String, Object>> bladeManMadeVariabList() { |
|
|
|
|
LambdaQueryWrapper<AutoStartModel> queryWrapper = Wrappers.lambdaQuery(); |
|
|
|
|
queryWrapper.eq(AutoStartModel::getIsBreak, 0); |
|
|
|
|
// status = 10 isBreak = 0才是可以自动任务,status = 1,isBreak = 0刚建立,status=1 ,isBreak = 1删除,不自动执行了
|
|
|
|
|
queryWrapper.ne(AutoStartModel::getIsBreak, 1); |
|
|
|
|
List<AutoStartModel> autoStartModels = baseMapper.selectList(queryWrapper); |
|
|
|
|
List<Map<String,Object>> maps = new ArrayList<>(); |
|
|
|
|
if(autoStartModels.size() > 0){ |
|
|
|
|
@ -106,6 +111,8 @@ public class AutoStartModelServiceImpl extends BaseServiceImpl<BladeManMadeMappe |
|
|
|
|
copy.setTaskType(taskInfoService.getById(l.getTaskType()).getTaskTypeName()); |
|
|
|
|
copy.setTaskParent(DictBizCache.getById(l.getTaskParent()).getDictValue()); |
|
|
|
|
copy.setApplyUser(UserCache.getUser(l.getApplyUser()).getName()); |
|
|
|
|
String dept = sysClient.getDeptName(l.getManagement()).getData(); |
|
|
|
|
Dept dept1 = SysCache.getDept(l.getManagement()); |
|
|
|
|
copy.setDeptName(sysClient.getDeptName(l.getManagement()).getData()); |
|
|
|
|
copy.setRepeatMode(DictBizCache.getById(l.getRepeatMode()).getDictValue()); |
|
|
|
|
copy.setMaintenanceCompany(UserCache.getUser(l.getMaintenanceCompany()).getName()); |
|
|
|
|
@ -137,16 +144,17 @@ public class AutoStartModelServiceImpl extends BaseServiceImpl<BladeManMadeMappe |
|
|
|
|
@Override |
|
|
|
|
public boolean breakAutoStartModel(String ids) { |
|
|
|
|
List<String> strings = Func.toStrList(ids); |
|
|
|
|
List<AutoStartModel> modelList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
for(String s : strings){ |
|
|
|
|
AutoStartModel autoStartModel = baseMapper.selectById(Long.valueOf(s)); |
|
|
|
|
if(Func.isNotEmpty(autoStartModel)){ |
|
|
|
|
autoStartModel.setIsBreak(1); |
|
|
|
|
autoStartModel.setStatus(1); |
|
|
|
|
autoStartModel.setBreakTime(DateUtil.now()); |
|
|
|
|
baseMapper.updateById(autoStartModel); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
FlowCache.clearBladeManMadeCache(); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|