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

3 4
import java.text.ParseException;

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

tangzhaoqian committed
8
import cn.hutool.core.convert.Convert;
9
import cn.hutool.core.util.ObjectUtil;
10
import cn.hutool.json.JSONObject;
11
import cn.timer.api.controller.yggl.service.YgglService;
12
import cn.timer.api.dto.spmk.FromData;
13 14
import cn.timer.api.dto.yggl.LzygQueryDto;
import cn.timer.api.utils.DateFormatUtils;
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 ResignationBusiness extends SpmkAssoBusiness {

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

}