GoOutBusiness.java 1.96 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 = jsonObj.getInt("id");
33 34 35
		
		// 审批汇总id
		String approveId = ObjectUtil.isNull(jsonObj.get("approveId",FromData.class)) ? null : jsonObj.get("approveId",FromData.class).getValue();
36 37 38 39 40 41 42 43 44 45 46
		// 开始时间
		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();
		
47 48
		AttEvectionApprovalDto eaD = AttEvectionApprovalDto
				.builder()
tangzhaoqian committed
49 50
				.userid(id)
				.orgcode(orgCode)
51 52
				.evectionid(Convert.toInt(approveId))
				.evectiontype(2)
53 54
				.starttime(DateUtil.getFormat(startTime))
				.endtime(DateUtil.getFormat(endTime))
55
				.duration(Convert.toDouble(longTime))
56 57
				.build();
				
tangzhaoqian committed
58
		System.out.println("外出:" + eaD);
59 60
		// 调 考勤管理 业务-外出
		kqglService.attevectionapproval(eaD);
61 62 63
	}

}