ResignationBusiness.java 2.17 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;import cn.hutool.core.date.DateUtil;
6
import cn.hutool.core.util.ObjectUtil;
7
import cn.hutool.json.JSONObject;
8
import cn.timer.api.controller.yggl.service.YgglService;
9
import cn.timer.api.dto.spmk.FromData;
10 11
import cn.timer.api.dto.yggl.LzygQueryDto;
import cn.timer.api.utils.DateFormatUtils;
12 13 14 15 16 17 18 19 20 21
import lombok.Builder;

/**
 * 离职-业务
 * @author Tang
 *
 */
@Builder
public class ResignationBusiness extends SpmkAssoBusiness {

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

}