|
@@ -2,9 +2,6 @@ package com.idea.oa.flow2.controller;
|
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.idea.oa.activiti.service.ProActiService;
|
|
|
-import com.idea.oa.apply.model.*;
|
|
|
-
|
|
|
-import com.idea.oa.apply.service.*;
|
|
|
import com.idea.oa.apply.util.constant.ConstantFlowType;
|
|
|
import com.idea.oa.apply.util.service.RunerLoadOneService;
|
|
|
import com.idea.oa.flow2.model.FlowMain;
|
|
@@ -19,29 +16,14 @@ import com.idea.oa.flow2.model.out.IMGFlowHistoryInfo;
|
|
|
import com.idea.oa.flow2.service.FlowMainLogService;
|
|
|
import com.idea.oa.flow2.service.FlowMainPushService;
|
|
|
import com.idea.oa.flow2.service.FlowMainService;
|
|
|
-
|
|
|
-//import com.idea.oa.outsource.model.OutOrderMain;
|
|
|
-//import com.idea.oa.outsource.model.OutOrderMainExample;
|
|
|
-//import com.idea.oa.outsource.model.OutOrderPay;
|
|
|
-//import com.idea.oa.outsource.model.OutOrderPayExample;
|
|
|
-//import com.idea.oa.outsource.service.OutOrderMainService;
|
|
|
-//import com.idea.oa.outsource.service.OutOrderPayService;
|
|
|
-import com.idea.util.DateUtils;
|
|
|
-import com.idea.util.OAUtil;
|
|
|
-import com.idea.workPanel.enume.HandleTypeEnum;
|
|
|
-import com.idea.workPanel.mapper.ParkWaitHandleMapper;
|
|
|
-import com.idea.workPanel.model.ParkWaitHandle;
|
|
|
-import com.idea.workPanel.model.ParkWaitHandleExample;
|
|
|
-import com.idea.workPanel.service.ParkWaitHandleService;
|
|
|
+import com.idea.oa.holidayManagement.model.HolidayManagement;
|
|
|
+import com.idea.oa.holidayManagement.service.HolidayManagementService;
|
|
|
import com.rockstar.common.base.BaseController;
|
|
|
import com.rockstar.common.domain.AjaxResult;
|
|
|
import com.rockstar.flow.exception.FlowException;
|
|
|
import com.rockstar.flow.model.FlowDefinition;
|
|
|
import com.rockstar.flow.service.FlowDefinitionService;
|
|
|
import com.rockstar.flow.service.FlowService;
|
|
|
-import com.rockstar.frame.model.FramePermission;
|
|
|
-import com.rockstar.frame.model.FramePermissionExample;
|
|
|
-import com.rockstar.frame.model.FrameUser;
|
|
|
import com.rockstar.frame.model.extend.DateTrans;
|
|
|
import com.rockstar.frame.model.extend.TableSplitResult;
|
|
|
import com.rockstar.frame.model.extend.Tablepar;
|
|
@@ -49,13 +31,11 @@ import com.rockstar.shiro.util.ShiroUtils;
|
|
|
import com.rockstar.util.StringUtils;
|
|
|
import com.rockstar.util.UUIDUtils;
|
|
|
import io.swagger.annotations.Api;
|
|
|
-import lombok.extern.slf4j.Slf4j;
|
|
|
import org.activiti.bpmn.model.SequenceFlow;
|
|
|
import org.activiti.bpmn.model.UserTask;
|
|
|
-import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -64,20 +44,20 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.MathContext;
|
|
|
import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* Created by zt
|
|
|
*/
|
|
|
-@Slf4j
|
|
|
@Controller
|
|
|
@RequestMapping(value = "FlowMainController")
|
|
|
@Api(value = "申请流程/主表_主申请审核表")
|
|
|
public class FlowMainController extends BaseController {
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private HolidayManagementService holidayManagementService;
|
|
|
+
|
|
|
|
|
|
// @Autowired
|
|
|
// private ApplyAddWorkTimeService applyAddWorkTimeService;
|
|
@@ -104,24 +84,6 @@ public class FlowMainController extends BaseController {
|
|
|
// private OutOrderMainService outOrderMainService;
|
|
|
// @Autowired
|
|
|
// private OutOrderPayService outOrderPayService;
|
|
|
- @Autowired
|
|
|
- private ParkWaitHandleService parkWaitHandleService;
|
|
|
- @Autowired
|
|
|
- private ApplyCheckInService applyCheckInService;
|
|
|
- @Autowired
|
|
|
- private ApplyPaymentSettleService applyPaymentSettleService;
|
|
|
- @Autowired
|
|
|
- private ApplyContractService applyContractService;
|
|
|
- @Autowired
|
|
|
- private ApplyReceivablesAdjustService applyReceivablesAdjustService;
|
|
|
- @Autowired
|
|
|
- private ApplyInvoiceRedService applyInvoiceRedService;
|
|
|
- @Autowired
|
|
|
- private ApplyBuyingMoreService applyBuyingMoreService;
|
|
|
- @Autowired
|
|
|
- private ApplyFinanceService applyFinanceService;
|
|
|
-
|
|
|
-
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -171,6 +133,11 @@ public class FlowMainController extends BaseController {
|
|
|
return outgoingFlows;
|
|
|
}
|
|
|
|
|
|
+// @Autowired
|
|
|
+// private ApplyProjectProposalService applyProjectProposalService;
|
|
|
+
|
|
|
+// @Autowired
|
|
|
+// private ProMainService proMainService;
|
|
|
/**
|
|
|
* 申请人撤回申请
|
|
|
* 申请人撤回申请
|
|
@@ -180,7 +147,28 @@ public class FlowMainController extends BaseController {
|
|
|
*/
|
|
|
@PostMapping(value = "recallApply", produces = {"application/json;charset=UTF-8"})
|
|
|
@ResponseBody
|
|
|
+ @Transactional
|
|
|
public AjaxResult recallApply(String flowMainid) {
|
|
|
+ {
|
|
|
+ //业务有需要的话,在这里进行撤回
|
|
|
+ FlowMain flowMain = modelService.selectByPrimaryKey(flowMainid);
|
|
|
+ if ("project_proposal1".equals(flowMain.getFlowType())||"project_proposal".equals(flowMain.getFlowType())){
|
|
|
+// ApplyProjectProposal applyProjectProposal = new ApplyProjectProposal();
|
|
|
+// applyProjectProposal.setId(flowMain.getFormId());
|
|
|
+// applyProjectProposal.setStatus(3);
|
|
|
+// applyProjectProposalService.updateByPrimaryKeySelective(applyProjectProposal);
|
|
|
+//
|
|
|
+// {
|
|
|
+// ApplyProjectProposal applyProjectProposal1 = applyProjectProposalService.selectByPrimaryKey(flowMain.getFormId());
|
|
|
+// String tableProMainId = applyProjectProposal1.getTableProMainId();
|
|
|
+// ProMain proMain = proMainService.selectByPrimaryKey(tableProMainId);
|
|
|
+// //修改项目信息-不通过
|
|
|
+// proMain.setValidstatus("3");
|
|
|
+// proMainService.updateByPrimaryKeySelective(proMain);
|
|
|
+// }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
return modelService.recallApply(flowMainid);
|
|
|
|
|
|
// if (StringUtils.isEmpty(flowMainid)) {
|
|
@@ -446,7 +434,7 @@ public class FlowMainController extends BaseController {
|
|
|
{// 需要工作流引擎的支持
|
|
|
newflowMainPush.setPushUser(entity.getPushEntrustId());//推送人id'
|
|
|
newflowMainPush.setPushUserKey(flowMainPush.getPushUserKey());//推送时彭总给的key值
|
|
|
- newflowMainPush.setNodeName(flowMainPush.getNodeName() + "_流程监控室委托审核");
|
|
|
+ newflowMainPush.setNodeName(flowMainPush.getNodeName() + "_委托审核");
|
|
|
newflowMainPush.setPushType(flowMainPush.getPushType());//推送类型1单流程推送,2串联推送,3并联推送
|
|
|
newflowMainPush.setPushRole(2);//'推送人身份:1本人审核,2被委托人(代理审核人审核权限)',
|
|
|
newflowMainPush.setFlowType(flowMainPush.getFlowType());
|
|
@@ -460,6 +448,7 @@ public class FlowMainController extends BaseController {
|
|
|
newflowMainPush.setCreatedBy(ShiroUtils.getUser().getId());
|
|
|
newflowMainPush.setUpdatedBy(newflowMainPush.getCreatedBy());
|
|
|
newflowMainPush.setGroupId(ShiroUtils.getUser().getGroupId());
|
|
|
+ newflowMainPush.setNodeUserRole(flowMainPush.getNodeUserRole());
|
|
|
newflowMainPush.setStatus(0);
|
|
|
newflowMainPush.setRemark("流程监控委托操作");
|
|
|
flowMainPushService.insert(newflowMainPush);
|
|
@@ -571,111 +560,12 @@ public class FlowMainController extends BaseController {
|
|
|
newflowMainPush.setCreatedBy(ShiroUtils.getUser().getId());
|
|
|
newflowMainPush.setUpdatedBy(newflowMainPush.getCreatedBy());
|
|
|
newflowMainPush.setGroupId(ShiroUtils.getUser().getGroupId());
|
|
|
+ newflowMainPush.setNodeUserRole(flowMainPush.getNodeUserRole());
|
|
|
newflowMainPush.setStatus(0);
|
|
|
flowMainPushService.insert(newflowMainPush);
|
|
|
-
|
|
|
- try {
|
|
|
- FlowMain flowMain = modelService.selectByPrimaryKey(flowMainPush.getFlowMainId());
|
|
|
- // 进行审核操作后 就要处理待办 清除数据
|
|
|
- String param = "id=" + flowMain.getId() + "&flowMainPushId=" + entity.getFlowMainPushId() + "&applyUser=" + flowMain.getApplyUser();
|
|
|
- // 付款申请
|
|
|
- if(flowMain.getFlowType().equals(ConstantFlowType.PAYMENT)){
|
|
|
- String waitUrl = parkWaitHandleService.getUrl("流程审批", "付款流程审批");
|
|
|
- HandleTypeEnum typeEnum = HandleTypeEnum.FK;
|
|
|
- HandleTypeEnum.FK.setUrl(waitUrl);
|
|
|
- // 处理待办
|
|
|
- parkWaitHandleService.userHandle(HandleTypeEnum.FK, param, ShiroUtils.getUserId());
|
|
|
- // 泛微处理待办
|
|
|
- parkWaitHandleService.userHandleOa(entity.getFlowMainPushId(),flowMain);
|
|
|
- // 推送待办和泛微待办
|
|
|
- parkWaitHandleService.pushOaAndHandle(newflowMainPush,flowMain,typeEnum);
|
|
|
- }
|
|
|
- // 入驻申请
|
|
|
- if(flowMain.getFlowType().equals(ConstantFlowType.CHECK_IN)){
|
|
|
- String waitUrl = parkWaitHandleService.getUrl("流程审批", "付款流程审批");
|
|
|
- HandleTypeEnum typeEnum = HandleTypeEnum.RZ;
|
|
|
- HandleTypeEnum.RZ.setUrl(waitUrl);
|
|
|
- // 处理待办
|
|
|
- parkWaitHandleService.userHandle(HandleTypeEnum.RZ, param, ShiroUtils.getUserId());
|
|
|
- // 泛微处理待办
|
|
|
- parkWaitHandleService.userHandleOa(entity.getFlowMainPushId(),flowMain);
|
|
|
- // 推送待办和泛微待办
|
|
|
- parkWaitHandleService.pushOaAndHandle(newflowMainPush,flowMain,typeEnum);
|
|
|
- }
|
|
|
- // 合同用章申请
|
|
|
- if(flowMain.getFlowType().equals(ConstantFlowType.CONTRACT)){
|
|
|
- String waitUrl = parkWaitHandleService.getUrl("流程审批", "付款流程审批");
|
|
|
- HandleTypeEnum typeEnum = HandleTypeEnum.HTYZ;
|
|
|
- HandleTypeEnum.HTYZ.setUrl(waitUrl);
|
|
|
- // 处理待办
|
|
|
- parkWaitHandleService.userHandle(HandleTypeEnum.HTYZ, param, ShiroUtils.getUserId());
|
|
|
- // 泛微处理待办
|
|
|
- parkWaitHandleService.userHandleOa(entity.getFlowMainPushId(),flowMain);
|
|
|
- // 推送待办和泛微待办
|
|
|
- parkWaitHandleService.pushOaAndHandle(newflowMainPush,flowMain,typeEnum);
|
|
|
- }
|
|
|
- // 应收款调整申请
|
|
|
- if(flowMain.getFlowType().equals(ConstantFlowType.RECEIVABLES_ADJUST)){
|
|
|
- String waitUrl = parkWaitHandleService.getUrl("流程审批", "付款流程审批");
|
|
|
- HandleTypeEnum typeEnum = HandleTypeEnum.YSKTZ;
|
|
|
- HandleTypeEnum.YSKTZ.setUrl(waitUrl);
|
|
|
- // 处理待办
|
|
|
- parkWaitHandleService.userHandle(HandleTypeEnum.YSKTZ, param, ShiroUtils.getUserId());
|
|
|
- // 泛微处理待办
|
|
|
- parkWaitHandleService.userHandleOa(entity.getFlowMainPushId(),flowMain);
|
|
|
- // 推送待办和泛微待办
|
|
|
- parkWaitHandleService.pushOaAndHandle(newflowMainPush,flowMain,typeEnum);
|
|
|
- }
|
|
|
- // 发票红冲申请
|
|
|
- if(flowMain.getFlowType().equals(ConstantFlowType.INVOICE_RED)){
|
|
|
- String waitUrl = parkWaitHandleService.getUrl("流程审批", "付款流程审批");
|
|
|
- HandleTypeEnum typeEnum = HandleTypeEnum.FPHC;
|
|
|
- HandleTypeEnum.FPHC.setUrl(waitUrl);
|
|
|
- // 处理待办
|
|
|
- parkWaitHandleService.userHandle(HandleTypeEnum.FPHC, param, ShiroUtils.getUserId());
|
|
|
- // 泛微处理待办
|
|
|
- parkWaitHandleService.userHandleOa(entity.getFlowMainPushId(),flowMain);
|
|
|
- // 推送待办和泛微待办
|
|
|
- parkWaitHandleService.pushOaAndHandle(newflowMainPush,flowMain,typeEnum);
|
|
|
- }
|
|
|
- // 回购申请
|
|
|
- if(flowMain.getFlowType().equals(ConstantFlowType.BUYING_MORE)){
|
|
|
- String waitUrl = parkWaitHandleService.getUrl("流程审批", "付款流程审批");
|
|
|
- HandleTypeEnum typeEnum = HandleTypeEnum.HG;
|
|
|
- HandleTypeEnum.HG.setUrl(waitUrl);
|
|
|
- // 处理待办
|
|
|
- parkWaitHandleService.userHandle(HandleTypeEnum.HG, param, ShiroUtils.getUserId());
|
|
|
- // 泛微处理待办
|
|
|
- parkWaitHandleService.userHandleOa(entity.getFlowMainPushId(),flowMain);
|
|
|
- // 推送待办和泛微待办
|
|
|
- parkWaitHandleService.pushOaAndHandle(newflowMainPush,flowMain,typeEnum);
|
|
|
- }
|
|
|
- // 上交财政申请
|
|
|
- if(flowMain.getFlowType().equals(ConstantFlowType.FINANCE)){
|
|
|
- String waitUrl = parkWaitHandleService.getUrl("流程审批", "付款流程审批");
|
|
|
- HandleTypeEnum typeEnum = HandleTypeEnum.SJCZ;
|
|
|
- HandleTypeEnum.SJCZ.setUrl(waitUrl);
|
|
|
- // 处理待办
|
|
|
- parkWaitHandleService.userHandle(HandleTypeEnum.SJCZ, param, ShiroUtils.getUserId());
|
|
|
- // 泛微处理待办
|
|
|
- parkWaitHandleService.userHandleOa(entity.getFlowMainPushId(),flowMain);
|
|
|
- // 推送待办和泛微待办
|
|
|
- parkWaitHandleService.pushOaAndHandle(newflowMainPush,flowMain,typeEnum);
|
|
|
- }
|
|
|
- }catch (Exception e){
|
|
|
- log.error("推送异常", e);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
return result(1);
|
|
|
}
|
|
|
//=====下面是查询=============================================================================================
|
|
@@ -912,13 +802,51 @@ public class FlowMainController extends BaseController {
|
|
|
|
|
|
FlowMainLog flowMainLog = flowMainLogService.selectByPrimaryKey(flowMain.getLastMainLogId());
|
|
|
if (flowMainLog.getAuditResult().equals("1")) {//最后的操作是同意操作
|
|
|
- if (flowMain.getFlowType().equals(ConstantFlowType.OFF_WORK)) {
|
|
|
- //请假进行回滚
|
|
|
- //1进行请假申请的查询
|
|
|
- //2.如果查到请假中有年假或者调休需要查年假管理表进行修改
|
|
|
- //3.最后删除对应的考勤日志
|
|
|
+ if (flowMain.getFlowType().equals(ConstantFlowType.ADD_WORK)) {
|
|
|
+ //加班进行回滚
|
|
|
+// ApplyAddWorkTimeExample example = new ApplyAddWorkTimeExample();
|
|
|
+// example.createCriteria().andAddWorkIdEqualTo(flowMain.getFormId());
|
|
|
+// List<ApplyAddWorkTime> applyOffWorkTimeList = applyAddWorkTimeService.selectByExample(example);
|
|
|
+ //获取所有的加班时间
|
|
|
+ BigDecimal totaluseTime = new BigDecimal(0);
|
|
|
+ //2========================================================
|
|
|
+ { //获取总共加班时间
|
|
|
+// for (ApplyAddWorkTime applyAddWorkTime : applyOffWorkTimeList) {
|
|
|
+// totaluseTime = totaluseTime.add(applyAddWorkTime.getUseTime(), MathContext.DECIMAL32);
|
|
|
+// }
|
|
|
|
|
|
+ }
|
|
|
+
|
|
|
+ HolidayManagement hoidayManagement = holidayManagementService.selectOneByUserId(flowMain.getApplyUser());
|
|
|
+ {//进行判断
|
|
|
+ if (hoidayManagement == null) {
|
|
|
+ return AjaxResult.error("没有找到用户:" + flowMain.getApplyUser() + "假期信息");
|
|
|
+ }
|
|
|
+ if (!hoidayManagement.getStatus().equals(0)) {
|
|
|
+ return AjaxResult.error("用户:" + flowMain.getApplyUser() + "已经删除,请重新确认");
|
|
|
+ }
|
|
|
+ }
|
|
|
+// 剩余调休假小时(要减去冻结的小时)',
|
|
|
+ Double restExchangeTime = hoidayManagement.getRestExchangeTime();
|
|
|
+
|
|
|
+ if (totaluseTime.doubleValue() > restExchangeTime) {
|
|
|
+ return AjaxResult.error("剩余调休假不够抵扣退回的加班时间,请退回调休时间后再操作");
|
|
|
+ }
|
|
|
|
|
|
+ BigDecimal restExchangeTimeDecimal = new BigDecimal(restExchangeTime).subtract(totaluseTime, MathContext.DECIMAL32);
|
|
|
+ {//修改假期信息
|
|
|
+ HolidayManagement updatehoidayManagement = new HolidayManagement();
|
|
|
+ //restExchangeTimeDecimal放到
|
|
|
+ updatehoidayManagement.setId(hoidayManagement.getId());
|
|
|
+ updatehoidayManagement.setRestExchangeTime(restExchangeTimeDecimal.doubleValue());
|
|
|
+ holidayManagementService.updateByPrimaryKeySelective(updatehoidayManagement);
|
|
|
+ }
|
|
|
+
|
|
|
+// for (ApplyAddWorkTime applyAddWorkTime : applyOffWorkTimeList) {
|
|
|
+// //删除对应的考勤日志
|
|
|
+// workAttendanceLogService.deleteListByTableNameAndTableId("apply_add_work_time", applyAddWorkTime.getId());
|
|
|
+//
|
|
|
+// }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -930,6 +858,15 @@ public class FlowMainController extends BaseController {
|
|
|
record.setUpdatedBy(ShiroUtils.getUser().getId());
|
|
|
|
|
|
int i = modelService.updateByPrimaryKeySelective(record);
|
|
|
+
|
|
|
+ List<FlowMainPush> pushByFlowMainId = flowMainPushService.findPushByFlowMainId(id);
|
|
|
+ for (FlowMainPush flowMainPush : pushByFlowMainId) {
|
|
|
+ flowMainPush.setStatus(1);
|
|
|
+ flowMainPush.setUpdatedAt(new Date());
|
|
|
+ flowMainPush.setUpdatedBy(ShiroUtils.getUser().getId());
|
|
|
+ flowMainPushService.updateByPrimaryKeySelective(flowMainPush);
|
|
|
+ }
|
|
|
+
|
|
|
return result(i);
|
|
|
}
|
|
|
|