提交 9d0e236c 编写于 作者: doc_wei's avatar doc_wei

资产采购申请提交工作流选择审批人修改

上级 88284bc2
......@@ -138,22 +138,6 @@ public class AssetApplyPurchaseController {
assetApplyPurchaseService.updateAssetListToPurchaseById(inputObject, outputObject);
}
/**
*
* @Title: updateAssetListToPurchaseByIdInProcess
* @Description: 在工作流中编辑资产采购申请
* @param inputObject
* @param outputObject
* @throws Exception 参数
* @return void 返回类型
* @throws
*/
@RequestMapping("/post/AssetApplyPurchaseController/updateAssetListToPurchaseByIdInProcess")
@ResponseBody
public void updateAssetListToPurchaseByIdInProcess(InputObject inputObject, OutputObject outputObject) throws Exception{
assetApplyPurchaseService.updateAssetListToPurchaseByIdInProcess(inputObject, outputObject);
}
/**
*
* @Title: editAssetPurchaseToRevoke
......
......@@ -31,8 +31,6 @@ public interface AssetApplyPurchaseService {
public void updateAssetListToPurchaseById(InputObject inputObject, OutputObject outputObject) throws Exception;
public void updateAssetListToPurchaseByIdInProcess(InputObject inputObject, OutputObject outputObject) throws Exception;
public void editAssetPurchaseToRevoke(InputObject inputObject, OutputObject outputObject) throws Exception;
}
......@@ -6,6 +6,7 @@ package com.skyeye.eve.service.impl;
import cn.hutool.json.JSONUtil;
import com.skyeye.activiti.factory.ActivitiRunFactory;
import com.skyeye.activiti.service.ActivitiUserService;
import com.skyeye.common.constans.ActivitiConstants;
import com.skyeye.common.constans.AdminAssistantConstants;
import com.skyeye.common.object.InputObject;
......@@ -45,6 +46,9 @@ public class AssetApplyPurchaseServiceImpl implements AssetApplyPurchaseService
@Autowired
private SysEnclosureDao sysEnclosureDao;
@Autowired
private ActivitiUserService activitiUserService;
/**
* 资产采购关联的工作流的key
*/
......@@ -91,11 +95,9 @@ public class AssetApplyPurchaseServiceImpl implements AssetApplyPurchaseService
map.put("createTime", DateUtil.getTimeAndToString());
assetApplyPurchaseDao.insertAssetPurchaseMation(map);
assetApplyPurchaseDao.insertAssetPurchaseGoodsMation(entitys);
// 判断是否提交审批
if("2".equals(subType)){
// 提交审批
ActivitiRunFactory.run(inputObject, outputObject, ACTIVITI_ASSET_PURCHAES_PAGE_KEY).submitToActivi(purchaseId, ActivitiConstants.APPROVAL_ID);
}
// 操作工作流数据
activitiUserService.addOrEditToSubmit(inputObject, outputObject, Integer.parseInt(map.get("subType").toString()),
ACTIVITI_ASSET_PURCHAES_PAGE_KEY, purchaseId, map.get("approvalId").toString());
}
private List<Map<String, Object>> getAssetMationList(OutputObject outputObject, String assetArticlesStr, String purchaseId, String state) throws Exception {
......@@ -136,7 +138,8 @@ public class AssetApplyPurchaseServiceImpl implements AssetApplyPurchaseService
|| ActivitiConstants.ActivitiState.NO_PASS.getState() == state
|| ActivitiConstants.ActivitiState.REVOKE.getState() == state){
// 草稿、审核不通过或者撤销状态下可以提交审批
ActivitiRunFactory.run(inputObject, outputObject, ACTIVITI_ASSET_PURCHAES_PAGE_KEY).submitToActivi(purchaseId, ActivitiConstants.APPROVAL_ID);
activitiUserService.addOrEditToSubmit(inputObject, outputObject, 2,
ACTIVITI_ASSET_PURCHAES_PAGE_KEY, purchaseId, map.get("approvalId").toString());
}else{
outputObject.setreturnMessage("该数据状态已改变,请刷新页面!");
}
......@@ -234,37 +237,9 @@ public class AssetApplyPurchaseServiceImpl implements AssetApplyPurchaseService
assetApplyPurchaseDao.updateAssetPurchaseMation(map);
assetApplyPurchaseDao.deleteAssetPurchaseGoodsMationById(map);
assetApplyPurchaseDao.insertAssetPurchaseGoodsMation(entitys);
// 判断是否提交审批
if("2".equals(subType)){
// 提交审批
ActivitiRunFactory.run(inputObject, outputObject, ACTIVITI_ASSET_PURCHAES_PAGE_KEY).submitToActivi(purchaseId, ActivitiConstants.APPROVAL_ID);
}
}
/**
* 在工作流中编辑资产采购申请
*
* @param inputObject
* @param outputObject
* @throws Exception
*/
@Override
@Transactional(value="transactionManager")
public void updateAssetListToPurchaseByIdInProcess(InputObject inputObject, OutputObject outputObject) throws Exception {
Map<String, Object> map = inputObject.getParams();
String purchaseId = map.get("id").toString();//采购单主表id
// 处理数据
List<Map<String, Object>> entitys = getAssetMationList(outputObject, map.get("assetListStr").toString(), purchaseId, "1");
if (entitys == null) return;
if(entitys.size() == 0){
outputObject.setreturnMessage("请选择资产");
return;
}
assetApplyPurchaseDao.updateAssetPurchaseMation(map);
assetApplyPurchaseDao.deleteAssetPurchaseGoodsMationById(map);
assetApplyPurchaseDao.insertAssetPurchaseGoodsMation(entitys);
// 编辑流程表参数
ActivitiRunFactory.run(inputObject, outputObject, ACTIVITI_ASSET_PURCHAES_PAGE_KEY).editApplyMationInActiviti(purchaseId);
// 操作工作流数据
activitiUserService.addOrEditToSubmit(inputObject, outputObject, Integer.parseInt(map.get("subType").toString()),
ACTIVITI_ASSET_PURCHAES_PAGE_KEY, purchaseId, map.get("approvalId").toString());
}
/**
......
......@@ -1030,9 +1030,11 @@
<property id="assetListStr" name="assetListStr" ref="required,json" var="采购资产json串" />
<property id="enclosureInfo" name="enclosureInfo" ref="" var="附件" />
<property id="subType" name="subType" ref="required,num" var="表单提交类型" />
<property id="approvalId" name="approvalId" ref="" var="[提交审批]操作必填审批人" />
</url>
<url id="asset020" path="/post/AssetApplyPurchaseController/editAssetPurchaseToSubApproval" val="资产采购申请提交审批" allUse="1" groupName="资产采购申请">
<property id="rowId" name="id" ref="required" var="资产采购主表单id" />
<property id="approvalId" name="approvalId" ref="" var="[提交审批]操作必填审批人" />
</url>
<url id="asset021" path="/post/AssetApplyPurchaseController/queryAssetListPurchaseDetailsById" val="资产采购申请详情" allUse="2" groupName="资产采购申请">
<property id="rowId" name="id" ref="required" var="资产采购主表单id" />
......@@ -1049,12 +1051,7 @@
<property id="enclosureInfo" name="enclosureInfo" ref="" var="附件" />
<property id="rowId" name="id" ref="required" var="资产领用主表单id" />
<property id="subType" name="subType" ref="required,num" var="表单提交类型" />
</url>
<url id="asset034" path="/post/AssetApplyPurchaseController/updateAssetListToPurchaseByIdInProcess" val="在工作流中编辑资产采购申请" allUse="2" groupName="资产采购申请">
<property id="remark" name="remark" ref="" var="描述" />
<property id="assetListStr" name="assetListStr" ref="required,json" var="采购资产json串" />
<property id="enclosureInfo" name="enclosureInfo" ref="" var="附件" />
<property id="rowId" name="id" ref="required" var="资产采购主表单id" />
<property id="approvalId" name="approvalId" ref="" var="[提交审批]操作必填审批人" />
</url>
<url id="asset037" path="/post/AssetApplyPurchaseController/editAssetPurchaseToRevoke" val="撤销资产采购申请" allUse="1" groupName="资产采购申请">
<property id="processInstanceId" name="processInstanceId" ref="required" var="流程id"/>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册