TransferPositionBusiness.java 2.58 KB
Newer Older
1 2
package cn.timer.api.utils.router.business;

3
import org.springframework.beans.factory.annotation.Autowired;
tangzhaoqian committed
4
import org.springframework.stereotype.Service;
5

tangzhaoqian committed
6
import cn.hutool.core.convert.Convert;
7
import cn.hutool.core.util.ObjectUtil;
8
import cn.hutool.json.JSONObject;
tangzhaoqian committed
9
import cn.timer.api.config.exception.CustomException;
10
import cn.timer.api.controller.zzgl.service.ZzglBmgwMService;
11
import cn.timer.api.dto.spmk.FromData;
12
import cn.timer.api.dto.zzgl.UpEmpDeptDto;
13 14 15 16 17 18 19
import lombok.Builder;

/**
 * 调岗-业务
 * @author Tang
 *
 */
tangzhaoqian committed
20 21

@Service
22 23
public class TransferPositionBusiness extends SpmkAssoBusiness {

24 25 26
	@Autowired
	ZzglBmgwMService zzglBmgwMService;
	
27 28 29 30
	@Override
	public void handleApprove(JSONObject jsonObj) {
		// TODO Auto-generated method stub
		// 发起人企业id
tangzhaoqian committed
31
		Integer orgCode = ObjectUtil.isNull(jsonObj.get("orgCode")) ? null : Convert.toInt(jsonObj.get("orgCode"));
32
		// 发起人id
tangzhaoqian committed
33
		Integer id = jsonObj.getInt("id");
34 35
		
		// 申请人
36
		String applicant = ObjectUtil.isNull(jsonObj.get("__applicant",FromData.class)) ? null : jsonObj.get("__applicant",FromData.class).getValue();
37
		// 申请原因
38
		String ReasonForApplication = ObjectUtil.isNull(jsonObj.get("__ReasonForApplication",FromData.class)) ? null : jsonObj.get("__ReasonForApplication",FromData.class).getValue();
39
		// 调入部门
tangzhaoqian committed
40
		Integer TransferInDepartment = ObjectUtil.isNull(jsonObj.get("__TransferInDepartment",FromData.class)) ? null : Convert.toInt(jsonObj.get("__TransferInDepartment",FromData.class).getValue());
41
		// 调入岗位
tangzhaoqian committed
42 43 44 45
		Integer TransferInPosition = ObjectUtil.isNull(jsonObj.get("__TransferInPosition",FromData.class)) ? null : Integer.parseInt(jsonObj.get("__TransferInPosition",FromData.class).getValue());
		if (TransferInDepartment == null || TransferInPosition == null) {
			throw new CustomException("部门或岗位 未填写,审批失败");
		}
46
		// 生效日期
47
		String effectiveDate = ObjectUtil.isNull(jsonObj.get("__effectiveDate",FromData.class)) ? null : jsonObj.get("__effectiveDate",FromData.class).getValue();
48
		// 备注
49
		String Remarks = ObjectUtil.isNull(jsonObj.get("Remarks",FromData.class)) ? null : jsonObj.get("Remarks",FromData.class).getValue();
50
		// 上传文件
51
		String UploadAttachment = ObjectUtil.isNull(jsonObj.get("UploadAttachment",FromData.class)) ? null : jsonObj.get("UploadAttachment",FromData.class).getValue();
52
		
53 54 55 56 57
		UpEmpDeptDto upEmpDeptDto = UpEmpDeptDto.builder()
				.dpetId(TransferInDepartment)
				.isdg(1)
				.build();
		
tangzhaoqian committed
58
		System.out.println("调岗:"+upEmpDeptDto);
59
		// 调 员工管理 业务
60
		zzglBmgwMService.applicationTransferPosition(id, orgCode, upEmpDeptDto);
61 62 63
	}

}