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

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

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

}