状态统一管理,舍弃单独监听器

This commit is contained in:
2024-06-13 16:57:04 +08:00
parent 7b58ec02bb
commit 146e2ca5a1
43 changed files with 147 additions and 996 deletions

View File

@@ -0,0 +1,58 @@
package com.njcn.supervision.controller;
import cn.hutool.extra.spring.SpringUtil;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.supervision.enums.SupervisionKeyEnum;
import com.njcn.supervision.enums.SupervisionResponseEnum;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import com.njcn.bpm.service.IBpmService;
@Slf4j
@RestController
@RequestMapping("/supervision")
@Api(tags = "所有业务流程公共方法管理")
@AllArgsConstructor
@ApiIgnore
public class BusinessCommonController extends BaseController {
@ApiIgnore
@GetMapping("/updateProcessStatus")
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@ApiOperation("更新流程状态")
public HttpResult<Object> updateProcessStatus(String processKey,String businessId, Integer status) {
String methodDescribe = getMethodDescribe("updateProcessStatus");
IBpmService iBpmService = getBpmServiceByBusinessKey(processKey);
iBpmService.updateProcessStatus(businessId, status);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
/**
* 根据业务流key获取实现类对象
* @param processKey 业务流key
*/
private IBpmService getBpmServiceByBusinessKey(String processKey) {
String fullServicePath = SupervisionKeyEnum.getFullServicePathByKey(processKey);
IBpmService executor;
try {
executor = (IBpmService) SpringUtil.getBean(Class.forName(fullServicePath));
} catch (ClassNotFoundException e) {
throw new BusinessException(SupervisionResponseEnum.SUPERVISION_SERVICE_NOT_FOUND);
}
return executor;
}
}

View File

@@ -72,7 +72,7 @@ public class SurveyPlanServiceImpl extends ServiceImpl<SurveyPlanMapper, SurveyP
QueryWrapper<SurveyPlanVO> surveyPlanVOQueryWrapper = new QueryWrapper<>();
if (Objects.nonNull(surveyPlanQueryParam)) {
//添加上时间范围
surveyPlanVOQueryWrapper.between("supervision_survey_plan.Create_Time",
surveyPlanVOQueryWrapper.between("supervision_survey_plan.plan_start_time",
DateUtil.beginOfDay(DateUtil.parse(surveyPlanQueryParam.getSearchBeginTime())),
DateUtil.endOfDay(DateUtil.parse(surveyPlanQueryParam.getSearchEndTime())));
//根据工程名称模糊搜索