|
@@ -1,573 +0,0 @@
|
|
|
-package com.idea.oa.apply.controller;
|
|
|
-
|
|
|
-import com.alibaba.fastjson.JSONArray;
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.idea.oa.apply.model.ApplyAddWorkTime;
|
|
|
-import com.idea.oa.apply.model.ApplyAddWorkTimeExample;
|
|
|
-import com.idea.oa.apply.model.inout.AddConfirmResult;
|
|
|
-import com.idea.oa.apply.model.inout.ApplyAddWorkIn;
|
|
|
-import com.idea.oa.apply.service.ApplyAddWorkService;
|
|
|
-import com.idea.oa.apply.service.ApplyAddWorkTimeService;
|
|
|
-import com.idea.oa.apply.util.constant.ConstantFlowType;
|
|
|
-import com.idea.oa.flow2.model.FlowMain;
|
|
|
-import com.idea.oa.flow2.model.FlowMainPush;
|
|
|
-import com.idea.oa.flow2.model.in.FlowMainCcVo;
|
|
|
-import com.idea.oa.flow2.service.FlowMainCcService;
|
|
|
-import com.idea.oa.flow2.service.FlowMainPushService;
|
|
|
-import com.idea.oa.flow2.service.FlowMainService;
|
|
|
-//import com.idea.oa.holidayManagement.model.HolidayManagement;
|
|
|
-//import com.idea.oa.holidayManagement.model.HolidayManagementExample;
|
|
|
-//import com.idea.oa.holidayManagement.service.HolidayManagementService;
|
|
|
-//import com.idea.oa.workAttendance.model.WorkAttendanceLog;
|
|
|
-//import com.idea.oa.workAttendance.service.WorkAttendanceLogService;
|
|
|
-import com.rockstar.common.base.BaseController;
|
|
|
-import com.rockstar.common.domain.AjaxResult;
|
|
|
-import com.rockstar.flow.exception.FlowException;
|
|
|
-import com.rockstar.frame.model.FrameUser;
|
|
|
-import com.rockstar.frame.service.FrameUserService;
|
|
|
-import com.rockstar.shiro.util.ShiroUtils;
|
|
|
-import com.rockstar.util.UUIDUtils;
|
|
|
-import io.swagger.annotations.Api;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.stereotype.Controller;
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
-import org.springframework.util.StringUtils;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-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 on 2023
|
|
|
- */
|
|
|
-@Controller
|
|
|
-@RequestMapping(value = "/ApplyAddWorkController")
|
|
|
-@Api(value = "分表_加班申请")
|
|
|
-public class ApplyAddWorkController extends BaseController {
|
|
|
-// @Autowired
|
|
|
-// private WorkAttendanceLogService workAttendanceLogService;
|
|
|
-// @Autowired
|
|
|
-// private HolidayManagementService holidayManagementService;
|
|
|
- //主表
|
|
|
- @Autowired
|
|
|
- private ApplyAddWorkService modelService;
|
|
|
- @Autowired
|
|
|
- private ApplyAddWorkTimeService applyAddWorkTimeService;
|
|
|
- @Autowired
|
|
|
- private FlowMainCcService flowMainCcService;
|
|
|
- @Autowired
|
|
|
- private FlowMainPushService flowMainPushService;
|
|
|
- @Autowired
|
|
|
- private FlowMainService flowMainService;
|
|
|
-
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private FrameUserService frameUserService;
|
|
|
-
|
|
|
- /**
|
|
|
- * 添加审核结果
|
|
|
- * 根据不同的状态值confirmResult判断是 1:审核通过,转下一步;2:退回发起人;3:退回上节点;4:结束流程;
|
|
|
- *
|
|
|
- * @param addConfirmResult
|
|
|
- * @return
|
|
|
- */
|
|
|
- @PostMapping(value = "AddConfirmResultAddWork", produces = {"application/json;charset=UTF-8"})
|
|
|
- @ResponseBody
|
|
|
- @Transactional
|
|
|
- public AjaxResult AddConfirmResultAddWork(AddConfirmResult addConfirmResult) throws FlowException {
|
|
|
- System.out.println("AddConfirmResultAddWork");
|
|
|
- System.out.println(addConfirmResult);
|
|
|
- if (addConfirmResult.getConfirmResult() == null) {
|
|
|
- return result(-1);
|
|
|
- }
|
|
|
-// String deploymentid = ConstantFlowType.USE_MONEY_DEPLOYMENTID;
|
|
|
-// String constantFlowType = ConstantFlowType.USE_MONEY;
|
|
|
- FlowMainPush flowMainPush = flowMainPushService.selectByPrimaryKey(addConfirmResult.getFlowMainPushId());
|
|
|
-
|
|
|
-
|
|
|
- ApplyAddWorkTimeExample example = new ApplyAddWorkTimeExample();
|
|
|
- example.createCriteria().andAddWorkIdEqualTo(flowMainPush.getFormId());
|
|
|
- List<ApplyAddWorkTime> applyAddWorkTimes = applyAddWorkTimeService.selectByExample(example);
|
|
|
- BigDecimal totalAddTime = new BigDecimal(0);//所有加班小时
|
|
|
-
|
|
|
- String isOkString = null;
|
|
|
- {//进行审核判断
|
|
|
- {
|
|
|
-// ApplyOffWork applyOffWork = modelService.selectByPrimaryKey(flowMainPush.getFormId());
|
|
|
- for (ApplyAddWorkTime applyAddWorkTime : applyAddWorkTimes) {
|
|
|
- {//修改请假表,将请假表的对应数据添加冻结时间,并减去可用时间
|
|
|
- totalAddTime= totalAddTime.add(new BigDecimal(applyAddWorkTime.getUseTime().toString()), MathContext.DECIMAL32);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //添加判断条件
|
|
|
- HashMap<String, Object> feeMoneyTotalMap = null;//new HashMap<>();
|
|
|
-// if (totalTiaoXiu.doubleValue() > 0 && totalNianJia.doubleValue() <= 0 && totalShiJia.doubleValue() <= 0) {
|
|
|
-// //假别仅有调休假
|
|
|
-//// String isExchangeOnly = conditionMap.get("isExchangeOnly").toString();
|
|
|
-//// Integer applyDay = Integer.valueOf(conditionMap.get("applyDay").toString());
|
|
|
-// feeMoneyTotalMap.put("isExchangeOnly", "yes");
|
|
|
-// feeMoneyTotalMap.put("applyDay", 0);
|
|
|
-// } else if (totalTiaoXiu.add(totalNianJia).add(totalShiJia).doubleValue() > 3) {
|
|
|
-//// 假期天数合计>3天
|
|
|
-// feeMoneyTotalMap.put("isExchangeOnly", "no");
|
|
|
-// feeMoneyTotalMap.put("applyDay", 4);
|
|
|
-// } else {
|
|
|
-// feeMoneyTotalMap.put("isExchangeOnly", "no");
|
|
|
-// feeMoneyTotalMap.put("applyDay", 0);
|
|
|
-// }
|
|
|
- isOkString = flowMainService.doConfirmResult(addConfirmResult, ConstantFlowType.ADD_WORK_DEPLOYMENTID, ConstantFlowType.ADD_WORK, flowMainPush, feeMoneyTotalMap);
|
|
|
- if (!"ok_end".equals(isOkString) && !"ok_noEnd".equals(isOkString)) {
|
|
|
- return AjaxResult.error(isOkString);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- Boolean isEnd = false;//是否结束
|
|
|
- Boolean isAgree = false;//是否同意
|
|
|
- if (addConfirmResult.getConfirmResult().equals("4")) {//结束流程
|
|
|
- isEnd = true;
|
|
|
- isAgree = false;
|
|
|
- } else if (addConfirmResult.getConfirmResult().equals("1")) {//1:审核通过,转下一步
|
|
|
- if ("ok_end".equals(isOkString)) {
|
|
|
- isEnd = true;
|
|
|
- isAgree = true;
|
|
|
- }
|
|
|
- }
|
|
|
- //添加业务信息(将请假信息中的修改掉,剩余年假,剩余调休,冻结年假,冻结调休都修改掉)
|
|
|
- if (isEnd) {
|
|
|
-// String createdById = applyAddWorkTimes.get(0).getCreatedBy();
|
|
|
-// HolidayManagementExample holidayManagementExample = new HolidayManagementExample();
|
|
|
-// holidayManagementExample.createCriteria().andUserIdEqualTo(createdById);
|
|
|
-// List<HolidayManagement> holidayManagements = holidayManagementService.selectByExample(holidayManagementExample);
|
|
|
-// if (holidayManagements.isEmpty()) {
|
|
|
-// FrameUser frameUser = frameUserService.selectByPrimaryKey(createdById);
|
|
|
-// // 添加holidayManagements信息
|
|
|
-// HolidayManagement entity = new HolidayManagement();
|
|
|
-// entity.setId(UUIDUtils.middleUUID());
|
|
|
-//
|
|
|
-// entity.setUserId(createdById);
|
|
|
-// entity.setJoinDay(frameUser.getCreatedat());
|
|
|
-//
|
|
|
-// entity.setStatus(0);//状态0正常,1删除,2禁用
|
|
|
-// entity.setIsFirst(1);//是否是第一次录入管理1是,0不是
|
|
|
-// entity.setCreatedAt(new Date());
|
|
|
-// entity.setUpdatedAt(entity.getCreatedAt());
|
|
|
-// entity.setCreatedBy(ShiroUtils.getUser().getId());
|
|
|
-// entity.setUpdatedBy(entity.getCreatedBy());
|
|
|
-//
|
|
|
-// int insert = holidayManagementService.insertWithoutId(entity);
|
|
|
-// holidayManagements.add(entity);
|
|
|
-// }
|
|
|
-// if (isAgree) {//如果是最后 并且同意了,就进行下面的操作,或者不同意就进行另一种操作,
|
|
|
-// this.booleanIsAgree(totalAddTime,holidayManagements,applyAddWorkTimes,createdById);
|
|
|
-//
|
|
|
-//
|
|
|
-// } else {
|
|
|
-// //如果是不同意
|
|
|
-// {
|
|
|
-//// 不需要做什么
|
|
|
-// }
|
|
|
-// }
|
|
|
- }
|
|
|
-
|
|
|
- return result(1);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 发起付款申请流程
|
|
|
- *
|
|
|
- * @param record
|
|
|
- * @return
|
|
|
- */
|
|
|
- @PostMapping(value = "addApplyAddWork", produces = {"application/json;charset=UTF-8"})
|
|
|
- @ResponseBody
|
|
|
- @Transactional
|
|
|
- public AjaxResult addApplyAddWork(ApplyAddWorkIn record) throws FlowException {
|
|
|
- System.out.println("addApplyAddWork");
|
|
|
- System.out.println(record);
|
|
|
- if (false) {
|
|
|
- return AjaxResult.error("这是一个错误测试信息");
|
|
|
- }
|
|
|
- return myaddApplyPayment(record,null);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 申请人重新发起申请
|
|
|
- *
|
|
|
- * @param record
|
|
|
- * @return
|
|
|
- */
|
|
|
- @PostMapping(value = "addApplyAddWorkAgain", produces = {"application/json;charset=UTF-8"})
|
|
|
- @ResponseBody
|
|
|
- @Transactional
|
|
|
- public AjaxResult addApplyAddWorkAgain(ApplyAddWorkIn record) throws FlowException {
|
|
|
- System.out.println("addApplyAddWorkAgain");
|
|
|
- if (StringUtils.isEmpty(record.getFlowMainId())) {
|
|
|
- return AjaxResult.error("没有传入flowMainId的值");
|
|
|
- }
|
|
|
- System.out.println(record);
|
|
|
-// record.setRemark("重新发起申请[" + record.getFlowMainId() + "],");
|
|
|
- {//修改重新发起前的表状态
|
|
|
- FlowMain flowMain1 = new FlowMain();
|
|
|
- flowMain1.setId(record.getFlowMainId());
|
|
|
- flowMain1.setReturnStatus(1);//0/null无状态,1已撤回并且已重新发起
|
|
|
- flowMain1.setUpdatedAt(new Date());
|
|
|
- flowMain1.setUpdatedBy(ShiroUtils.getUser().getId());
|
|
|
- flowMainService.updateByPrimaryKeySelective(flowMain1);
|
|
|
- }
|
|
|
- return myaddApplyPayment(record,"重新发起申请[" + record.getFlowMainId() + "],");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 发起请假申请流程
|
|
|
- *
|
|
|
- * @param record
|
|
|
- * @return
|
|
|
- */
|
|
|
- public AjaxResult myaddApplyPayment(ApplyAddWorkIn record,String addSystemRemark) throws FlowException {
|
|
|
- if (StringUtils.isEmpty(record.getApplyAddWorkTimeString())) {
|
|
|
- return AjaxResult.error("没有获取到请假详细信息,请重新确认");
|
|
|
- }
|
|
|
- BigDecimal totalAddTime = new BigDecimal(0);//所有加班小时
|
|
|
-
|
|
|
- {
|
|
|
- record.setUpdatedAt(new Date());
|
|
|
- record.setCreatedAt(record.getUpdatedAt());
|
|
|
- record.setCreatedBy(ShiroUtils.getUser().getId());
|
|
|
- record.setUpdatedBy(record.getCreatedBy());
|
|
|
- record.setStatus(0);
|
|
|
- modelService.insert(record);
|
|
|
-
|
|
|
- String applyAddWorkTimeString = record.getApplyAddWorkTimeString();
|
|
|
- JSONArray jsonArray = JSONArray.parseArray(applyAddWorkTimeString);
|
|
|
-
|
|
|
-
|
|
|
- for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
- JSONObject object = jsonArray.getJSONObject(i);
|
|
|
- ApplyAddWorkTime applyAddWorkTime = JSONObject.parseObject(object.toJSONString(), ApplyAddWorkTime.class);// 将string类型直接封装成对象
|
|
|
-
|
|
|
- applyAddWorkTime.setAddWorkId(record.getId());
|
|
|
-
|
|
|
-
|
|
|
- applyAddWorkTime.setUpdatedAt(new Date());
|
|
|
- applyAddWorkTime.setCreatedAt(applyAddWorkTime.getUpdatedAt());
|
|
|
- applyAddWorkTime.setCreatedBy(ShiroUtils.getUser().getId());
|
|
|
- applyAddWorkTime.setUpdatedBy(applyAddWorkTime.getCreatedBy());
|
|
|
- applyAddWorkTime.setStatus(0);
|
|
|
-
|
|
|
- // 做一个方法,计算加班时间
|
|
|
-// BigDecimal addTime=null;
|
|
|
-// applyAddWorkTime.setUseTime(addTime);
|
|
|
- applyAddWorkTimeService.insert(applyAddWorkTime);
|
|
|
-
|
|
|
- {//修改请假表,将请假表的对应数据添加冻结时间,并减去可用时间
|
|
|
-
|
|
|
- totalAddTime = totalAddTime.add(new BigDecimal(applyAddWorkTime.getUseTime().toString()), MathContext.DECIMAL32);
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- if (totalAddTime.doubleValue() > 0) {
|
|
|
- /**
|
|
|
- * 做一个方法,修改年假表的数据
|
|
|
- */
|
|
|
- //这里没有要做的事情
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- HashMap<String, Object> feeMoneyTotalMap = null;//new HashMap<>();
|
|
|
-// if (totalTiaoXiu.doubleValue() > 0 && totalNianJia.doubleValue() <= 0 && totalShiJia.doubleValue() <= 0) {
|
|
|
-// //假别仅有调休假
|
|
|
-//// String isExchangeOnly = conditionMap.get("isExchangeOnly").toString();
|
|
|
-//// Integer applyDay = Integer.valueOf(conditionMap.get("applyDay").toString());
|
|
|
-// feeMoneyTotalMap.put("isExchangeOnly", "yes");
|
|
|
-// feeMoneyTotalMap.put("applyDay", 0);
|
|
|
-// } else if (totalTiaoXiu.add(totalNianJia).add(totalShiJia).doubleValue() > 3) {
|
|
|
-//// 假期天数合计>3天
|
|
|
-// feeMoneyTotalMap.put("isExchangeOnly", "no");
|
|
|
-// feeMoneyTotalMap.put("applyDay", 4);
|
|
|
-// } else {
|
|
|
-// feeMoneyTotalMap.put("isExchangeOnly", "no");
|
|
|
-// feeMoneyTotalMap.put("applyDay", 0);
|
|
|
-// }
|
|
|
-// feeMoneyTotalMap.put("billMoney", feeMoneyTotalDouble);
|
|
|
- String applyTheme = "" + ShiroUtils.getUser().getTruename() + "的加班申请单";
|
|
|
- AjaxResult ajaxResult = flowMainService.doFlowMain(applyTheme, record.getId(), addSystemRemark, record.getCcList(),
|
|
|
- ConstantFlowType.ADD_WORK_PROCESSDEFINE, ConstantFlowType.ADD_WORK_DEPLOYMENTID,
|
|
|
- feeMoneyTotalMap, ConstantFlowType.ADD_WORK_NAME, ConstantFlowType.ADD_WORK,ShiroUtils.getUser());
|
|
|
-
|
|
|
- if (ajaxResult.get("code").equals(1688)) {
|
|
|
-// //表成功了 且已经审核完成
|
|
|
-//// 需要进行后续的处理
|
|
|
-// Boolean isEnd = true;//是否结束
|
|
|
-// Boolean isAgree = true;//是否同意
|
|
|
-//
|
|
|
-// //添加业务信息(将请假信息中的修改掉,剩余年假,剩余调休,冻结年假,冻结调休都修改掉)
|
|
|
-// if (isEnd) {
|
|
|
-// String createdById = record.getCreatedBy();
|
|
|
-// HolidayManagementExample holidayManagementExample = new HolidayManagementExample();
|
|
|
-// holidayManagementExample.createCriteria().andUserIdEqualTo(createdById);
|
|
|
-// List<HolidayManagement> holidayManagements = holidayManagementService.selectByExample(holidayManagementExample);
|
|
|
-// if (holidayManagements.isEmpty()) {
|
|
|
-// // 添加holidayManagements信息
|
|
|
-// FrameUser frameUser = frameUserService.selectByPrimaryKey(createdById);
|
|
|
-// HolidayManagement entity = new HolidayManagement();
|
|
|
-// entity.setId(UUIDUtils.middleUUID());
|
|
|
-//
|
|
|
-// entity.setUserId(createdById);
|
|
|
-// entity.setJoinDay(frameUser.getCreatedat());
|
|
|
-//
|
|
|
-// entity.setStatus(0);//状态0正常,1删除,2禁用
|
|
|
-// entity.setIsFirst(1);//是否是第一次录入管理1是,0不是
|
|
|
-// entity.setCreatedAt(new Date());
|
|
|
-// entity.setUpdatedAt(entity.getCreatedAt());
|
|
|
-// entity.setCreatedBy(ShiroUtils.getUser().getId());
|
|
|
-// entity.setUpdatedBy(entity.getCreatedBy());
|
|
|
-//
|
|
|
-// int insert = holidayManagementService.insertWithoutId(entity);
|
|
|
-// holidayManagements.add(entity);
|
|
|
-// }
|
|
|
-// if (isAgree) {//如果是最后 并且同意了,就进行下面的操作,或者不同意就进行另一种操作,
|
|
|
-// ApplyAddWorkTimeExample example = new ApplyAddWorkTimeExample();
|
|
|
-// example.createCriteria().andAddWorkIdEqualTo(record.getId());
|
|
|
-// List<ApplyAddWorkTime> applyAddWorkTimes = applyAddWorkTimeService.selectByExample(example);
|
|
|
-//
|
|
|
-// this.booleanIsAgree(totalAddTime,holidayManagements,applyAddWorkTimes,createdById);
|
|
|
-//
|
|
|
-//
|
|
|
-// } else {
|
|
|
-// //如果是不同意
|
|
|
-// {
|
|
|
-//// 不需要做什么
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
- return AjaxResult.success();
|
|
|
- } else {
|
|
|
-
|
|
|
- return ajaxResult;
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 审核或申请结束且同意的情况下进行的处理
|
|
|
- */
|
|
|
-// public void booleanIsAgree(BigDecimal totalAddTime,List<HolidayManagement> holidayManagements,List<ApplyAddWorkTime> applyAddWorkTimes,String createdById){
|
|
|
-// //如果是同意了
|
|
|
-// {
|
|
|
-// HolidayManagement holidayManagement = holidayManagements.get(0);
|
|
|
-// if (totalAddTime.doubleValue() > 0) {//存在加班修改
|
|
|
-// Double restExchangeTime = holidayManagement.getRestExchangeTime();
|
|
|
-// if(null==restExchangeTime)restExchangeTime=0.0;
|
|
|
-//// Double restHolidayTime = holidayManagement.getRestHolidayTime();
|
|
|
-// double v = new BigDecimal(restExchangeTime).add(totalAddTime, MathContext.DECIMAL32).doubleValue();
|
|
|
-// holidayManagement.setRestExchangeTime(v);
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-// holidayManagement.setUpdatedBy(ShiroUtils.getUser().getId());
|
|
|
-// holidayManagement.setUpdatedAt(new Date());
|
|
|
-//
|
|
|
-// holidayManagementService.updateByPrimaryKeySelective(holidayManagement);
|
|
|
-// }
|
|
|
-//
|
|
|
-// {//审核通过后 在oa_work_attendance_log表中添加记录
|
|
|
-// for (ApplyAddWorkTime applyAddWorkTime : applyAddWorkTimes) {
|
|
|
-// WorkAttendanceLog workAttendanceLog = new WorkAttendanceLog();
|
|
|
-//
|
|
|
-//
|
|
|
-//// //=========================下面是重要的数据
|
|
|
-//// user_id varchar (64) DEFAULT NULL COMMENT '用户id 姓名/部门/岗位',
|
|
|
-//// `do_day`date DEFAULT NULL COMMENT '发生的日期',
|
|
|
-//// `happen_type` int(4) DEFAULT NULL COMMENT
|
|
|
-//// '1年假,2调休,3事假,4病假,5婚假,6产假,7陪产假,8丧假,9加班,10迟到,11早退,12旷工,13外出,14居家,15出差',
|
|
|
-//// //=========================上面是重要的数据
|
|
|
-//// do_start_time datetime DEFAULT NULL COMMENT '发生开始时间',
|
|
|
-//// do_end_time datetime DEFAULT NULL COMMENT '发生结束时间',
|
|
|
-//// `use_time`decimal(5, 2) DEFAULT NULL COMMENT '消耗时间(比如加班/调休时间小时)',
|
|
|
-//// from_table_id varchar(64) DEFAULT NULL COMMENT '来源表id',
|
|
|
-//// from_table_name varchar(64) DEFAULT NULL COMMENT '来源表名称',
|
|
|
-//
|
|
|
-// workAttendanceLog.setUserId(createdById);
|
|
|
-// workAttendanceLog.setDoDay(applyAddWorkTime.getStartDay());
|
|
|
-// workAttendanceLog.setHappenType(9);//'1年假,2调休,3事假,4病假,5婚假,6产假,7陪产假,8丧假,9加班,10迟到,11早退,12旷工,13外出,14居家,15出差',
|
|
|
-// workAttendanceLog.setDoStartTime(applyAddWorkTime.getStartTime());
|
|
|
-// workAttendanceLog.setDoEndTime(applyAddWorkTime.getEndTime());
|
|
|
-// workAttendanceLog.setUseTime(applyAddWorkTime.getUseTime());
|
|
|
-// workAttendanceLog.setFromTableId(applyAddWorkTime.getId());
|
|
|
-// workAttendanceLog.setFromTableName("apply_add_work_time");
|
|
|
-//
|
|
|
-//
|
|
|
-// workAttendanceLog.setCreatedBy(ShiroUtils.getUser().getId());
|
|
|
-// workAttendanceLog.setCreatedAt(new Date());
|
|
|
-// workAttendanceLog.setStatus(0);
|
|
|
-// workAttendanceLog.setUpdatedAt(workAttendanceLog.getCreatedAt());
|
|
|
-// workAttendanceLog.setUpdatedBy(workAttendanceLog.getCreatedBy());
|
|
|
-// int result = workAttendanceLogService.insert(workAttendanceLog);
|
|
|
-// }
|
|
|
-//
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
- /**
|
|
|
- * 根据推送表的FlowMainPushId获取信息
|
|
|
- *
|
|
|
- * @param flowMainPushId
|
|
|
- * @return
|
|
|
- */
|
|
|
- @PostMapping(value = "getInfoByFlowMainPushId", produces = {"application/json;charset=UTF-8"})
|
|
|
- @ResponseBody
|
|
|
- public ApplyAddWorkIn getInfoByFlowMainPushId(String flowMainPushId) {
|
|
|
- ApplyAddWorkIn myApplyAddWorkIn = modelService.getInfoByFlowMainPushId(flowMainPushId);
|
|
|
- if (myApplyAddWorkIn != null) {
|
|
|
- {//获取抄送人
|
|
|
-// FlowMainCcExample example = new FlowMainCcExample();
|
|
|
-// example.createCriteria().andFlowMainIdEqualTo(myApplyUseMoneyIn.getFlowMainId());
|
|
|
-// List<FlowMainCc> flowMainCcList = flowMainCcService.selectByExample(example);
|
|
|
- List<FlowMainCcVo> flowMainCcList = flowMainCcService.selectVoByFlowMainId(myApplyAddWorkIn.getFlowMainId());
|
|
|
-// HashSet<String> set = new HashSet<>();
|
|
|
-// for (FlowMainCc flowMainCc : flowMainCcList) {
|
|
|
-// set.add(flowMainCc.getCcUser());
|
|
|
-// }
|
|
|
-// StringBuilder stringBuilder = new StringBuilder();
|
|
|
-// if (!set.isEmpty()) {
|
|
|
-// for (String s : set) {
|
|
|
-// stringBuilder.append(s + ",");
|
|
|
-// }
|
|
|
-// }
|
|
|
-// myApplyUseMoneyIn.setCcList(stringBuilder.toString());
|
|
|
- myApplyAddWorkIn.setFlowMainCcList(flowMainCcList);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- {//获取apply_use_money_detail数据
|
|
|
- ApplyAddWorkTimeExample example = new ApplyAddWorkTimeExample();
|
|
|
- example.createCriteria().andAddWorkIdEqualTo(myApplyAddWorkIn.getId());
|
|
|
- List<ApplyAddWorkTime> ApplyAddWorkTimes = applyAddWorkTimeService.selectByExample(example);
|
|
|
- myApplyAddWorkIn.setApplyAddWorkTimeList(ApplyAddWorkTimes);
|
|
|
- }
|
|
|
- }
|
|
|
- return myApplyAddWorkIn;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 根据主表的FlowMainId获取信息
|
|
|
- *
|
|
|
- * @param flowMainId
|
|
|
- * @return
|
|
|
- */
|
|
|
- @PostMapping(value = "getInfoByFlowMainId", produces = {"application/json;charset=UTF-8"})
|
|
|
- @ResponseBody
|
|
|
- public ApplyAddWorkIn getInfoByFlowMainId(String flowMainId) {
|
|
|
- ApplyAddWorkIn myApplyAddWorkIn = modelService.getInfoByFlowMainId(flowMainId);
|
|
|
- if (myApplyAddWorkIn != null) {
|
|
|
- {//获取抄送人
|
|
|
-// FlowMainCcExample example = new FlowMainCcExample();
|
|
|
-// example.createCriteria().andFlowMainIdEqualTo(myApplyUseMoneyIn.getFlowMainId());
|
|
|
-// List<FlowMainCc> flowMainCcList = flowMainCcService.selectByExample(example);
|
|
|
- List<FlowMainCcVo> flowMainCcList = flowMainCcService.selectVoByFlowMainId(myApplyAddWorkIn.getFlowMainId());
|
|
|
-// HashSet<String> set = new HashSet<>();
|
|
|
-// for (FlowMainCc flowMainCc : flowMainCcList) {
|
|
|
-// set.add(flowMainCc.getCcUser());
|
|
|
-// }
|
|
|
-// StringBuilder stringBuilder = new StringBuilder();
|
|
|
-// if (!set.isEmpty()) {
|
|
|
-// for (String s : set) {
|
|
|
-// stringBuilder.append(s + ",");
|
|
|
-// }
|
|
|
-// }
|
|
|
-// myApplyUseMoneyIn.setCcList(stringBuilder.toString());
|
|
|
- myApplyAddWorkIn.setFlowMainCcList(flowMainCcList);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- {//获取apply_use_money_detail数据
|
|
|
- ApplyAddWorkTimeExample example = new ApplyAddWorkTimeExample();
|
|
|
- example.createCriteria().andAddWorkIdEqualTo(myApplyAddWorkIn.getId());
|
|
|
- List<ApplyAddWorkTime> ApplyOffWorkTimes = applyAddWorkTimeService.selectByExample(example);
|
|
|
- myApplyAddWorkIn.setApplyAddWorkTimeList(ApplyOffWorkTimes);
|
|
|
- }
|
|
|
- }
|
|
|
- return myApplyAddWorkIn;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 根据用户id获取用户姓名和部门名称,岗位信息
|
|
|
- *
|
|
|
- * @param userId
|
|
|
- * @return
|
|
|
- */
|
|
|
- @PostMapping(value = "getUserInfoByUserId", produces = {"application/json;charset=UTF-8"})
|
|
|
- @ResponseBody
|
|
|
- public Map<String, Object> getUserInfoByUserId(String userId) {
|
|
|
- if (StringUtils.isEmpty(userId)) {
|
|
|
- userId = ShiroUtils.getUser().getId();
|
|
|
- }
|
|
|
- return modelService.getUserInfoByUserId(userId);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- //=====下面原生的=============================================================================================================
|
|
|
-
|
|
|
-
|
|
|
-// @PostMapping(value = "list",produces = {"application/json;charset=UTF-8"})
|
|
|
-// @ResponseBody
|
|
|
-// public Object list(Tablepar tablepar, ApplyAddWork model, DateTrans dt){
|
|
|
-// PageInfo<ApplyAddWork> page= modelService.list(tablepar,model,dt);
|
|
|
-// TableSplitResult<ApplyAddWork> result=new TableSplitResult<ApplyAddWork>(page.getPageNum(), page.getTotal(), page.getList());
|
|
|
-// return result;
|
|
|
-// }
|
|
|
-//
|
|
|
-// @PostMapping(value = "listAll",produces = {"application/json;charset=UTF-8"})
|
|
|
-// @ResponseBody
|
|
|
-// public Object listAll(ApplyAddWork model, DateTrans dt){
|
|
|
-// return modelService.listAll(model,dt);
|
|
|
-// }
|
|
|
-//
|
|
|
-// @PostMapping(value = "add",produces = {"application/json;charset=UTF-8"})
|
|
|
-// @ResponseBody
|
|
|
-// public AjaxResult add(ApplyAddWork record){
|
|
|
-// record.setCreatedAt(new Date());
|
|
|
-// int result = modelService.insert(record);
|
|
|
-// return result(result);
|
|
|
-// }
|
|
|
-//
|
|
|
-// @PostMapping(value = "remove/{id}",produces = {"application/json;charset=UTF-8"})
|
|
|
-// @ResponseBody
|
|
|
-// public AjaxResult remove(@PathVariable("id") String id){
|
|
|
-// int result = -1;//modelService.deleteByPrimaryKey(id);
|
|
|
-// return result(result);
|
|
|
-// }
|
|
|
-//
|
|
|
-// @PostMapping(value = "edit",produces = {"application/json;charset=UTF-8"})
|
|
|
-// @ResponseBody
|
|
|
-// public AjaxResult editSave(ApplyAddWork model){
|
|
|
-// int result = modelService.updateByPrimaryKeySelective(model);
|
|
|
-// return result(result);
|
|
|
-// }
|
|
|
-//
|
|
|
-// @PostMapping(value = "getById",produces = {"application/json;charset=UTF-8"})
|
|
|
-// @ResponseBody
|
|
|
-// public ApplyAddWork getById(String id) {
|
|
|
-// return modelService.selectByPrimaryKey(id);
|
|
|
-// }
|
|
|
-
|
|
|
-
|
|
|
-}
|