Commit 1989cf33 authored by zhangyingbin's avatar zhangyingbin

项目立项流程,项目新增接口及相关接口调整

parent e39b8d01
...@@ -10,19 +10,21 @@ import java.util.Map; ...@@ -10,19 +10,21 @@ import java.util.Map;
@AllArgsConstructor @AllArgsConstructor
public enum ProjectInitiationEnum { public enum ProjectInitiationEnum {
项目立项("1","项目立项","XMLX","被驳回,请重新申请","",""), 项目立项("1","项目立项","XMLX","被驳回,请重新申请","",""),
平台审核("2","平台审核","PTSH","项目待平台审核","审核项目","待审核"),
告知申请("3","告知申请","GZSQ","告知待申请","告知申请","待申请"), 设计开工资料提交("2","开工资料提交(设计)","SJZLTJ","设计资料待提交","提交资料","待提交"),
接受告知("4","接受告知","JSGZ","告知待接收","告知接收","待接收"), 安装开工资料提交("3","开工资料提交(安装)","AZZLTJ","安装资料待提交","提交资料","待提交"),
审查项目("5","审查项目","SCXM","告知待审查","项目告知审查","待审查"), 告知申请("4","告知申请","GZSQ","告知待申请","告知申请","待申请"),
提交资料("6","提交资料","TJZL","项目资料待提交","项目资料提交","待提交"), 接受告知("5","接受告知","JSGZ","告知待接收","告知接收","待接收"),
审批人审批("7","审批人审批","SPRSP","项目资料待审批","项目资料审批","待审批"), //设计和安装合并使用。
审核人审核("8","审核人审核","SHRSH","项目资料待审核","项目资料审核","待审核"), 提交资料("6","提交资料","TJZL","项目资料待提交","提交资料","待提交"),
监检科室分配("9","监检科室分配","JJKSFP","监检科室待分配","监检科室分配","待分配"), 监检科室分配("6","监检科室分配","JJKSFP","监检科室待分配","监检科室分配","待分配"),
监检员分配("10","监检员分配","JJYFP","监检员待分配","监检员分配","待分配"), 监检员分配("7","监检员分配","JJYFP","监检员待分配","监检员分配","待分配"),
监检员审核("11","监检员审核","JJYSH","监检员待审核","监检员审核","待审核"), 监检员审核("8","监检员审核","JJYSH","监检员待审核","监检员审核","待审核"),
项目关闭("12","项目关闭","XMGB","","",""), 设计开工资料修改("9","开工资料修改(设计)","SJZLXG","设计资料待修改","设计修改资料","待修改"),
接受审查意见("13","接受审查意见","JSSCYJ","审查意见待接受","接受审查意见","待接受"), 安装开工资料修改("10","开工资料修改(安装)","AZZLXG","安装资料待修改","安装修改资料","待修改"),
流程结束("14","流程结束!","LCJS","","",""); // 设计和安装都需要修改时合并使用
修改资料("","资料修改","","资料待修改","修改资料","待修改"),
流程结束("11","流程结束!","LCJS","","","");
private String status; private String status;
private String name; private String name;
......
package com.yeejoin.amos.boot.module.ugp.api.dto; package com.yeejoin.amos.boot.module.ugp.api.dto;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto; import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -59,4 +60,6 @@ public class PipeDto extends BaseDto { ...@@ -59,4 +60,6 @@ public class PipeDto extends BaseDto {
@ApiModelProperty(value = "终点名称") @ApiModelProperty(value = "终点名称")
private String endName; private String endName;
private JSONObject startPositionObject;
private JSONObject endPositionObject;
} }
...@@ -93,6 +93,64 @@ public class ProjectDto extends BaseDto { ...@@ -93,6 +93,64 @@ public class ProjectDto extends BaseDto {
private String remark; private String remark;
/** /**
* 安装单位联系人id
*/
private Long installUnitChargerId;
/**
* 安装单位联系人
*/
private String installUnitCharger;
/**
* 无损检测单位id
*/
private Long testingUnitId;
/**
* 无损检测单位
*/
private String testingUnit;
/**
* 监理单位id
*/
private Long supervisionUnitId;
/**
* 监理单位
*/
private String supervisionUnit;
/**
* 设计压力
*/
private String designPressure;
/**
* 输送介质
*/
private String conveyingMedium;
/**
* 工程规模
*/
private String projectScale;
/**
* 竣工预计日期
*/
private Date completionEstimate;
/**
* 压力管道级别
*/
private String pressureLevel;
private List<PipeDto> pipeSubForm;
/**
* 监检部门 * 监检部门
*/ */
private String inspectionUnit; private String inspectionUnit;
......
...@@ -160,4 +160,70 @@ public class Project extends BaseEntity { ...@@ -160,4 +160,70 @@ public class Project extends BaseEntity {
*/ */
@TableField("credit_code") @TableField("credit_code")
private String creditCode; private String creditCode;
/**
* 安装单位联系人id
*/
@TableField("install_unit_charger_id")
private Long installUnitChargerId;
/**
* 安装单位联系人
*/
@TableField("install_unit_charger")
private String installUnitCharger;
/**
* 无损检测单位id
*/
@TableField("testing_unit_id")
private Long testingUnitId;
/**
* 无损检测单位
*/
@TableField("testing_unit")
private String testingUnit;
/**
* 监理单位id
*/
@TableField("supervision_unit_id")
private Long supervisionUnitId;
/**
* 监理单位
*/
@TableField("supervision_unit")
private String supervisionUnit;
/**
* 设计压力
*/
@TableField("design_pressure")
private String designPressure;
/**
* 输送介质
*/
@TableField("conveying_medium")
private String conveyingMedium;
/**
* 工程规模
*/
@TableField("project_scale")
private String projectScale;
/**
* 竣工预计日期
*/
@TableField("completion_estimate")
private Date completionEstimate;
/**
* 压力管道级别
*/
@TableField("pressure_level")
private String pressureLevel;
} }
...@@ -7,7 +7,7 @@ public interface IProcessRelationService { ...@@ -7,7 +7,7 @@ public interface IProcessRelationService {
* *
* @param instanceId 流程实例id * @param instanceId 流程实例id
* @param sourceId 资源id * @param sourceId 资源id
* @param processName 流程名称(文字) * @param processName 流程名称(文字) eg:ProcessTypeEnum.项目立项.getName()
*/ */
void savePR(String instanceId, Long sourceId, String processName); void savePR(String instanceId, Long sourceId, String processName);
...@@ -16,5 +16,5 @@ public interface IProcessRelationService { ...@@ -16,5 +16,5 @@ public interface IProcessRelationService {
* *
* @param instanceId 流程实例id * @param instanceId 流程实例id
*/ */
void updateState(String instanceId); void updateState(String instanceId,String taskName);
} }
...@@ -16,7 +16,7 @@ public interface IProjectInitiationService { ...@@ -16,7 +16,7 @@ public interface IProjectInitiationService {
/** /**
* 执行流程节点,并记录日志 * 执行流程节点,并记录日志
*/ */
void execute(String instanceId, Object object, String option); void execute(String instanceId, Object object, String condition,String option);
/** /**
* 竣工结项流程启动 * 竣工结项流程启动
......
...@@ -594,5 +594,17 @@ public class CompanyController extends BaseController { ...@@ -594,5 +594,17 @@ public class CompanyController extends BaseController {
ReginParams reginParams = orgServiceImpl.getReginParams(); ReginParams reginParams = orgServiceImpl.getReginParams();
return ResponseHelper.buildResponse(companyServiceImpl.getById(reginParams.getBusinessInfo().getCompanySequenceNbr())); return ResponseHelper.buildResponse(companyServiceImpl.getById(reginParams.getBusinessInfo().getCompanySequenceNbr()));
} }
/**
* 根据unitId获取单位的许可信息
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/unitLicenseCode/resource")
@ApiOperation(httpMethod = "GET", value = "根据unitId获取单位的许可信息", notes = "根据unitId获取单位的许可信息")
@BusinessIdentify
public ResponseModel<JSONObject> getUnitLicenseCode(Long unitId){
return ResponseHelper.buildResponse(companyServiceImpl.getUnitLicenseCode(unitId));
}
} }
...@@ -184,7 +184,7 @@ public class InstallNoticeController extends BaseController { ...@@ -184,7 +184,7 @@ public class InstallNoticeController extends BaseController {
if (model.getNoticeStatus().equals("已保存")){ if (model.getNoticeStatus().equals("已保存")){
model.setNoticeStatus("已提交"); model.setNoticeStatus("已提交");
installNoticeServiceImpl.updateWithModel(model); installNoticeServiceImpl.updateWithModel(model);
projectInitiationServiceImpl.execute(project.getInstanceId(),model,"1"); projectInitiationServiceImpl.execute(project.getInstanceId(),model,"1",null);
} }
return ResponseHelper.buildResponse(model); return ResponseHelper.buildResponse(model);
} }
...@@ -299,7 +299,7 @@ public class InstallNoticeController extends BaseController { ...@@ -299,7 +299,7 @@ public class InstallNoticeController extends BaseController {
Project project = projectServiceImpl.getById(installNotice.getProjectId()); Project project = projectServiceImpl.getById(installNotice.getProjectId());
JSONObject json = JSON.parseObject(JSON.toJSONString(installNotice)); JSONObject json = JSON.parseObject(JSON.toJSONString(installNotice));
json.put(XJConstant.PROCESS_PROJECT_STATE,"告知待审核"); json.put(XJConstant.PROCESS_PROJECT_STATE,"告知待审核");
projectInitiationServiceImpl.execute(project.getInstanceId(),json,NoticeStatusEnum.已接收.getStatusId()); projectInitiationServiceImpl.execute(project.getInstanceId(),json,NoticeStatusEnum.已接收.getStatusId(),null);
return ResponseHelper.buildResponse(installNoticeServiceImpl.updateById(installNotice)); return ResponseHelper.buildResponse(installNoticeServiceImpl.updateById(installNotice));
} }
...@@ -320,7 +320,7 @@ public class InstallNoticeController extends BaseController { ...@@ -320,7 +320,7 @@ public class InstallNoticeController extends BaseController {
installNotice.setNoticeStatus(NoticeStatusEnum.已退回.getName()); installNotice.setNoticeStatus(NoticeStatusEnum.已退回.getName());
} }
Project project = projectServiceImpl.getById(installNotice.getProjectId()); Project project = projectServiceImpl.getById(installNotice.getProjectId());
projectInitiationServiceImpl.execute(project.getInstanceId(),installNotice,option); projectInitiationServiceImpl.execute(project.getInstanceId(),installNotice,option,null);
return ResponseHelper.buildResponse(installNoticeServiceImpl.updateById(installNotice)); return ResponseHelper.buildResponse(installNoticeServiceImpl.updateById(installNotice));
} }
......
...@@ -11,6 +11,7 @@ import com.yeejoin.amos.boot.biz.common.utils.DateUtils; ...@@ -11,6 +11,7 @@ import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil; import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum; import com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum;
import com.yeejoin.amos.boot.module.ugp.api.Enum.WhetherItPassEnum;
import com.yeejoin.amos.boot.module.ugp.api.constants.XJConstant; import com.yeejoin.amos.boot.module.ugp.api.constants.XJConstant;
import com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto; import com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.MaterialDto; import com.yeejoin.amos.boot.module.ugp.api.dto.MaterialDto;
...@@ -91,87 +92,8 @@ public class ProjectController extends BaseController { ...@@ -91,87 +92,8 @@ public class ProjectController extends BaseController {
@PostMapping(value = "/save") @PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增项目信息表", notes = "新增项目信息表") @ApiOperation(httpMethod = "POST", value = "新增项目信息表", notes = "新增项目信息表")
@BusinessIdentify @BusinessIdentify
public ResponseModel<ProjectDto> save(@RequestBody ProjectDto model) { public ResponseModel<ProjectDto> save(@RequestBody ProjectDto model,String submitType) {
System.out.println("项目立项开始:"+ DateUtils.date2LongStr(new Date())); return ResponseHelper.buildResponse(projectServiceImpl.saveProjectInfo(model,submitType));
String regionName = "",regionCode = "";
Map<String,String> map = getInfo(regionName,regionCode,Long.valueOf(model.getInstallRegionCode()));
model.setSubmitDate(new Date());
model.setInstallationUnit(orgServiceImpl.getOrgUsrById(String.valueOf(model.getInstallationUnitId())).getBizOrgName());
model.setDesignUnit(orgServiceImpl.getOrgUsrById(String.valueOf(model.getDesignUnitId())).getBizOrgName());
model.setConstructionUnitId(orgServiceImpl.getReginParams().getBusinessInfo().getCompanySequenceNbr());
model.setChargePerson(orgServiceImpl.getOrgUsrById(String.valueOf(model.getChargePersonId())).getBizOrgName());
model.setInstallRegion(map.get("regionName"));
model.setInstallRegionCode(map.get("regionCode"));
model.setCode(getCode());
model = projectServiceImpl.createWithModel(model);
Project project = new Project();
BeanUtils.copyProperties(model, project);
System.out.println("项目立项保存信息结束:"+DateUtils.date2LongStr(new Date()));
String token = RequestContext.getToken();
String appKey = RequestContext.getAppKey();
String product = RequestContext.getProduct();
//分支线程执行流程
Thread t1 = new Thread(new Runnable() {
@Override
public void run() {
RequestContext.setToken(token);
RequestContext.setAppKey(appKey);
RequestContext.setProduct(product);
projectInitiationService.start(project);
}
});
t1.start();
return ResponseHelper.buildResponse(model);
}
// 静态变量存储最大值
private static final AtomicInteger atomicNum = new AtomicInteger();
private static final Integer INIT_CODE_NUM = 0;
public String getCode(){
String date = new SimpleDateFormat("yyyy").format(new Date());
String code = "XM"+date+"-";
String format="";
String projectCode = "";
LambdaQueryWrapper<Project> wrapper = new LambdaQueryWrapper<>();
wrapper.orderByDesc(Project::getCode);
List<Project> list = projectServiceImpl.list(wrapper);
if(!ValidationUtil.isEmpty(list)){
projectCode =list.iterator().next().getCode();
if(!ValidationUtil.isEmpty(projectCode)){
String proDate = projectCode.substring(projectCode.indexOf("M")+1,projectCode.length() - 5);
if (proDate.equals(date)){
String substring = projectCode.substring(projectCode.length() - 4);
atomicNum.set(Integer.parseInt(substring));
}else {
atomicNum.set(INIT_CODE_NUM);
}
format = String.format("%04d", atomicNum.incrementAndGet());
}
}else {
format = String.format("%04d", atomicNum.incrementAndGet());
}
return code+format;
}
public Map<String,String> getInfo(String regionName,String regionCode,Long sequenceNbr){
RegionModel region = Systemctl.regionClient.getRegion(sequenceNbr).getResult();
regionName = region.getRegionName() + regionName;
if(ValidationUtil.isEmpty(regionCode)){
regionCode = String.valueOf(region.getRegionCode());
} else {
regionCode = region.getRegionCode() +"#" +regionCode;
}
Map<String,String> map = new HashMap();
if(region.getParentId() != 0L){
map = getInfo(regionName,regionCode,region.getParentId());
} else {
map.put("regionName",regionName);
}
map.put("regionCode",regionCode);
return map;
} }
/** /**
...@@ -374,7 +296,7 @@ public class ProjectController extends BaseController { ...@@ -374,7 +296,7 @@ public class ProjectController extends BaseController {
if(ValidationUtil.isEmpty(option)){ if(ValidationUtil.isEmpty(option)){
option = "1"; option = "1";
} }
projectInitiationService.execute(project.getInstanceId(),jsonObject,option); projectInitiationService.execute(project.getInstanceId(),jsonObject,option,null);
return ResponseHelper.buildResponse("ok"); return ResponseHelper.buildResponse("ok");
} }
...@@ -394,12 +316,12 @@ public class ProjectController extends BaseController { ...@@ -394,12 +316,12 @@ public class ProjectController extends BaseController {
jsonObject.put(XJConstant.PROCESS_PROJECT_STATE,"立项成功"); jsonObject.put(XJConstant.PROCESS_PROJECT_STATE,"立项成功");
if("0".equals(option)){ if("0".equals(option)){
jsonObject.put(XJConstant.PROCESS_PROJECT_STATE,"项目退回"); jsonObject.put(XJConstant.PROCESS_PROJECT_STATE,"项目退回");
projectInitiationService.execute(project.getInstanceId(),jsonObject,option); projectInitiationService.execute(project.getInstanceId(),jsonObject,option,null);
projectInitiationService.execute(project.getInstanceId(),jsonObject,option); projectInitiationService.execute(project.getInstanceId(),jsonObject,option,null);
}else if("2".equals(option)){ }else if("2".equals(option)){
jsonObject.put(XJConstant.PROCESS_PROJECT_STATE,"项目需重新提交资料"); jsonObject.put(XJConstant.PROCESS_PROJECT_STATE,"项目需重新提交资料");
} }
projectInitiationService.execute(project.getInstanceId(),jsonObject,option); projectInitiationService.execute(project.getInstanceId(),jsonObject,option,null);
return ResponseHelper.buildResponse("ok"); return ResponseHelper.buildResponse("ok");
} }
......
...@@ -25,15 +25,21 @@ public class ProjectInitiationController { ...@@ -25,15 +25,21 @@ public class ProjectInitiationController {
@GetMapping(value = "/start") @GetMapping(value = "/start")
@ApiOperation(httpMethod = "GET", value = "流程启动", notes = "流程启动") @ApiOperation(httpMethod = "GET", value = "流程启动", notes = "流程启动")
public ResponseModel<String> start() throws Exception { public ResponseModel<String> start() throws Exception {
projectInitiationServiceImpl.start(new Project()); return ResponseHelper.buildResponse(projectInitiationServiceImpl.startTest(new Project()));
return ResponseHelper.buildResponse("ok");
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/execute/{instanceId}") @GetMapping(value = "/execute/{instanceId}")
@ApiOperation(httpMethod = "GET", value = "流程启动", notes = "流程启动") @ApiOperation(httpMethod = "GET", value = "流程启动", notes = "流程启动")
public ResponseModel<String> execute(@PathVariable("instanceId")String instanceId, Object object, String option) throws Exception { public ResponseModel<String> execute(@PathVariable("instanceId")String instanceId, String condition,String option) throws Exception {
projectInitiationServiceImpl.execute(instanceId,object,option); return ResponseHelper.buildResponse( projectInitiationServiceImpl.executeTest(instanceId,condition,option));
return ResponseHelper.buildResponse("ok"); }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/getTaskList/{instanceId}")
@ApiOperation(httpMethod = "GET", value = "流程启动", notes = "流程启动")
public ResponseModel<String> getTaskList(@PathVariable("instanceId")String instanceId) throws Exception {
projectInitiationServiceImpl.getTaskList(instanceId);
return ResponseHelper.buildResponse("");
} }
} }
...@@ -32,6 +32,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil; ...@@ -32,6 +32,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
...@@ -380,8 +381,26 @@ public class CompanyServiceImpl extends BaseService<CompanyDto, Company, Company ...@@ -380,8 +381,26 @@ public class CompanyServiceImpl extends BaseService<CompanyDto, Company, Company
return model; return model;
} }
public void getRegionTree(Collection col){ public JSONObject getUnitLicenseCode(Long unitId) {
UnitLicence unitLicence = new UnitLicence();
Company company = companyServiceImpl.getById(unitId);
String creditCode = company.getCreditCode();
LambdaQueryWrapper<UnitLicence> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(UnitLicence::getUnitCode, creditCode);
List<UnitLicence> list = unitLicenceService.list(wrapper);
Iterator<UnitLicence> iterator = list.iterator();
String licenseCode = "";
while (iterator.hasNext()) {
unitLicence = iterator.next();
if(ValidationUtil.isEmpty(licenseCode)){
licenseCode = unitLicence.getCertNo();
} else {
licenseCode = licenseCode + "," + unitLicence.getCertNo();
}
}
JSONObject jsonObject = new JSONObject();
jsonObject.put("licenseCode",licenseCode);
return jsonObject;
} }
public void syncCompany(Object object) throws Exception { public void syncCompany(Object object) throws Exception {
......
...@@ -34,11 +34,12 @@ public class IPipeServiceImpl extends BaseService<PipeDto, Pipe, PipeMapper> imp ...@@ -34,11 +34,12 @@ public class IPipeServiceImpl extends BaseService<PipeDto, Pipe, PipeMapper> imp
lambda.eq(Pipe::getProjectId, projectId); lambda.eq(Pipe::getProjectId, projectId);
pipeMapper.delete(lambda); pipeMapper.delete(lambda);
userList.forEach(item -> { userList.forEach(item -> {
item.setStartPosition(item.getStartPositionObject().getString("latitude")+","+item.getStartPositionObject().getString("longitude"));
item.setEndPosition(item.getEndPositionObject().getString("latitude")+","+item.getEndPositionObject().getString("longitude"));
item.setProjectId(projectId); item.setProjectId(projectId);
this.createWithModel(item); this.createWithModel(item);
}); });
} }
} }
@Override @Override
......
...@@ -159,7 +159,7 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta ...@@ -159,7 +159,7 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta
this.saveOrUpdate(installNotice); this.saveOrUpdate(installNotice);
if(NoticeStatusEnum.已提交.getName().equals(noticeStatus)){ if(NoticeStatusEnum.已提交.getName().equals(noticeStatus)){
projectInitiationServiceImpl.execute(projectDto.getInstanceId(),installNoticeDto,"1"); projectInitiationServiceImpl.execute(projectDto.getInstanceId(),installNoticeDto,"1",null);
} }
return installNoticeDto; return installNoticeDto;
} }
......
...@@ -97,7 +97,11 @@ public class ProblemInitiationServiceImpl { ...@@ -97,7 +97,11 @@ public class ProblemInitiationServiceImpl {
System.out.println("流程启动失败:"+e.getMessage()); System.out.println("流程启动失败:"+e.getMessage());
} }
qualityProblem.setInstanceId(instanceId); qualityProblem.setInstanceId(instanceId);
qualityProblem.setStatus(projectInitiationService.getFlowTaskName(instanceId)); try {
qualityProblem.setStatus(projectInitiationService.getFlowTaskName(instanceId));
} catch (Exception e) {
e.printStackTrace();
}
qualityProblem.setProcessProgress(ProblemProcessEnum.statusMap.get(qualityProblem.getStatus())); qualityProblem.setProcessProgress(ProblemProcessEnum.statusMap.get(qualityProblem.getStatus()));
qualityProblemService.updateById(qualityProblem); qualityProblemService.updateById(qualityProblem);
sendSms(JSONObject.parseObject(JSONObject.toJSONString(qualityProblem)), SMSEnum.质量问题短信.getCode()); sendSms(JSONObject.parseObject(JSONObject.toJSONString(qualityProblem)), SMSEnum.质量问题短信.getCode());
...@@ -150,10 +154,7 @@ public class ProblemInitiationServiceImpl { ...@@ -150,10 +154,7 @@ public class ProblemInitiationServiceImpl {
Workflow.taskClient.completeByTask(projectInitiation.getTaskId(),dto); Workflow.taskClient.completeByTask(projectInitiation.getTaskId(),dto);
//保存日志 //保存日志
projectInitiationService.save(projectInitiation); projectInitiationService.save(projectInitiation);
} catch (Exception e) {
e.printStackTrace();
System.out.println("任务完成失败:"+e.getMessage());
} finally {
//更新任务表的状态 已办 //更新任务表的状态 已办
taskType = getUnitId(unitIds, objectd); taskType = getUnitId(unitIds, objectd);
taskService.saveOrUpdateTask(objectd.getStatus(), true, taskType, new Date(), object.getLong("sequenceNbr"), TaskTypeEnum.质量问题.getKey(), unitIds,null); taskService.saveOrUpdateTask(objectd.getStatus(), true, taskType, new Date(), object.getLong("sequenceNbr"), TaskTypeEnum.质量问题.getKey(), unitIds,null);
...@@ -167,6 +168,9 @@ public class ProblemInitiationServiceImpl { ...@@ -167,6 +168,9 @@ public class ProblemInitiationServiceImpl {
unitIds = new ArrayList<>(); unitIds = new ArrayList<>();
taskType = getUnitId(unitIds, objectd); taskType = getUnitId(unitIds, objectd);
taskService.saveOrUpdateTask(objectd.getStatus(), false, taskType, new Date(), object.getLong("sequenceNbr"), TaskTypeEnum.质量问题.getKey(), unitIds,null); taskService.saveOrUpdateTask(objectd.getStatus(), false, taskType, new Date(), object.getLong("sequenceNbr"), TaskTypeEnum.质量问题.getKey(), unitIds,null);
} catch (Exception e) {
e.printStackTrace();
System.out.println("任务完成失败:"+e.getMessage());
} }
} }
...@@ -432,7 +436,11 @@ public class ProblemInitiationServiceImpl { ...@@ -432,7 +436,11 @@ public class ProblemInitiationServiceImpl {
LambdaQueryWrapper<QualityProblem> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<QualityProblem> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(QualityProblem::getInstanceId,instanceId); wrapper.eq(QualityProblem::getInstanceId,instanceId);
QualityProblem qualityProblem = qualityProblemService.getOne(wrapper); QualityProblem qualityProblem = qualityProblemService.getOne(wrapper);
qualityProblem.setStatus(projectInitiationService.getFlowTaskName(instanceId)); try {
qualityProblem.setStatus(projectInitiationService.getFlowTaskName(instanceId));
} catch (Exception e) {
e.printStackTrace();
}
qualityProblem.setProcessProgress(ProblemProcessEnum.statusMap.get(qualityProblem.getStatus())); qualityProblem.setProcessProgress(ProblemProcessEnum.statusMap.get(qualityProblem.getStatus()));
qualityProblemService.updateById(qualityProblem); qualityProblemService.updateById(qualityProblem);
} }
...@@ -530,7 +538,7 @@ public class ProblemInitiationServiceImpl { ...@@ -530,7 +538,7 @@ public class ProblemInitiationServiceImpl {
projectInitiation.setType(ProcessTypeEnum.人工处理.getType()); projectInitiation.setType(ProcessTypeEnum.人工处理.getType());
projectInitiationService.save(projectInitiation); projectInitiationService.save(projectInitiation);
// 更新关联表数据 // 更新关联表数据
iProcessRelationService.updateState(qualityProblem.getInstanceId()); iProcessRelationService.updateState(qualityProblem.getInstanceId(),null);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.ugp.api.mapper.ProcessRelationMapper; ...@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.ugp.api.mapper.ProcessRelationMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IProcessRelationService; import com.yeejoin.amos.boot.module.ugp.api.service.IProcessRelationService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
@Service @Service
...@@ -39,16 +40,22 @@ public class ProcessRelationServiceImpl extends BaseService<ProcessRelationDto, ...@@ -39,16 +40,22 @@ public class ProcessRelationServiceImpl extends BaseService<ProcessRelationDto,
* 更新资源流程关系信息 state字段 * 更新资源流程关系信息 state字段
* *
* @param instanceId 流程实例id * @param instanceId 流程实例id
* @Param taskName 任务节点名称,可为null
*/ */
@Override @Override
public void updateState(String instanceId){ public void updateState(String instanceId,String taskName){
LambdaQueryWrapper<ProcessRelation> wrapper = new LambdaQueryWrapper(); LambdaQueryWrapper<ProcessRelation> wrapper = new LambdaQueryWrapper();
wrapper.eq(ProcessRelation::getInstanceId,instanceId); wrapper.eq(ProcessRelation::getInstanceId,instanceId);
// .eq(ProcessRelation::getSourceId,sourceId).eq(ProcessRelation::getDefName,processName);
ProcessRelation processRelation = this.getOne(wrapper); ProcessRelation processRelation = this.getOne(wrapper);
String taskName = projectInitiationService.getFlowTaskName(instanceId); try {
processRelation.setStatus(taskName); if(ValidationUtil.isEmpty(taskName)) {
this.updateById(processRelation); taskName = projectInitiationService.getFlowTaskName(instanceId);
}
processRelation.setStatus(taskName);
this.updateById(processRelation);
} catch (Exception e) {
e.printStackTrace();
}
} }
} }
...@@ -175,6 +175,7 @@ public class QualityProblemServiceImpl extends BaseService<QualityProblemDto,Qua ...@@ -175,6 +175,7 @@ public class QualityProblemServiceImpl extends BaseService<QualityProblemDto,Qua
//拿到qualityProblem更新到数据库 //拿到qualityProblem更新到数据库
quality.setReformLimitDate(qualityProblem.getDateTime()); quality.setReformLimitDate(qualityProblem.getDateTime());
problemInitiationService.execute(quality.getInstanceId(),quality,"0"); problemInitiationService.execute(quality.getInstanceId(),quality,"0");
}else { }else {
problemInitiationService.execute(quality.getInstanceId(),quality,"1"); problemInitiationService.execute(quality.getInstanceId(),quality,"1");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment