Commit 09e6784f authored by fangxinjiang's avatar fangxinjiang

工资兼容订单接口

parent 6b763454
......@@ -385,5 +385,11 @@ public class TSalaryAccount extends BaseEntity {
@TableField(exist = false)
private List<TSalaryAccountItem> saiList = new ArrayList<>(); //工资组成部分明细
/**
* 订单ID
*/
@ExcelAttribute(name = "订单ID")
@Schema(description = "订单ID" )
@ExcelProperty("订单ID" )
private String orderId;
}
......@@ -335,4 +335,12 @@ public class TSalaryStandard extends BaseEntity {
@Length(max = 50, message = "封面抬头不能超过50个字符")
@ExcelProperty("封面抬头")
private String invoiceTitle;
/**
* 订单ID
*/
@ExcelAttribute(name = "订单ID")
@Schema(description = "订单ID" )
@ExcelProperty("订单ID" )
private String orderId;
}
......@@ -47,8 +47,8 @@ public class SalaryUploadController {
@SysLog("上传薪资表")
@PostMapping("/upload")
public R upload(@RequestBody String jsonString, @RequestParam String settleDepart, @RequestParam(required = false) String configId
, @RequestParam String salaryType) {
return salaryUploadService.salaryUpload(jsonString, settleDepart, configId, salaryType);
, @RequestParam String salaryType, @RequestParam String orderId) {
return salaryUploadService.salaryUpload(jsonString, settleDepart, configId, salaryType,orderId);
}
/**
......@@ -61,8 +61,8 @@ public class SalaryUploadController {
@Operation(description = "保存并提交")
@SysLog("保存并提交薪资表")
@PostMapping("/saveAndSubmit")
public R saveAndSubmit(@RequestBody List<TSalaryAccountVo> savList) {
return salaryUploadService.saveAndSubmit(savList);
public R saveAndSubmit(@RequestBody List<TSalaryAccountVo> savList, String orderId) {
return salaryUploadService.saveAndSubmit(savList,orderId);
}
@Operation(description = "打开结算单")
......
......@@ -20,21 +20,23 @@ public interface SalaryUploadService extends IService<TSalaryStandard> {
/**
* @param jsonString
*repeatFlag 默认 0:不允许重复导入已存在系统内的数据;1:允许重复导入
* @param orderId
* @Description: 普通工资上传
* @Author: hgw
* @Date: 2019/9/4 15:58
* @return: com.yifu.cloud.v1.common.core.util.R
**/
R salaryUpload(String jsonString, String settleDepart, String configId, String formType);
R salaryUpload(String jsonString, String settleDepart, String configId, String formType, String orderId);
/**
* @param savList
* @param orderId
* @Description: 保存并提交报账表
* @Author: hgw
* @Date: 2019/9/18 18:42
* @return: com.yifu.cloud.v1.common.core.util.R
**/
R<String> saveAndSubmit(List<TSalaryAccountVo> savList);
R<String> saveAndSubmit(List<TSalaryAccountVo> savList, String orderId);
R<TSalaryDetailVo> getBill(String salaryFormId);
......
......@@ -96,13 +96,14 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
/**
* @param jsonString 客户原表数据
* repeatFlag 默认 0:不允许重复导入已存在系统内的数据;1:允许重复导入
* @param orderId
* @Description: 普通工资上传
* @Author: hgw
* @Date: 2019/9/4 15:58
* @return: com.yifu.cloud.v1.common.core.util.R
**/
@Override
public R salaryUpload(String jsonString, String settleDepart, String configId, String salaryType) {
public R salaryUpload(String jsonString, String settleDepart, String configId, String salaryType, String orderId) {
if (Common.isNotNull(jsonString) && Common.isNotNull(settleDepart) && Common.isNotNull(salaryType)) {
R<TSettleDomainSelectVo> sdr = HttpDaprUtil.invokeMethodPost(archivesProperties.getAppUrl(), archivesProperties.getAppId()
......@@ -202,11 +203,11 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
// return R.ok(saList)
//薪资导入
if (CommonConstants.ZERO_STRING.equals(salaryType)) {
return this.saveAndSubmit(saList);
return this.saveAndSubmit(saList, orderId);
}
//劳务费和稿酬导入
if (CommonConstants.THREE_STRING.equals(salaryType) || CommonConstants.FOUR_STRING.equals(salaryType)) {
return this.saveLaborSubmit(saList, dept, salaryType);
return this.saveLaborSubmit(saList, dept, salaryType,orderId);
}
} else {
return R.failed("导入数据不可为空");
......@@ -306,13 +307,14 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
/**
* @param savList 报账表Vo
* @param orderId
* @Description: 保存并提交
* @Author: hgw
* @Date: 2019/9/20 17:05
* @return: com.yifu.cloud.v1.common.core.util.R
**/
@Override
public R saveAndSubmit(List<TSalaryAccountVo> savList) {
public R saveAndSubmit(List<TSalaryAccountVo> savList, String orderId) {
if (Common.isNotNull(savList) && !savList.isEmpty()) {
TSalaryAccountVo salaryAccountVo = savList.get(0);
List<TSalaryAccountItem> saiList = null; //报账明细List
......@@ -372,6 +374,8 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
salaryLockService.save(lock);
TSalaryLock lockUpdate;
try {
//设置订单号 20220831
salary.setOrderId(orderId);
// 薪资核心导入代码
return this.doCoreSalary(savList, salaryAccountVo, saiList, sai, dept, invoiceTitle, user, nowTime, salary, isActual);
} catch (Exception e) {
......@@ -897,6 +901,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
saiList = account.getSaiList();
account.setSaiList(null);
account.setSalaryFormId(salary.getId());
account.setOrderId(salary.getOrderId());
tSalaryAccountService.save(account);
money = SalaryConstants.B_ZERO;
for (TSalaryAccountItem item : saiList) {
......@@ -1469,12 +1474,13 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
/**
* @param savList 报账表Vo
* @param orderId
* @Description: 保存并提交
* @Author: huyc
* @Date: 2022/8/16
* @return: com.yifu.cloud.v1.common.core.util.R
**/
public R saveLaborSubmit(List<TSalaryAccountVo> savList, TSettleDomainSelectVo dept, String salaryType) {
public R saveLaborSubmit(List<TSalaryAccountVo> savList, TSettleDomainSelectVo dept, String salaryType, String orderId) {
if (Common.isNotNull(savList) && !savList.isEmpty()) {
TSalaryAccountVo salaryAccountVo = savList.get(0);
List<TSalaryAccountItem> saiList = null; //报账明细List
......@@ -1493,6 +1499,8 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
}
if (salary != null) {
// 复制EKP订单ID 20220831 fxj
salary.setOrderId(orderId);
// 薪资导入、删除前加锁:
TSalaryLock lock = salaryLockService.lambdaQuery()
.eq(TSalaryLock::getDeptId, dept.getId())
......@@ -1663,6 +1671,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
for (TSalaryAccount account : aList) {
saiList = account.getSaiList();
account.setSaiList(null);
account.setOrderId(salary.getOrderId());
account.setSalaryFormId(salary.getId());
tSalaryAccountService.save(account);
for (TSalaryAccountItem item : saiList) {
......@@ -1929,6 +1938,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
for (TSalaryAccount account : aList) {
saiList = account.getSaiList();
account.setSaiList(null);
account.setOrderId(salary.getOrderId());
account.setSalaryFormId(salary.getId());
tSalaryAccountService.save(account);
for (TSalaryAccountItem item : saiList) {
......
......@@ -77,6 +77,7 @@
<result property="sendUser" column="SEND_USER"/>
<result property="sendUserName" column="SEND_USER_NAME"/>
<result property="sendMonth" column="SEND_MONTH"/>
<result property="orderId" column="ORDER_ID"/>
</resultMap>
<!-- 对接EKP的参数 -->
......@@ -197,7 +198,8 @@
a.SEND_TIME,
a.SEND_USER,
a.SEND_USER_NAME,
a.SEND_MONTH
a.SEND_MONTH,
a.ORDER_ID
</sql>
<sql id="tSalaryAccount_where">
<if test="tSalaryAccount != null">
......@@ -207,6 +209,9 @@
<if test="tSalaryAccount.invoiceTitle != null and tSalaryAccount.invoiceTitle.trim() != ''">
AND a.INVOICE_TITLE = #{tSalaryAccount.invoiceTitle}
</if>
<if test="tSalaryAccount.orderId != null and tSalaryAccount.orderId.trim() != ''">
AND a.ORDER_ID = #{tSalaryAccount.orderId}
</if>
<if test="tSalaryAccount.salaryFormId != null and tSalaryAccount.salaryFormId.trim() != ''">
AND a.SALARY_FORM_ID = #{tSalaryAccount.salaryFormId}
</if>
......@@ -422,7 +427,7 @@
and a.FORM_TYPE='0'
and a.SALARY_MONTH in ( #{month} , #{month2} , #{month3})
AND s.STATUS IN (3, 4)
GROUP BY a.EMP_IDCARD, a.SALARY_MONTH limit 10
GROUP BY a.EMP_IDCARD, a.SALARY_MONTH
) a
where a.relaySalary > 0
and a.social = 0
......
......@@ -72,6 +72,7 @@
<result property="repeatNums" column="REPEAT_NUMS"/>
<result property="isRepeat" column="IS_REPEAT"/>
<result property="repeatRemark" column="REPEAT_REMARK"/>
<result property="orderId" column="ORDER_ID"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
......@@ -122,7 +123,8 @@
a.REPEAT_NUMS,
a.IS_REPEAT,
a.REPEAT_REMARK,
a.INVOICE_TITLE
a.INVOICE_TITLE,
a.ORDER_ID
</sql>
<sql id="tSalaryStandard_where">
<if test="tSalaryStandard != null">
......@@ -132,6 +134,9 @@
<if test="tSalaryStandard.deptId != null and tSalaryStandard.deptId.trim() != ''">
AND a.DEPT_ID = #{tSalaryStandard.deptId}
</if>
<if test="tSalaryStandard.orderId != null and tSalaryStandard.orderId.trim() != ''">
AND a.ORDER_ID = #{tSalaryStandard.orderId}
</if>
<if test="tSalaryStandard.deptName != null and tSalaryStandard.deptName.trim() != ''">
AND a.DEPT_NAME = #{tSalaryStandard.deptName}
</if>
......
......@@ -229,6 +229,9 @@
<if test="tDispatchInfo.id != null and tDispatchInfo.id.trim() != ''">
AND a.ID = #{tDispatchInfo.id}
</if>
<if test="tDispatchInfo.orderId != null and tDispatchInfo.orderId.trim() != ''">
AND a.ORDER_ID = #{tDispatchInfo.orderId}
</if>
<if test="tDispatchInfo.empId != null and tDispatchInfo.empId.trim() != ''">
AND a.EMP_ID = #{tDispatchInfo.empId}
</if>
......
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