|
|
@@ -10,7 +10,11 @@ import javax.annotation.Resource;
|
|
|
|
|
|
import com.lc.ibps.api.base.model.DefaultNoneUser;
|
|
|
import com.lc.ibps.form.data.exception.DataException;
|
|
|
+import com.lc.ibps.office.provider.BpmInitiatedProvider;
|
|
|
import org.activiti.engine.ActivitiException;
|
|
|
+import org.codehaus.jackson.map.ObjectMapper;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.slf4j.event.Level;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -132,7 +136,9 @@ import net.sf.json.JSONObject;
|
|
|
@Api(tags = "流程实例", value = "流程实例控制类")
|
|
|
@Service
|
|
|
public class BpmInstProvider extends GenericProvider implements IBpmInstService, IBpmInstMgrService {
|
|
|
-
|
|
|
+
|
|
|
+ private static final Logger logger = LoggerFactory.getLogger(BpmInstProvider.class);
|
|
|
+
|
|
|
@Resource
|
|
|
private BpmInstRepository bpmInstRepository;
|
|
|
@Resource
|
|
|
@@ -278,6 +284,26 @@ public class BpmInstProvider extends GenericProvider implements IBpmInstService,
|
|
|
APIResult<Void> result = new APIResult<>();
|
|
|
try {
|
|
|
IbpsProcInstCmd cmd = this.getStartCmd(request);
|
|
|
+ String instId = cmd.getInstId(); //流程实例id
|
|
|
+ String id = "";
|
|
|
+ String businessKey = cmd.getBusData();
|
|
|
+ try {
|
|
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
|
+ Map map = objectMapper.readValue(businessKey, Map.class);
|
|
|
+ id = map.get("id").toString();
|
|
|
+ }catch (Exception e){
|
|
|
+ logger.warn("流程实例数据转map失败");
|
|
|
+ }
|
|
|
+ if(BeanUtils.isNotEmpty(instId) && BeanUtils.isNotEmpty(id) ){ //流程实例id和boid均不为空则进行判断
|
|
|
+ BpmInstPo byIdAndBiz = bpmInstRepository.getByIdAndBiz(instId, id);
|
|
|
+ if(BeanUtils.isNotEmpty(byIdAndBiz) && instId.equals(byIdAndBiz.getId()) && id.equals(byIdAndBiz.getBizKey())){
|
|
|
+ //相同即表示同一条数据
|
|
|
+ logger.warn("当前选择数据已经提交,请确认后操作");
|
|
|
+ result.setMessage("当前选择数据中有已提交的数据,请刷新后在操作");
|
|
|
+ result.setState( StateEnum.WARN.getCode());
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ }
|
|
|
IBpmProcInst procInst = bpmProcInstService.saveDraft(cmd);
|
|
|
result.setMessage(I18nUtil.getMessage("com.lc.ibps.bpmn.provider.BpmInstProvider.saveDraft"));
|
|
|
result.addVariable("proInstId", procInst.getId());
|