Commit 94872f07 authored by huyuchen's avatar huyuchen

订单优化修改

parent ebd92989
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.salary.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
/**
* 同步ekp薪酬信息
*
* @author huyc
* @date 2023-04-18 11:40:14
*/
@Data
public class TSalaryEmployeeEkpUpdateVo implements Serializable {
/**
* 员工姓名
*/
@Schema(description = "员工姓名")
private String empName;
/**
* 身份证号
*/
@Schema(description = "身份证号")
@ExcelProperty("身份证号")
private String empIdcard;
/**
* 开户行总行
*/
@Schema(description = "开户行总行")
private String bankName;
/**
* 银行卡号
*/
@Schema(description = "银行卡号")
private String bankNo;
}
......@@ -30,9 +30,11 @@ import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryEmployee;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryEmployeeService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryEmployeeImportVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmployeeEkpUpdateVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmployeeExportVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmployeeSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
......@@ -197,4 +199,16 @@ public class TSalaryEmployeeController {
return tSalaryEmployeeService.importEmployee(vo);
}
/**
* 同步ekp薪酬信息
* @author huyc
* @param vo
* @return {@link R}
*/
@Schema(description = "同步ekp薪酬人员信息")
@PostMapping(value = "/updateEmployeeFromEkp")
public R updateEmployeeFromEkp(TSalaryEmployeeEkpUpdateVo vo) {
return tSalaryEmployeeService.updateEmployeeFromEkp(vo);
}
}
......@@ -24,6 +24,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryEmployee;
import com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryEmployeeImportVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmployeeEkpUpdateVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmployeeExportVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmployeeSearchVo;
......@@ -112,4 +113,12 @@ public interface TSalaryEmployeeService extends IService<TSalaryEmployee> {
boolean checkBankInfoList(List<TSalaryEmployee> empList, List<ErrorMessage> errorList);
/**
* @param vo
* @Description: 同步ekp薪酬人员信息
* @Author: huyc
* @Date: 2023/04/18 11:38
* @return {@link R}
**/
R updateEmployeeFromEkp(TSalaryEmployeeEkpUpdateVo vo);
}
......@@ -53,6 +53,7 @@ import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
......@@ -885,4 +886,30 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
}
}
/**
* 同步ekp薪酬人员信息
*
* @author huyc
* @param vo
* @return {@link R}
*/
@Override
@Transactional(rollbackFor = Exception.class)
public R updateEmployeeFromEkp(TSalaryEmployeeEkpUpdateVo vo) {
if (Common.isEmpty(vo.getEmpIdcard())) {
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
TSalaryEmployee one = baseMapper.selectOne(Wrappers.<TSalaryEmployee>query().lambda()
.eq(TSalaryEmployee::getEmpIdcard, vo.getEmpIdcard())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isEmpty(one)) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
} else {
one.setBankNo(vo.getBankNo());
one.setEmpName(vo.getEmpName());
one.setBankName(vo.getBankName());
baseMapper.updateById(one);
}
return R.ok();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment