Commit d5393e19 authored by chenhao's avatar chenhao

修改错误提交

parent 0703cbc1
package com.yeejoin.amos.boot.module.common.biz.service.impl; package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Random;
import org.apache.commons.lang3.ObjectUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.workflow.RemoteWorkFlowService;
import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto; import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureDetails; import com.yeejoin.amos.boot.module.common.api.entity.FailureDetails;
import com.yeejoin.amos.boot.module.common.api.enums.FailureStatuEnum;
import com.yeejoin.amos.boot.module.common.api.mapper.FailureDetailsMapper; import com.yeejoin.amos.boot.module.common.api.mapper.FailureDetailsMapper;
import com.yeejoin.amos.boot.module.common.api.service.IFailureDetailsService; import com.yeejoin.amos.boot.module.common.api.service.IFailureDetailsService;
...@@ -29,10 +37,12 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa ...@@ -29,10 +37,12 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
@Autowired @Autowired
SourceFileServiceImpl sourceFileServiceImpl; SourceFileServiceImpl sourceFileServiceImpl;
// @Autowired
@Value("${params.work.flow.processDefinitionKey}") // RemoteWorkFlowService remoteWorkFlowService;
private String processDefinitionKey; //
// @Value("${failure.work.flow.processDefinitionKey}")
// private String processDefinitionKey;
private final Logger logger = LoggerFactory.getLogger(FailureDetailsServiceImpl.class); private final Logger logger = LoggerFactory.getLogger(FailureDetailsServiceImpl.class);
...@@ -64,23 +74,46 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa ...@@ -64,23 +74,46 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
/** /**
* 发起故障保修单 * 发起故障保修单
*/ */
// public CommonResponse savemodel(FailureDetailsDto failureDetailsDto) { // public Object savemodel(FailureDetailsDto failureDetailsDto) {
// String businessKey = RandomUtil.buildOrderNo(); // String businessKey = buildOrderNo();
// JSONObject jsonObject = remoteWorkFlow.start( businessKey, processDefinitionKey); // JSONObject jsonObject = remoteWorkFlowService.start( businessKey, processDefinitionKey);
// if (jsonObject == null) { // if (jsonObject == null) {
// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
// return CommonResponseUtil.failure("启动流程失败"); // // return CommonResponseUtil.failure("启动流程失败");
// } // }
// JSONObject instance = jsonObject.getJSONObject("data"); // JSONObject instance = jsonObject.getJSONObject("data");
// if(instance==null){ // if(instance==null){
// return CommonResponseUtil.failure("无提交隐患权限"); // //return CommonResponseUtil.failure("无提交隐患权限");
// } // }
// failureDetailsDto.setCurrentStatus(FailureStatuEnum.WAITING_AUDIT.getCode()); // failureDetailsDto.setCurrentStatus(FailureStatuEnum.WAITING_AUDIT.getCode());
// FailureDetailsDto model = this.createWithModel(failureDetailsDto); // //拿到流程id
// // failureDetailsDto.setProcessId(instance.getString("processInstanceId"));
// sourceFileServiceImpl.saveSourceFile(failureDetailsDto.getSequenceNbr(), failureDetailsDto.getAttachment()); // FailureDetailsDto model =null;
// return CommonResponseUtil.success(model); // try {
// sourceFileServiceImpl.saveSourceFile(failureDetailsDto.getSequenceNbr(), failureDetailsDto.getAttachment());
// model = this.createWithModel(failureDetailsDto);
// } catch (Exception e) {
// logger.info("添加故障维修信息到数据库失败");
// // return CommonResponseUtil.failure("添加失败");
// }
// if(ObjectUtils.isNotEmpty(model)) {
// JSONObject teskObject = remoteWorkFlowService.currentTask(instance.getString("processInstanceId"));
// if(ObjectUtils.isNotEmpty(teskObject)) {
// JSONObject taskDetail = teskObject.getJSONObject("data");
// String taskId = taskDetail.getString("id");
// remoteWorkFlowService.excute(taskId, null);
// }
// }
// return model;
// } // }
// public static String buildOrderNo() {
// SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
// String newDate = sdf.format(new Date());
// String result = "";
// Random random = new Random();
// for (int i = 0; i < 3; i++) {
// result += random.nextInt(10);
// }
// return newDate + result;
// }
} }
\ No newline at end of file
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