package cn.timer.api.utils.router.business; import java.text.ParseException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import cn.hutool.core.convert.Convert; import cn.hutool.core.util.ObjectUtil; import cn.hutool.json.JSONObject; import cn.timer.api.controller.yggl.service.YgglService; import cn.timer.api.dto.spmk.FromData; import cn.timer.api.dto.yggl.LzygQueryDto; import cn.timer.api.utils.DateFormatUtils; import cn.timer.api.utils.DateUtil; import lombok.Builder; /** * 离职-业务 * @author Tang * */ @Service public class ResignationBusiness extends SpmkAssoBusiness { @Autowired private YgglService ygglService; @Value("${config-8timer.environmental-science}") public String environmental_science; public void Logoutput(String science) { if(!("pro").equals(environmental_science)) { System.out.println(science); }else { System.out.println(""); } } @Override public void handleApprove(JSONObject jsonObj) throws Exception { // TODO Auto-generated method stub // 发起人企业id Integer orgCode = ObjectUtil.isNull(jsonObj.get("orgCode")) ? null : Convert.toInt(jsonObj.get("orgCode")); // 发起人id Integer id = jsonObj.getInt("id"); // 申请人 String applicant = ObjectUtil.isNull(jsonObj.get("__applicant",FromData.class)) ? null : jsonObj.get("__applicant",FromData.class).getValue(); // 计划离职日期 String terminationDate = ObjectUtil.isNull(jsonObj.get("__terminationDate",FromData.class)) ? null : jsonObj.get("__terminationDate",FromData.class).getValue(); // 离职原因 String ReasonForResignation = ObjectUtil.isNull(jsonObj.get("__ReasonForResignation",FromData.class)) ? null : jsonObj.get("__ReasonForResignation",FromData.class).getValue(); // 备注 String Remarks = ObjectUtil.isNull(jsonObj.get("Remarks",FromData.class)) ? null : jsonObj.get("Remarks",FromData.class).getValue(); LzygQueryDto dtO = LzygQueryDto.builder() .orgCode(orgCode) .empNum(id) .lzTime(DateUtil.getFormatDate(terminationDate)) .lzyy(ReasonForResignation) .lzbz(Remarks) .build(); Logoutput("离职:"+dtO); // 调 员工管理 业务 ygglService.applicationResignation(dtO); } }