Commit 57e86503 authored by hongguangwu's avatar hongguangwu

优化导入,精简字段

parent 993fd2d8
...@@ -216,7 +216,7 @@ public class TSettleDomainController { ...@@ -216,7 +216,7 @@ public class TSettleDomainController {
**/ **/
@Inner @Inner
@PostMapping("/inner/getSettleDomainVoById") @PostMapping("/inner/getSettleDomainVoById")
public TSettleDomainSelectVo getSettleDomainVoById(@RequestParam String id) { public TSettleDomainSelectVo getSettleDomainVoById(@RequestBody String id) {
return tSettleDomainService.getSettleDomainVoById(id); return tSettleDomainService.getSettleDomainVoById(id);
} }
......
package com.yifu.cloud.plus.v1.yifu.salary.vo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.io.Serializable;
import java.util.List;
/**
* @Description: 工资导入的返回vo
* @Author: hgw
* @Date: 2021/11/2 15:22
* @return:
**/
@Getter
@Setter
@ToString
public class SalaryUploadReturnVo implements Serializable {
/**
* 用于返回错误信息
*/
private List<ErrorMessage> errorInfo;
// 重复数据
private List<ErrorMessage> repeatInfo;
}
...@@ -42,8 +42,8 @@ public class SalaryUploadController { ...@@ -42,8 +42,8 @@ public class SalaryUploadController {
@SysLog("上传薪资表") @SysLog("上传薪资表")
@PostMapping("/upload") @PostMapping("/upload")
public R upload(@RequestBody String jsonString, @RequestParam String settleDepart, @RequestParam String configId public R upload(@RequestBody String jsonString, @RequestParam String settleDepart, @RequestParam String configId
, @RequestParam String salaryType, @RequestParam int repeatFlag) { , @RequestParam String salaryType) {
return salaryUploadService.salaryUpload(jsonString, settleDepart, configId, salaryType, repeatFlag); return salaryUploadService.salaryUpload(jsonString, settleDepart, configId, salaryType);
} }
/** /**
......
...@@ -18,13 +18,13 @@ public interface SalaryUploadService extends IService<TSalaryStandard> { ...@@ -18,13 +18,13 @@ public interface SalaryUploadService extends IService<TSalaryStandard> {
/** /**
* @param jsonString * @param jsonString
* @param repeatFlag 默认 0:不允许重复导入已存在系统内的数据;1:允许重复导入 *repeatFlag 默认 0:不允许重复导入已存在系统内的数据;1:允许重复导入
* @Description: 普通工资上传 * @Description: 普通工资上传
* @Author: hgw * @Author: hgw
* @Date: 2019/9/4 15:58 * @Date: 2019/9/4 15:58
* @return: com.yifu.cloud.v1.common.core.util.R * @return: com.yifu.cloud.v1.common.core.util.R
**/ **/
R salaryUpload(String jsonString, String settleDepart, String configId, String formType, int repeatFlag); R salaryUpload(String jsonString, String settleDepart, String configId, String formType);
/** /**
* @param savList * @param savList
......
...@@ -93,12 +93,10 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, ...@@ -93,12 +93,10 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
* @return: com.yifu.cloud.v1.common.core.util.R * @return: com.yifu.cloud.v1.common.core.util.R
**/ **/
@Override @Override
public R salaryUpload(String jsonString, String settleDepart, String configId, String salaryType, int repeatFlag) { public R salaryUpload(String jsonString, String settleDepart, String configId, String salaryType) {
if (Common.isNotNull(jsonString) && Common.isNotNull(settleDepart) && Common.isNotNull(configId) && Common.isNotNull(salaryType)) { if (Common.isNotNull(jsonString) && Common.isNotNull(settleDepart) && Common.isNotNull(configId) && Common.isNotNull(salaryType)) {
TSettleDomainSelectVo deptVo = new TSettleDomainSelectVo();
deptVo.setId(settleDepart);
R<TSettleDomainSelectVo> sdr = HttpDaprUtil.invokeMethodPost(archivesProperties.getAppUrl(), archivesProperties.getAppId() R<TSettleDomainSelectVo> sdr = HttpDaprUtil.invokeMethodPost(archivesProperties.getAppUrl(), archivesProperties.getAppId()
, "/tsettledomain/inner/getSettleDomainVoById", deptVo, TSettleDomainSelectVo.class, SecurityConstants.FROM_IN); , "/tsettledomain/inner/getSettleDomainVoById", settleDepart, TSettleDomainSelectVo.class, SecurityConstants.FROM_IN);
// 结算主体 // 结算主体
TSettleDomainSelectVo dept = null; TSettleDomainSelectVo dept = null;
if (sdr != null && sdr.getData() != null) { if (sdr != null && sdr.getData() != null) {
...@@ -164,15 +162,11 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, ...@@ -164,15 +162,11 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
Map<String, Integer> checkMap = tSalaryAccountService.getAccountCheckMap(dept.getId(), DateUtil.addMonth(configSalary.getSalaryMonth())); Map<String, Integer> checkMap = tSalaryAccountService.getAccountCheckMap(dept.getId(), DateUtil.addMonth(configSalary.getSalaryMonth()));
util1.getJsonStringToList(user, jsonString, util1.getJsonStringToList(user, jsonString,
dept, configSalary, salaryConfigMap, isMustMap, empIdCardMap, empNameMap, isDuplicateName dept, configSalary, salaryConfigMap, isMustMap, empIdCardMap, empNameMap, isDuplicateName
, salaryType, invoiceTitle, employeeService, checkMap, repeatFlag, ownEmployeeMap, ownDeptMap, tSalaryAccountService); , salaryType, invoiceTitle, employeeService, checkMap, ownEmployeeMap, ownDeptMap, tSalaryAccountService);
List<TSalaryAccountVo> saList = util1.getEntityList(); List<TSalaryAccountVo> saList = util1.getEntityList();
SalaryUploadReturnVo returnVo = new SalaryUploadReturnVo(); if ((null != util1.getErrorInfo() && !util1.getErrorInfo().isEmpty())) {
if ((null != util1.getErrorInfo() && !util1.getErrorInfo().isEmpty()) return R.failed(util1.getErrorInfo());
|| (null != util1.getRepeatInfo() && !util1.getRepeatInfo().isEmpty())) {
returnVo.setErrorInfo(util1.getErrorInfo());
returnVo.setRepeatInfo(util1.getRepeatInfo());
return R.failed(returnVo);
} else { } else {
if (null != saList && !saList.isEmpty()) { if (null != saList && !saList.isEmpty()) {
// return R.ok(saList) // return R.ok(saList)
......
...@@ -49,9 +49,6 @@ public class SalaryAccountUtil implements Serializable { ...@@ -49,9 +49,6 @@ public class SalaryAccountUtil implements Serializable {
*/ */
private List<ErrorMessage> errorInfo; private List<ErrorMessage> errorInfo;
// 重复数据
private List<ErrorMessage> repeatInfo;
/** /**
* @param jsonStr 客户原表json内容 * @param jsonStr 客户原表json内容
* @param dept 项目 * @param dept 项目
...@@ -71,12 +68,11 @@ public class SalaryAccountUtil implements Serializable { ...@@ -71,12 +68,11 @@ public class SalaryAccountUtil implements Serializable {
, TConfigSalary configSalary, Map<String, TSalaryConfigStandard> salaryConfigMap, Map<String, Boolean> isMustMap , TConfigSalary configSalary, Map<String, TSalaryConfigStandard> salaryConfigMap, Map<String, Boolean> isMustMap
, Map<String, TSalaryEmployee> empIdCardMap, Map<String, TSalaryEmployee> empNameMap, boolean isDuplicateName , Map<String, TSalaryEmployee> empIdCardMap, Map<String, TSalaryEmployee> empNameMap, boolean isDuplicateName
, String salaryType, String invoiceTitle, TSalaryEmployeeService tSalaryEmployeeService , String salaryType, String invoiceTitle, TSalaryEmployeeService tSalaryEmployeeService
, Map<String, Integer> checkMap, int repeatFlag, Map<String, Integer> ownEmployeeMap , Map<String, Integer> checkMap, Map<String, Integer> ownEmployeeMap
, Map<String, Integer> ownDeptMap, TSalaryAccountService tSalaryAccountService) { , Map<String, Integer> ownDeptMap, TSalaryAccountService tSalaryAccountService) {
List<TSalaryAccountVo> tList = new ArrayList<>(); List<TSalaryAccountVo> tList = new ArrayList<>();
List<HashMap> list = JSONObject.parseArray(jsonStr, HashMap.class); List<HashMap> list = JSONObject.parseArray(jsonStr, HashMap.class);
List<ErrorMessage> errorList = new ArrayList<>(); List<ErrorMessage> errorList = new ArrayList<>();
List<ErrorMessage> repeatList = new ArrayList<>();
try { try {
// 得到数据的条数 // 得到数据的条数
int rows = list.size(); int rows = list.size();
...@@ -590,7 +586,6 @@ public class SalaryAccountUtil implements Serializable { ...@@ -590,7 +586,6 @@ public class SalaryAccountUtil implements Serializable {
} }
this.setEntityList(tList); this.setEntityList(tList);
this.setErrorInfo(errorList); this.setErrorInfo(errorList);
this.setRepeatInfo(repeatList);
} }
/** /**
......
...@@ -258,7 +258,7 @@ ...@@ -258,7 +258,7 @@
from t_salary_account a from t_salary_account a
left join t_salary_account_item relaySalary on relaySalary.SALARY_ACCOUNT_ID = a.id and relaySalary.JAVA_FIED_NAME='relaySalary' left join t_salary_account_item relaySalary on relaySalary.SALARY_ACCOUNT_ID = a.id and relaySalary.JAVA_FIED_NAME='relaySalary'
left join t_salary_account_item actSalary on actSalary.SALARY_ACCOUNT_ID = a.id and actSalary.JAVA_FIED_NAME='actualSalarySum' left join t_salary_account_item actSalary on actSalary.SALARY_ACCOUNT_ID = a.id and actSalary.JAVA_FIED_NAME='actualSalarySum'
where a.DELETE_FLAG = 0 and a.SETTLE_DEPART_ID = #{settleId} and a.SALARY_MONTH = #{settleMonth} where a.DELETE_FLAG = 0 and a.DEPT_ID = #{settleId} and a.SALARY_MONTH = #{settleMonth}
</select> </select>
<!-- 获取当前年最小计税月 --> <!-- 获取当前年最小计税月 -->
......
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