ReissueACardBusiness.java 2.31 KB
Newer Older
1 2
package cn.timer.api.utils.router.business;

3 4 5
import java.text.ParseException;

import org.springframework.beans.factory.annotation.Autowired;
tangzhaoqian committed
6
import org.springframework.stereotype.Service;
7 8

import cn.hutool.core.convert.Convert;
9
import cn.hutool.core.util.ObjectUtil;
10
import cn.hutool.json.JSONObject;
11 12
import cn.timer.api.controller.kqgl.service.KqglService;
import cn.timer.api.dto.kqmk.AttRepairApprovalDto;
13
import cn.timer.api.dto.spmk.FromData;
14
import cn.timer.api.utils.DateUtil;
15 16 17 18 19 20 21
import lombok.Builder;

/**
 * 补卡-业务
 * @author Tang
 *
 */
tangzhaoqian committed
22
@Service
23 24
public class ReissueACardBusiness extends SpmkAssoBusiness {

25 26 27
	@Autowired
	private KqglService kqglService;
	
28
	@Override
29
	public void handleApprove(JSONObject jsonObj) throws ParseException {
30 31
		// TODO Auto-generated method stub
		// 发起人企业id
tangzhaoqian committed
32
		Integer orgCode = ObjectUtil.isNull(jsonObj.get("orgCode")) ? null : Convert.toInt(jsonObj.get("orgCode"));
33
		// 发起人id
tangzhaoqian committed
34
		Integer id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : Integer.parseInt(jsonObj.get("id",FromData.class).getValue());
35
		
36 37
		// 审批汇总id
		String approveId = ObjectUtil.isNull(jsonObj.get("approveId",FromData.class)) ? null : jsonObj.get("approveId",FromData.class).getValue();
tangzhaoqian committed
38
		// 补卡时间 
39
		String PatchCardTime = ObjectUtil.isNull(jsonObj.get("__PatchCardTime",FromData.class)) ? null : jsonObj.get("__PatchCardTime",FromData.class).getValue();
40
		// 缺卡原因
41
		String cardShortage = ObjectUtil.isNull(jsonObj.get("cardShortage",FromData.class)) ? null : jsonObj.get("cardShortage",FromData.class).getValue();
42 43
		
		// 缺卡时段-上班、下班-前端未改
44
		String cardreplperiod = ObjectUtil.isNull(jsonObj.get("cardreplperiod",FromData.class)) ? null : jsonObj.get("cardreplperiod",FromData.class).getValue();
45
		
46
		// 上传文件
47
		String UploadAttachment = ObjectUtil.isNull(jsonObj.get("UploadAttachment",FromData.class)) ? null : jsonObj.get("UploadAttachment",FromData.class).getValue();
48
		
49 50
		AttRepairApprovalDto raD = AttRepairApprovalDto
				.builder()
tangzhaoqian committed
51 52
				.userid(id)
				.orgcode(orgCode)
53
				.repairid(Convert.toInt(approveId))
tangzhaoqian committed
54 55
				.cardrepltime(DateUtil.getFormat(PatchCardTime))
//				.cardreplperiod(Convert.toInt(cardreplperiod))
56 57
				.build();
				
tangzhaoqian committed
58
		System.out.println("补卡:"+raD);
59 60
		// 调 考勤管理 业务-补卡
		kqglService.attrepairapproval(raD);
61 62 63
	}

}