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

3 4 5 6 7
import java.text.ParseException;

import org.springframework.beans.factory.annotation.Autowired;

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

/**
 * 补卡-业务
 * @author Tang
 *
 */
@Builder
public class ReissueACardBusiness extends SpmkAssoBusiness {

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

}