Commit bcf7d080 authored by huyuchen's avatar huyuchen

预派单 代码修改

parent 6a2f2440
......@@ -21,7 +21,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDict;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
......@@ -34,7 +33,6 @@ import com.yifu.cloud.plus.v1.yifu.social.service.TPreDispatchInfoService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPreDispatchExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPreDispatchUpdateVo;
import lombok.extern.slf4j.Slf4j;
import org.ehcache.impl.internal.util.ServiceUtil;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
......@@ -43,7 +41,6 @@ import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.net.URLDecoder;
import java.util.ArrayList;
......@@ -221,7 +218,7 @@ public class TPreDispatchInfoController {
* @Author huyc
* @Date 2022-07-18
* @param jsonString
* @param houseId 社保户ID
* @param socialHouse 社保户
* @param departId 结算主体ID
* @return
**/
......@@ -229,9 +226,8 @@ public class TPreDispatchInfoController {
@SysLog("预派单批量新增派增")
@PostMapping("/analysisJsonStringImportAdd")
@PreAuthorize("@pms.hasPermission('social:tpredispatchinfo_importAddList')")
public R analysisJsonStringImportAdd(@RequestBody String jsonString,
@RequestParam(value = "houseId",required = true) String houseId,
@RequestParam(value = "departId",required = true) String departId) {
public R analysisJsonStringImportAdd(@RequestBody String jsonString, @RequestParam(value = "socialHouse",required = false) String socialHouse,
@RequestParam(value = "fundHouse",required = false) String fundHouse, @RequestParam String departId) {
YifuUser user = SecurityUtils.getUser();
if (null == user || null == user.getId()) {
return R.failed(CommonConstants.USER_FAIL);
......@@ -248,7 +244,7 @@ public class TPreDispatchInfoController {
return R.failed(util1.getErrorInfo(),PreDispatchConstants.DATA_CHECK);
} else {
if (null != listInfo && !listInfo.isEmpty()) {
errorInfo = tPreDispatchInfoService.batchSavePreDisPatchAdd(listInfo, user,houseId,departId);
errorInfo = tPreDispatchInfoService.batchSavePreDisPatchAdd(listInfo, user,socialHouse,fundHouse,departId);
} else {
errorInfo.add(new ErrorMessage(null, CommonConstants.DATA_CAN_NOT_EMPTY));
}
......
......@@ -104,11 +104,11 @@ public interface TPreDispatchInfoService extends IService<TPreDispatchInfo> {
* @Date 2022-07-18
* @param listInfo
* @param user
* @param houseId
* @param socialHouse
* @param departId
* @return
**/
List<ErrorMessage> batchSavePreDisPatchAdd(List<TPreDispatchInfo> listInfo, YifuUser user, String houseId, String departId);
List<ErrorMessage> batchSavePreDisPatchAdd(List<TPreDispatchInfo> listInfo, YifuUser user, String socialHouse, String fundHouse, String departId);
/**
* 预派单批量新增派减
......
......@@ -546,7 +546,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
}
@Override
public List<ErrorMessage> batchSavePreDisPatchAdd(List<TPreDispatchInfo> listInfo, YifuUser user, String houseId, String departId) {
public List<ErrorMessage> batchSavePreDisPatchAdd(List<TPreDispatchInfo> listInfo, YifuUser user, String socialHouse, String fundHouse, String departId) {
List<ErrorMessage> errorList = new ArrayList<>();
R<TSettleDomainSelectVo> domainR = archivesDaprUtil.getSettleDomainSelectVoById(departId);
TSettleDomainSelectVo selectVo = domainR.getData();
......@@ -579,7 +579,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
continue;
}
// 基础封装 其他
initBaseInfo(houseId, selectVo, info);
initBaseInfo(socialHouse, fundHouse, selectVo, info);
// 2.先校验已有数据
checkBatchSave(info, CommonConstants.ZERO_STRING);
// 3.封装 社保缴纳地 公积金缴纳地
......@@ -1026,15 +1026,14 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
/**
* 初始化基础数据 如 各种状态 合同数据等
*
* @param houseId
* @param socialHouse
* @param selectVo
* @param info
* @return
* @Author fxj
* @Date 2020-12-31
**/
private void initBaseInfo(String houseId, TSettleDomainSelectVo selectVo, TPreDispatchInfo info) {
private void initBaseInfo(String socialHouse, String fundHouse, TSettleDomainSelectVo selectVo, TPreDispatchInfo info) {
info.setType(CommonConstants.ZERO_STRING);
info.setDataSubStatus(CommonConstants.ONE_STRING);
info.setStatus(CommonConstants.ZERO_STRING);
......@@ -1056,8 +1055,8 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
info.setContractTermAdd(Integer.toString(Common.getYearOfTime(info.getContractStart(), info.getContractEnd())));
// 默认工时制 综合工时制2
info.setWorkingHoursAdd(CommonConstants.TWO_STRING);
info.setSocialHouseAdd(houseId);
info.setFundHouseAdd(houseId);
info.setSocialHouseAdd(socialHouse);
info.setFundHouseAdd(fundHouse);
}
/**
......
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