ResignationBusiness.java 2.29 KB
Newer Older
1 2
package cn.timer.api.utils.router.business;

3 4
import java.text.ParseException;

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

tangzhaoqian committed
9
import cn.hutool.core.convert.Convert;
10
import cn.hutool.core.util.ObjectUtil;
11
import cn.hutool.json.JSONObject;
12
import cn.timer.api.controller.yggl.service.YgglService;
13
import cn.timer.api.dto.spmk.FromData;
14 15
import cn.timer.api.dto.yggl.LzygQueryDto;
import cn.timer.api.utils.DateFormatUtils;
16
import cn.timer.api.utils.DateUtil;
17 18 19 20 21 22 23
import lombok.Builder;

/**
 * 离职-业务
 * @author Tang
 *
 */
tangzhaoqian committed
24
@Service
25 26
public class ResignationBusiness extends SpmkAssoBusiness {

27 28 29
	@Autowired
	private YgglService ygglService;
	
ilal committed
30 31 32 33 34 35 36 37 38 39 40 41 42 43
	@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("");
		}
		
	}
	
44
	@Override
45
	public void handleApprove(JSONObject jsonObj) throws Exception {
46 47
		// TODO Auto-generated method stub
		// 发起人企业id
tangzhaoqian committed
48
		Integer orgCode = ObjectUtil.isNull(jsonObj.get("orgCode")) ? null : Convert.toInt(jsonObj.get("orgCode"));
49
		// 发起人id
tangzhaoqian committed
50
		Integer id = jsonObj.getInt("id");
51 52
		
		// 申请人
53
		String applicant = ObjectUtil.isNull(jsonObj.get("__applicant",FromData.class)) ? null : jsonObj.get("__applicant",FromData.class).getValue();
54
		// 计划离职日期
55
		String terminationDate = ObjectUtil.isNull(jsonObj.get("__terminationDate",FromData.class)) ? null : jsonObj.get("__terminationDate",FromData.class).getValue();
56
		// 离职原因
57
		String ReasonForResignation = ObjectUtil.isNull(jsonObj.get("__ReasonForResignation",FromData.class)) ? null : jsonObj.get("__ReasonForResignation",FromData.class).getValue();
58
		// 备注
59
		String Remarks = ObjectUtil.isNull(jsonObj.get("Remarks",FromData.class)) ? null : jsonObj.get("Remarks",FromData.class).getValue();
60
		
tangzhaoqian committed
61
		LzygQueryDto dtO = LzygQueryDto.builder()
62 63
					.orgCode(orgCode)
					.empNum(id)
64
					.lzTime(DateUtil.getFormatDate(terminationDate))
65 66 67
					.lzyy(ReasonForResignation)
					.lzbz(Remarks)
					.build();
ilal committed
68
		Logoutput("离职:"+dtO);
69
		// 调 员工管理 业务
tangzhaoqian committed
70
		ygglService.applicationResignation(dtO);
71 72
		
		
73 74 75
	}

}