GoOutBusiness.java 2.21 KB
Newer Older
1 2
package cn.timer.api.utils.router.business;

3
import org.springframework.beans.factory.annotation.Autowired;
tangzhaoqian committed
4
import org.springframework.stereotype.Service;
5 6 7

import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil;
8
import cn.hutool.json.JSONObject;
9 10
import cn.timer.api.controller.kqgl.service.KqglService;
import cn.timer.api.dto.kqmk.AttEvectionApprovalDto;
11
import cn.timer.api.dto.spmk.FromData;
12 13
import cn.timer.api.utils.DateUtil;
import lombok.Builder;
14 15

/**
16
 * 外出-业务
17 18 19
 * @author Tang
 *
 */
tangzhaoqian committed
20
@Service
21 22
public class GoOutBusiness extends SpmkAssoBusiness {

23 24 25
	@Autowired
	private KqglService kqglService;
	
26 27 28 29
	@Override
	public void handleApprove(JSONObject jsonObj) throws Exception {
		// TODO Auto-generated method stub
		// 发起人企业id
tangzhaoqian committed
30
		Integer orgCode = ObjectUtil.isNull(jsonObj.get("orgCode")) ? null : Convert.toInt(jsonObj.get("orgCode"));
31
		// 发起人id
tangzhaoqian committed
32
		Integer id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : Integer.parseInt(jsonObj.get("id",FromData.class).getValue());
33 34
		// 发起人名称
		String initiator = jsonObj.get("initiator",FromData.class).getValue();
35 36 37
		
		// 审批汇总id
		String approveId = ObjectUtil.isNull(jsonObj.get("approveId",FromData.class)) ? null : jsonObj.get("approveId",FromData.class).getValue();
38 39 40 41 42 43 44 45 46 47 48
		// 开始时间
		String startTime = jsonObj.get("__startTime",FromData.class).getValue();
		// 结束时间
		String endTime = jsonObj.get("__endTime",FromData.class).getValue();
		// 时长
		String longTime = jsonObj.get("__longTime",FromData.class).getValue();
		// 出差事由
		String businessTrip = jsonObj.get("__businessTrip",FromData.class).getValue();
		// 上传文件
		String UploadAttachment = jsonObj.get("UploadAttachment",FromData.class).getValue();
		
49 50
		AttEvectionApprovalDto eaD = AttEvectionApprovalDto
				.builder()
tangzhaoqian committed
51 52
				.userid(id)
				.orgcode(orgCode)
53 54 55 56
				.evectionid(Convert.toInt(approveId))
				.evectiontype(2)
				.starttime(DateUtil.getStringTime(startTime, "yyyy-MM-dd HH:mm:ss"))
				.endtime(DateUtil.getStringTime(endTime, "yyyy-MM-dd HH:mm:ss"))
57
				.duration(Convert.toDouble(longTime))
58 59
				.build();
				
tangzhaoqian committed
60
		System.out.println("外出:" + eaD);
61 62
		// 调 考勤管理 业务-外出
		kqglService.attevectionapproval(eaD);
63 64 65
	}

}