Commit 3359aa7a authored by hongguangwu's avatar hongguangwu

MVP1.5.2-派单

parent e01e2040
......@@ -569,4 +569,19 @@ public class TDispatchInfoController {
}
return new SocialAndFundReduceVo();
}
/**
* @param importVo
* @Description: 单个派增
* @Author: hgw
* @Date: 2023/3/10 15:35
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/
@Operation(summary = "单个派增 权限:social_dispatchinfo_add", description = "单个派增")
@PostMapping("/dispatchAdd")
@PreAuthorize("@pms.hasPermission('social_dispatchinfo_add')")
public R<List<ErrorMessage>> dispatchAdd(@RequestBody TDispatchImportVo importVo) {
return tDispatchInfoService.dispatchAdd(importVo);
}
}
......@@ -100,4 +100,12 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
**/
SocialAndFundReduceVo getSocialAndFundReduceInfo(String empId);
/**
* @param importVo
* @Description: 单个派增
* @Author: hgw
* @Date: 2023/3/10 15:46
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage>>
**/
R<List<ErrorMessage>> dispatchAdd(TDispatchImportVo importVo);
}
......@@ -30,7 +30,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysArea;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AllUserNaVo;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AreaVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
......@@ -47,6 +49,7 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.social.constants.DispatchConstants;
import com.yifu.cloud.plus.v1.yifu.social.constants.PreDispatchConstants;
import com.yifu.cloud.plus.v1.yifu.social.entity.*;
import com.yifu.cloud.plus.v1.yifu.social.mapper.*;
import com.yifu.cloud.plus.v1.yifu.social.service.TDispatchInfoService;
......@@ -4826,4 +4829,46 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
return R.ok(errorMessageList);
}
private void initAreaMap(Map<String, SysArea> areaHashMap, Map<String, SysArea> areaIdMap, R<AreaVo> areaListR) {
AreaVo areaList = areaListR.getData();
if (null != areaList && !areaList.getSysAreaList().isEmpty()) {
for (SysArea area : areaList.getSysAreaList()) {
areaHashMap.put(area.getAreaName(), area);
areaIdMap.put(Integer.toString(area.getId()), area);
}
}
}
@Override
public R<List<ErrorMessage>> dispatchAdd(TDispatchImportVo importVo) {
YifuUser user = SecurityUtils.getUser();
if (null == user || null == user.getId()) {
return R.failed(CommonConstants.USER_FAIL);
}
List<ErrorMessage> errorMessageList = new ArrayList<>();
HashMap<String,SysArea> areaMap = new HashMap<>();
HashMap<String,SysArea> areaIdMap = new HashMap<>();
importVo.setRowIndex(CommonConstants.ONE_INT);
List<TDispatchImportVo> importVoList = new ArrayList<>();
importVoList.add(importVo);
// 如果档案地市空 只能用缴纳地封装,如果缴纳地有问题直接返回
if (null == importVo.getFileCity()) {
R<AreaVo> areaListR = upmsDaprUtils.getAreaListR();
if (null == areaListR || areaListR.getCode() != CommonConstants.SUCCESS) {
return R.failed(PreDispatchConstants.GET_AREA_INFO);
}
initAreaMap(areaMap, areaIdMap, areaListR);
}
// 档案地市没问题 开始派单处理
if (errorMessageList.isEmpty()) {
this.importTDispatchInfo(importVoList, errorMessageList, user, null, new HashMap<>());
}
if (errorMessageList.isEmpty()) {
return R.ok();
} else {
return R.failed(errorMessageList);
}
}
}
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