TransferPositionBusiness.java 2.65 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());
lal committed
41 42 43 44 45 46
		
		if(!("").equals(jsonObj.get("__TransferInPosition",FromData.class).getValue())) {
			// 调入岗位
			Integer TransferInPosition = ObjectUtil.isNull(jsonObj.get("__TransferInPosition",FromData.class)) ? null : Integer.parseInt(jsonObj.get("__TransferInPosition",FromData.class).getValue());
		}
		
tangzhaoqian committed
47
		if (TransferInDepartment == null) {
tangzhaoqian committed
48 49
			throw new CustomException("部门或岗位 未填写,审批失败");
		}
50
		// 生效日期
51
		String effectiveDate = ObjectUtil.isNull(jsonObj.get("__effectiveDate",FromData.class)) ? null : jsonObj.get("__effectiveDate",FromData.class).getValue();
52
		// 备注
53
		String Remarks = ObjectUtil.isNull(jsonObj.get("Remarks",FromData.class)) ? null : jsonObj.get("Remarks",FromData.class).getValue();
54
		// 上传文件
55
		String UploadAttachment = ObjectUtil.isNull(jsonObj.get("UploadAttachment",FromData.class)) ? null : jsonObj.get("UploadAttachment",FromData.class).getValue();
56
		
57 58 59 60 61
		UpEmpDeptDto upEmpDeptDto = UpEmpDeptDto.builder()
				.dpetId(TransferInDepartment)
				.isdg(1)
				.build();
		
tangzhaoqian committed
62
		System.out.println("调岗:"+upEmpDeptDto);
63
		// 调 员工管理 业务
64
		zzglBmgwMService.applicationTransferPosition(id, orgCode, upEmpDeptDto);
65 66 67
	}

}