ReissueACardBusiness.java 2.53 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;
ilal committed
6
import org.springframework.beans.factory.annotation.Value;
tangzhaoqian committed
7
import org.springframework.stereotype.Service;
8 9

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

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

26 27 28
	@Autowired
	private KqglService kqglService;
	
ilal committed
29 30 31 32 33 34 35 36 37 38 39 40 41 42
	@Value("${config-8timer.environmental-science}")
	public String environmental_science;
	
	public void Logoutput(String science) {
		
		if(!("pro").equals(environmental_science)) {
			
			System.out.println(science);
		}else {
			System.out.println("");
		}
		
	}
	
43
	@Override
44
	public void handleApprove(JSONObject jsonObj) throws ParseException {
45 46
		// TODO Auto-generated method stub
		// 发起人企业id
tangzhaoqian committed
47
		Integer orgCode = ObjectUtil.isNull(jsonObj.get("orgCode")) ? null : Convert.toInt(jsonObj.get("orgCode"));
48
		// 发起人id
tangzhaoqian committed
49
		Integer id = jsonObj.getInt("id");
50
		
51 52
		// 审批汇总id
		String approveId = ObjectUtil.isNull(jsonObj.get("approveId",FromData.class)) ? null : jsonObj.get("approveId",FromData.class).getValue();
tangzhaoqian committed
53
		// 补卡时间 
54
		String PatchCardTime = ObjectUtil.isNull(jsonObj.get("__PatchCardTime",FromData.class)) ? null : jsonObj.get("__PatchCardTime",FromData.class).getValue();
55
		// 缺卡原因
56
		String cardShortage = ObjectUtil.isNull(jsonObj.get("cardShortage",FromData.class)) ? null : jsonObj.get("cardShortage",FromData.class).getValue();
tangzhaoqian committed
57

58
		// 缺卡时段-上班、下班-前端未改
59
		String cardSupplementType = ObjectUtil.isNull(jsonObj.get("__CardSupplementType",FromData.class)) ? null : jsonObj.get("__CardSupplementType",FromData.class).getValue();
60
		
61
		// 上传文件
62
		String UploadAttachment = ObjectUtil.isNull(jsonObj.get("UploadAttachment",FromData.class)) ? null : jsonObj.get("UploadAttachment",FromData.class).getValue();
63
		
64 65
		AttRepairApprovalDto raD = AttRepairApprovalDto
				.builder()
tangzhaoqian committed
66 67
				.userid(id)
				.orgcode(orgCode)
68
				.repairid(Convert.toInt(approveId))
tangzhaoqian committed
69
				.cardrepltime(DateUtil.getFormat(PatchCardTime))
70
				.cardreplperiod(Convert.toInt(cardSupplementType))
71 72
				.build();
				
ilal committed
73
		Logoutput("补卡:"+raD);
74 75
		// 调 考勤管理 业务-补卡
		kqglService.attrepairapproval(raD);
76 77 78
	}

}