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

销假申请,出差申请提交工作流选择审批人修改

上级 dde8ab58
......@@ -106,22 +106,6 @@ public class CheckWorkBusinessTripController {
checkWorkBusinessTripService.queryCheckWorkBusinessTripDetailsById(inputObject, outputObject);
}
/**
*
* @Title: updateCheckWorkBusinessTripByIdInProcess
* @Description: 在工作流中编辑出差申请
* @param inputObject
* @param outputObject
* @throws Exception 参数
* @return void 返回类型
* @throws
*/
@RequestMapping("/post/CheckWorkBusinessTripController/updateCheckWorkBusinessTripByIdInProcess")
@ResponseBody
public void updateCheckWorkBusinessTripByIdInProcess(InputObject inputObject, OutputObject outputObject) throws Exception{
checkWorkBusinessTripService.updateCheckWorkBusinessTripByIdInProcess(inputObject, outputObject);
}
/**
*
* @Title: editCheckWorkBusinessTripToSubApproval
......
......@@ -109,22 +109,6 @@ public class CheckWorkCancelLeaveController {
checkWorkCancelLeaveService.queryCheckWorkCancelLeaveDetailsById(inputObject, outputObject);
}
/**
*
* @Title: updateCheckWorkCancelLeaveByIdInProcess
* @Description: 在工作流中编辑销假申请
* @param inputObject
* @param outputObject
* @throws Exception 参数
* @return void 返回类型
* @throws
*/
@RequestMapping("/post/CheckWorkCancelLeaveController/updateCheckWorkCancelLeaveByIdInProcess")
@ResponseBody
public void updateCheckWorkCancelLeaveByIdInProcess(InputObject inputObject, OutputObject outputObject) throws Exception{
checkWorkCancelLeaveService.updateCheckWorkCancelLeaveByIdInProcess(inputObject, outputObject);
}
/**
*
* @Title: editCheckWorkCancelLeaveToSubApproval
......
......@@ -29,8 +29,6 @@ public interface CheckWorkBusinessTripService {
public void queryCheckWorkBusinessTripDetailsById(InputObject inputObject, OutputObject outputObject) throws Exception;
public void updateCheckWorkBusinessTripByIdInProcess(InputObject inputObject, OutputObject outputObject) throws Exception;
public void editCheckWorkBusinessTripToSubApproval(InputObject inputObject, OutputObject outputObject) throws Exception;
public void updateCheckWorkBusinessTripToCancellation(InputObject inputObject, OutputObject outputObject) throws Exception;
......
......@@ -28,8 +28,6 @@ public interface CheckWorkCancelLeaveService {
public void queryCheckWorkCancelLeaveDetailsById(InputObject inputObject, OutputObject outputObject) throws Exception;
public void updateCheckWorkCancelLeaveByIdInProcess(InputObject inputObject, OutputObject outputObject) throws Exception;
public void editCheckWorkCancelLeaveToSubApproval(InputObject inputObject, OutputObject outputObject) throws Exception;
public void updateCheckWorkCancelLeaveToCancellation(InputObject inputObject, OutputObject outputObject) throws Exception;
......
......@@ -6,6 +6,8 @@ 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.annotation.transaction.ActivitiAndBaseTransaction;
import com.skyeye.common.constans.ActivitiConstants;
import com.skyeye.common.constans.CheckWorkConstants;
import com.skyeye.common.constans.Constants;
......@@ -41,6 +43,9 @@ public class CheckWorkBusinessTripServiceImpl implements CheckWorkBusinessTripSe
@Autowired
private SysEnclosureDao sysEnclosureDao;
@Autowired
private ActivitiUserService activitiUserService;
/**
* 出差申请关联的工作流的key
*/
......@@ -66,7 +71,7 @@ public class CheckWorkBusinessTripServiceImpl implements CheckWorkBusinessTripSe
* @throws Exception
*/
@Override
@Transactional(value="transactionManager")
@ActivitiAndBaseTransaction(value = {"activitiTransactionManager", "transactionManager"})
public void insertCheckWorkBusinessTripMation(InputObject inputObject, OutputObject outputObject) throws Exception {
Map<String, Object> map = inputObject.getParams();
// 出差申请id
......@@ -85,11 +90,9 @@ public class CheckWorkBusinessTripServiceImpl implements CheckWorkBusinessTripSe
map.put("createTime", DateUtil.getTimeAndToString());
checkWorkBusinessTripDao.insertCheckWorkBusinessTripMation(map);
checkWorkBusinessTripDao.insertCheckWorkBusinessTripDaysMation(beans);
// 判断是否提交审批
if("2".equals(map.get("subType").toString())){
// 提交审批
ActivitiRunFactory.run(inputObject, outputObject, CHECK_WORK_BUSINESS_TRIP_KEY).submitToActivi(businessTripId, ActivitiConstants.APPROVAL_ID);
}
// 操作工作流数据
activitiUserService.addOrEditToSubmit(inputObject, outputObject, Integer.parseInt(map.get("subType").toString()),
CHECK_WORK_BUSINESS_TRIP_KEY, businessTripId, map.get("approvalId").toString());
}
private List<Map<String, Object>> getBusinessTripDays(String businessTripDayStr, String businessTripId) {
......@@ -132,7 +135,7 @@ public class CheckWorkBusinessTripServiceImpl implements CheckWorkBusinessTripSe
* @throws Exception
*/
@Override
@Transactional(value="transactionManager")
@ActivitiAndBaseTransaction(value = {"activitiTransactionManager", "transactionManager"})
public void updateCheckWorkBusinessTripById(InputObject inputObject, OutputObject outputObject) throws Exception {
Map<String, Object> map = inputObject.getParams();
// 出差申请id
......@@ -146,11 +149,9 @@ public class CheckWorkBusinessTripServiceImpl implements CheckWorkBusinessTripSe
checkWorkBusinessTripDao.updateCheckWorkBusinessTripMation(map);
checkWorkBusinessTripDao.deleteCheckWorkBusinessTripDaysMationByBusinessTripId(businessTripId);
checkWorkBusinessTripDao.insertCheckWorkBusinessTripDaysMation(beans);
// 判断是否提交审批
if("2".equals(map.get("subType").toString())){
// 提交审批
ActivitiRunFactory.run(inputObject, outputObject, CHECK_WORK_BUSINESS_TRIP_KEY).submitToActivi(businessTripId, ActivitiConstants.APPROVAL_ID);
}
// 操作工作流数据
activitiUserService.addOrEditToSubmit(inputObject, outputObject, Integer.parseInt(map.get("subType").toString()),
CHECK_WORK_BUSINESS_TRIP_KEY, businessTripId, map.get("approvalId").toString());
}
/**
......@@ -173,32 +174,6 @@ public class CheckWorkBusinessTripServiceImpl implements CheckWorkBusinessTripSe
outputObject.setBean(bean);
}
/**
* 在工作流中编辑出差申请
*
* @param inputObject
* @param outputObject
* @throws Exception
*/
@Override
@Transactional(value="transactionManager")
public void updateCheckWorkBusinessTripByIdInProcess(InputObject inputObject, OutputObject outputObject) throws Exception {
Map<String, Object> map = inputObject.getParams();
// 出差申请id
String businessTripId = map.get("id").toString();
// 处理出差天数
List<Map<String, Object>> beans = getBusinessTripDays(map.get("businessTripDayStr").toString(), businessTripId);
if(beans.size() == 0){
outputObject.setreturnMessage("请填写出差日期.");
return;
}
checkWorkBusinessTripDao.updateCheckWorkBusinessTripMation(map);
checkWorkBusinessTripDao.deleteCheckWorkBusinessTripDaysMationByBusinessTripId(businessTripId);
checkWorkBusinessTripDao.insertCheckWorkBusinessTripDaysMation(beans);
// 编辑工作流中的数据
ActivitiRunFactory.run(inputObject, outputObject, CHECK_WORK_BUSINESS_TRIP_KEY).editApplyMationInActiviti(businessTripId);
}
/**
* 提交审批出差申请
*
......@@ -207,7 +182,7 @@ public class CheckWorkBusinessTripServiceImpl implements CheckWorkBusinessTripSe
* @throws Exception
*/
@Override
@Transactional(value="transactionManager")
@ActivitiAndBaseTransaction(value = {"activitiTransactionManager", "transactionManager"})
public void editCheckWorkBusinessTripToSubApproval(InputObject inputObject, OutputObject outputObject) throws Exception {
Map<String, Object> map = inputObject.getParams();
String businessTripId = map.get("id").toString();
......@@ -217,7 +192,8 @@ public class CheckWorkBusinessTripServiceImpl implements CheckWorkBusinessTripSe
|| ActivitiConstants.ActivitiState.NO_PASS.getState() == state
|| ActivitiConstants.ActivitiState.REVOKE.getState() == state){
// 草稿、审核不通过或者撤销状态下可以提交审批
ActivitiRunFactory.run(inputObject, outputObject, CHECK_WORK_BUSINESS_TRIP_KEY).submitToActivi(businessTripId, ActivitiConstants.APPROVAL_ID);
activitiUserService.addOrEditToSubmit(inputObject, outputObject, 2,
CHECK_WORK_BUSINESS_TRIP_KEY, businessTripId, map.get("approvalId").toString());
}else{
outputObject.setreturnMessage("该数据状态已改变,请刷新页面!");
}
......@@ -255,7 +231,7 @@ public class CheckWorkBusinessTripServiceImpl implements CheckWorkBusinessTripSe
* @throws Exception
*/
@Override
@Transactional(value="transactionManager")
@ActivitiAndBaseTransaction(value = {"activitiTransactionManager", "transactionManager"})
public void editCheckWorkBusinessTripToRevoke(InputObject inputObject, OutputObject outputObject) throws Exception {
ActivitiRunFactory.run(inputObject, outputObject, CHECK_WORK_BUSINESS_TRIP_KEY).revokeActivi();
}
......
......@@ -6,6 +6,8 @@ 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.annotation.transaction.ActivitiAndBaseTransaction;
import com.skyeye.common.constans.ActivitiConstants;
import com.skyeye.common.constans.Constants;
import com.skyeye.common.object.InputObject;
......@@ -42,6 +44,9 @@ public class CheckWorkCancelLeaveServiceImpl implements CheckWorkCancelLeaveServ
@Autowired
private SysEnclosureDao sysEnclosureDao;
@Autowired
private ActivitiUserService activitiUserService;
/**
* 销假申请关联的工作流的key
*/
......@@ -67,7 +72,7 @@ public class CheckWorkCancelLeaveServiceImpl implements CheckWorkCancelLeaveServ
* @throws Exception
*/
@Override
@Transactional(value="transactionManager")
@ActivitiAndBaseTransaction(value = {"activitiTransactionManager", "transactionManager"})
public void insertCheckWorkCancelLeaveMation(InputObject inputObject, OutputObject outputObject) throws Exception {
Map<String, Object> map = inputObject.getParams();
// 销假申请id
......@@ -86,11 +91,9 @@ public class CheckWorkCancelLeaveServiceImpl implements CheckWorkCancelLeaveServ
map.put("createTime", DateUtil.getTimeAndToString());
checkWorkCancelLeaveDao.insertCheckWorkCancelLeaveMation(map);
checkWorkCancelLeaveDao.insertCheckWorkCancelLeaveDaysMation(beans);
// 判断是否提交审批
if("2".equals(map.get("subType").toString())){
// 提交审批
ActivitiRunFactory.run(inputObject, outputObject, CHECK_WORK_CANCEL_LEAVE_PAGE_KEY).submitToActivi(cancelLeaveId, ActivitiConstants.APPROVAL_ID);
}
// 操作工作流数据
activitiUserService.addOrEditToSubmit(inputObject, outputObject, Integer.parseInt(map.get("subType").toString()),
CHECK_WORK_CANCEL_LEAVE_PAGE_KEY, cancelLeaveId, map.get("approvalId").toString());
}
private List<Map<String, Object>> getCancelLeaveDays(String cancelLeaveDayStr, String cancelLeaveId) {
......@@ -133,7 +136,7 @@ public class CheckWorkCancelLeaveServiceImpl implements CheckWorkCancelLeaveServ
* @throws Exception
*/
@Override
@Transactional(value="transactionManager")
@ActivitiAndBaseTransaction(value = {"activitiTransactionManager", "transactionManager"})
public void updateCheckWorkCancelLeaveById(InputObject inputObject, OutputObject outputObject) throws Exception {
Map<String, Object> map = inputObject.getParams();
// 销假申请id
......@@ -147,11 +150,9 @@ public class CheckWorkCancelLeaveServiceImpl implements CheckWorkCancelLeaveServ
checkWorkCancelLeaveDao.updateCheckWorkCancelLeaveMation(map);
checkWorkCancelLeaveDao.deleteCheckWorkCancelLeaveDaysMationByCancelLeaveId(cancelLeaveId);
checkWorkCancelLeaveDao.insertCheckWorkCancelLeaveDaysMation(beans);
// 判断是否提交审批
if("2".equals(map.get("subType").toString())){
// 提交审批
ActivitiRunFactory.run(inputObject, outputObject, CHECK_WORK_CANCEL_LEAVE_PAGE_KEY).submitToActivi(cancelLeaveId, ActivitiConstants.APPROVAL_ID);
}
// 操作工作流数据
activitiUserService.addOrEditToSubmit(inputObject, outputObject, Integer.parseInt(map.get("subType").toString()),
CHECK_WORK_CANCEL_LEAVE_PAGE_KEY, cancelLeaveId, map.get("approvalId").toString());
}
/**
......@@ -174,32 +175,6 @@ public class CheckWorkCancelLeaveServiceImpl implements CheckWorkCancelLeaveServ
outputObject.setBean(bean);
}
/**
* 在工作流中编辑销假申请
*
* @param inputObject
* @param outputObject
* @throws Exception
*/
@Override
@Transactional(value="transactionManager")
public void updateCheckWorkCancelLeaveByIdInProcess(InputObject inputObject, OutputObject outputObject) throws Exception {
Map<String, Object> map = inputObject.getParams();
// 销假申请id
String cancelLeaveId = map.get("id").toString();
// 处理销假天数
List<Map<String, Object>> beans = getCancelLeaveDays(map.get("cancelLeaveDayStr").toString(), cancelLeaveId);
if(beans.size() == 0){
outputObject.setreturnMessage("请填写销假日期.");
return;
}
checkWorkCancelLeaveDao.updateCheckWorkCancelLeaveMation(map);
checkWorkCancelLeaveDao.deleteCheckWorkCancelLeaveDaysMationByCancelLeaveId(cancelLeaveId);
checkWorkCancelLeaveDao.insertCheckWorkCancelLeaveDaysMation(beans);
// 编辑工作流中的数据
ActivitiRunFactory.run(inputObject, outputObject, CHECK_WORK_CANCEL_LEAVE_PAGE_KEY).editApplyMationInActiviti(cancelLeaveId);
}
/**
* 提交审批销假申请
*
......@@ -208,7 +183,7 @@ public class CheckWorkCancelLeaveServiceImpl implements CheckWorkCancelLeaveServ
* @throws Exception
*/
@Override
@Transactional(value="transactionManager")
@ActivitiAndBaseTransaction(value = {"activitiTransactionManager", "transactionManager"})
public void editCheckWorkCancelLeaveToSubApproval(InputObject inputObject, OutputObject outputObject) throws Exception {
Map<String, Object> map = inputObject.getParams();
String cancelLeaveId = map.get("id").toString();
......@@ -218,7 +193,8 @@ public class CheckWorkCancelLeaveServiceImpl implements CheckWorkCancelLeaveServ
|| ActivitiConstants.ActivitiState.NO_PASS.getState() == state
|| ActivitiConstants.ActivitiState.REVOKE.getState() == state){
// 草稿、审核不通过或者撤销状态下可以提交审批
ActivitiRunFactory.run(inputObject, outputObject, CHECK_WORK_CANCEL_LEAVE_PAGE_KEY).submitToActivi(cancelLeaveId, ActivitiConstants.APPROVAL_ID);
activitiUserService.addOrEditToSubmit(inputObject, outputObject, 2,
CHECK_WORK_CANCEL_LEAVE_PAGE_KEY, cancelLeaveId, map.get("approvalId").toString());
}else{
outputObject.setreturnMessage("该数据状态已改变,请刷新页面!");
}
......@@ -256,7 +232,7 @@ public class CheckWorkCancelLeaveServiceImpl implements CheckWorkCancelLeaveServ
* @throws Exception
*/
@Override
@Transactional(value="transactionManager")
@ActivitiAndBaseTransaction(value = {"activitiTransactionManager", "transactionManager"})
public void editCheckWorkCancelLeaveToRevoke(InputObject inputObject, OutputObject outputObject) throws Exception {
ActivitiRunFactory.run(inputObject, outputObject, CHECK_WORK_CANCEL_LEAVE_PAGE_KEY).revokeActivi();
}
......
......@@ -263,6 +263,7 @@
<property id="subType" name="subType" ref="required,num" var="表单提交类型" />
<property id="businessTripAddress" name="businessTripAddress" ref="required" var="出差地点" />
<property id="businessTripReason" name="businessTripReason" ref="required" var="出差事由" />
<property id="approvalId" name="approvalId" ref="" var="[提交审批]操作必填审批人" />
</url>
<url id="checkworkbusinesstrip003" path="/post/CheckWorkBusinessTripController/queryCheckWorkBusinessTripDetailsById" val="出差申请详情" allUse="2" method="GET" groupName="出差申请">
<property id="rowId" name="id" ref="required" var="出差申请主表单id" />
......@@ -278,21 +279,15 @@
<property id="subType" name="subType" ref="required,num" var="表单提交类型" />
<property id="businessTripAddress" name="businessTripAddress" ref="required" var="出差地点" />
<property id="businessTripReason" name="businessTripReason" ref="required" var="出差事由" />
<property id="approvalId" name="approvalId" ref="" var="[提交审批]操作必填审批人" />
</url>
<url id="checkworkbusinesstrip006" path="/post/CheckWorkBusinessTripController/editCheckWorkBusinessTripToSubApproval" val="提交审批出差申请" allUse="1" groupName="出差申请">
<property id="rowId" name="id" ref="required" var="出差申请id" />
<property id="approvalId" name="approvalId" ref="" var="[提交审批]操作必填审批人" />
</url>
<url id="checkworkbusinesstrip007" path="/post/CheckWorkBusinessTripController/updateCheckWorkBusinessTripToCancellation" val="作废出差申请" allUse="1" groupName="出差申请">
<property id="rowId" name="id" ref="required" var="出差申请id" />
</url>
<url id="checkworkbusinesstrip008" path="/post/CheckWorkBusinessTripController/updateCheckWorkBusinessTripByIdInProcess" val="在工作流中编辑出差申请" allUse="2" method="PUT" groupName="出差申请">
<property id="rowId" name="id" ref="required" var="出差申请id" />
<property id="businessTripDayStr" name="businessTripDayStr" ref="required,json" var="出差天数json串" />
<property id="remark" name="remark" ref="" var="备注" />
<property id="enclosureInfo" name="enclosureInfo" ref="" var="附件" />
<property id="businessTripAddress" name="businessTripAddress" ref="required" var="出差地点" />
<property id="businessTripReason" name="businessTripReason" ref="required" var="出差事由" />
</url>
<url id="checkworkbusinesstrip009" path="/post/CheckWorkBusinessTripController/editCheckWorkBusinessTripToRevoke" val="撤销出差申请" allUse="1" groupName="出差申请">
<property id="processInstanceId" name="processInstanceId" ref="required" var="流程id"/>
</url>
......@@ -360,6 +355,7 @@
<property id="remark" name="remark" ref="" var="备注" />
<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="checkworkcancelleave003" path="/post/CheckWorkCancelLeaveController/queryCheckWorkCancelLeaveDetailsById" val="销假申请详情" allUse="2" method="GET" groupName="销假申请">
<property id="rowId" name="id" ref="required" var="销假申请主表单id" />
......@@ -373,19 +369,15 @@
<property id="remark" name="remark" ref="" var="备注" />
<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="checkworkcancelleave006" path="/post/CheckWorkCancelLeaveController/editCheckWorkCancelLeaveToSubApproval" val="提交审批销假申请" allUse="1" groupName="销假申请">
<property id="rowId" name="id" ref="required" var="销假申请id" />
<property id="approvalId" name="approvalId" ref="" var="[提交审批]操作必填审批人" />
</url>
<url id="checkworkcancelleave007" path="/post/CheckWorkCancelLeaveController/updateCheckWorkCancelLeaveToCancellation" val="作废销假申请" allUse="1" groupName="销假申请">
<property id="rowId" name="id" ref="required" var="销假申请id" />
</url>
<url id="checkworkcancelleave008" path="/post/CheckWorkCancelLeaveController/updateCheckWorkCancelLeaveByIdInProcess" val="在工作流中编辑销假申请" allUse="2" method="PUT" groupName="销假申请">
<property id="rowId" name="id" ref="required" var="销假申请id" />
<property id="leaveDayStr" name="leaveDayStr" ref="required,json" var="销假天数json串" />
<property id="remark" name="remark" ref="" var="备注" />
<property id="enclosureInfo" name="enclosureInfo" ref="" var="附件" />
</url>
<url id="checkworkcancelleave009" path="/post/CheckWorkCancelLeaveController/editCheckWorkCancelLeaveToRevoke" val="撤销销假申请" allUse="1" groupName="销假申请">
<property id="processInstanceId" name="processInstanceId" ref="required" var="流程id"/>
</url>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册