Commit 1ba90a99 authored by huyuchen's avatar huyuchen

预派单 代码修改

parent 024f5578
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import lombok.Data;
import java.util.List;
@Data
public class TSettleDomainListVo {
/**
* 合同主体对应的单位名称
*/
private List<TSettleDomainSelectVo> listSelectVO;
}
...@@ -149,8 +149,8 @@ public class TSettleDomainController { ...@@ -149,8 +149,8 @@ public class TSettleDomainController {
**/ **/
@Inner @Inner
@PostMapping("/getSettleDomainSelectVoById") @PostMapping("/getSettleDomainSelectVoById")
public R<TSettleDomainSelectVo> getInnerSettleDomainSelectVoByUserId(@RequestParam String id) { public TSettleDomainSelectVo getInnerSettleDomainSelectVoByUserId(@RequestParam String id) {
return new R<>(tSettleDomainService.selectSettleDomainSelectVosById(id)); return tSettleDomainService.selectSettleDomainSelectVosById(id);
} }
/** /**
...@@ -161,8 +161,11 @@ public class TSettleDomainController { ...@@ -161,8 +161,11 @@ public class TSettleDomainController {
**/ **/
@Inner @Inner
@PostMapping("/selectAllSettleDomainSelectVos") @PostMapping("/selectAllSettleDomainSelectVos")
public R<List<TSettleDomainSelectVo>> selectAllSettleDomainSelectVos() { public TSettleDomainListVo selectAllSettleDomainSelectVos() {
return new R<>(tSettleDomainService.selectAllSettleDomainSelectVos()); List<TSettleDomainSelectVo> list = tSettleDomainService.selectAllSettleDomainSelectVos();
TSettleDomainListVo listVo = new TSettleDomainListVo();
listVo.setListSelectVO(list);
return listVo;
} }
/** /**
......
...@@ -358,6 +358,20 @@ public interface CommonConstants { ...@@ -358,6 +358,20 @@ public interface CommonConstants {
// 是否 // 是否
String IS_CHANGE = "划转"; String IS_CHANGE = "划转";
/**
* 省市
* @Author fxj
* @Date 2020-08-25
**/
public static final String HEFEISTRING="安徽省-合肥市";
/**
* 省
* @Author fxj
* @Date 2020-08-25
**/
public static final String ANHUISTRING="安徽省";
/** /**
*是所有者 *是所有者
**/ **/
...@@ -378,6 +392,10 @@ public interface CommonConstants { ...@@ -378,6 +392,10 @@ public interface CommonConstants {
public static final String NINE_STRING = "9"; public static final String NINE_STRING = "9";
String EIGHT_STRING = "8"; String EIGHT_STRING = "8";
public static final String PAYMENT_SOCIAL_IMPORT = "payment_social_import";
public static final String PAYMENT_SOCIAL_WAIT_EXPORT = "payment_social_wait_export";
//百分之一 1/100 //百分之一 1/100
public static final BigDecimal ONE_OF_PERCENT = new BigDecimal("0.01"); public static final BigDecimal ONE_OF_PERCENT = new BigDecimal("0.01");
...@@ -389,4 +407,8 @@ public interface CommonConstants { ...@@ -389,4 +407,8 @@ public interface CommonConstants {
String SEVEN_STRING = "7"; String SEVEN_STRING = "7";
public static final BigDecimal MONEY_MAX = new BigDecimal("999999.99"); public static final BigDecimal MONEY_MAX = new BigDecimal("999999.99");
public static final String ERROR_MSG_PRFIX = "error=";
public static final String SUCCESS_MSG_PREFIX = "success=";
} }
...@@ -126,4 +126,10 @@ public class ExcelAttributeConstants { ...@@ -126,4 +126,10 @@ public class ExcelAttributeConstants {
public static final String DEPARTID_PROVINCE_CITY_TOWN = "departId_province_city_town"; public static final String DEPARTID_PROVINCE_CITY_TOWN = "departId_province_city_town";
//派减离职原因 //派减离职原因
public static final String REDUCE_PROJECT_REASON = "reduce_project_reason"; public static final String REDUCE_PROJECT_REASON = "reduce_project_reason";
//社保缴纳月份
public static final String SOCIAL_PAY_MONTH = "socialPayMonth";
//身份证
public static final String EMPIDCARD = "empIdcard";
} }
...@@ -416,4 +416,8 @@ public interface ErrorCodes { ...@@ -416,4 +416,8 @@ public interface ErrorCodes {
* 派减异常: 本次派增已存在对应身份证号的派减记录 * 派减异常: 本次派增已存在对应身份证号的派减记录
*/ */
String EMP_DISPATCH_REDUCE_EXISTS = "emp.dispatch.reduce.exists"; String EMP_DISPATCH_REDUCE_EXISTS = "emp.dispatch.reduce.exists";
/**
* 当前社保导入队列不足或者数据量过大,请稍后重试!
*/
String SOCIALINFO_LIST_NUM_LARGE = "socialinfo.list.num.large";
} }
...@@ -399,4 +399,44 @@ public class Common { ...@@ -399,4 +399,44 @@ public class Common {
map.clear(); map.clear();
} }
} }
/**
* 按字段返回字符串
*
* @param list
* @param filedName
* @param <T>
* @return
*/
public static <T> List<String> listObjectToStrList(List<T> list, String filedName) {
List<String> idsStr = new ArrayList<String>();
Object temp = null;
if (null != list && list.size() > 0) {
for (T t : list) {
temp = getFieldValueByName(filedName, t);
if (null != temp) {
idsStr.add(temp.toString());
}
}
}
return idsStr;
}
/**
* 默认空 置为零
* @param obj
* @return
*/
public static BigDecimal isBlankToBigDecimalZero(BigDecimal obj) {
if(obj == null) {
return BigDecimal.ZERO;
}
if(String.valueOf(obj).trim().length() == 0) {
return BigDecimal.ZERO;
}
if(String.valueOf(obj).trim().equals("null")) {
return BigDecimal.ZERO;
}
return obj;
}
} }
...@@ -151,6 +151,8 @@ emp.dispatch.reduce.fund.status.error=\u6D3E\u51CF\u5F02\u5E38\uFF1A \u672A\u627 ...@@ -151,6 +151,8 @@ emp.dispatch.reduce.fund.status.error=\u6D3E\u51CF\u5F02\u5E38\uFF1A \u672A\u627
emp.dispatch.reduce.exists=\u6D3E\u51CF\u5F02\u5E38\uFF1A \u672C\u6B21\u6D3E\u589E\u5DF2\u5B58\u5728\u5BF9\u5E94\u8EAB\u4EFD\u8BC1\u53F7\u7684\u6D3E\u51CF\u8BB0\u5F55 emp.dispatch.reduce.exists=\u6D3E\u51CF\u5F02\u5E38\uFF1A \u672C\u6B21\u6D3E\u589E\u5DF2\u5B58\u5728\u5BF9\u5E94\u8EAB\u4EFD\u8BC1\u53F7\u7684\u6D3E\u51CF\u8BB0\u5F55
socialinfo.list.num.large=\u5F53\u524D\u793E\u4FDD\u5BFC\u5165\u961F\u5217\u4E0D\u8DB3\u6216\u8005\u6570\u636E\u91CF\u8FC7\u5927\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\uFF01
......
...@@ -96,8 +96,8 @@ public class ArchivesDaprUtil { ...@@ -96,8 +96,8 @@ public class ArchivesDaprUtil {
* @Param * @Param
* @return * @return
**/ **/
public R<List<TSettleDomainSelectVo>> selectAllSettleDomainSelectVos(){ public R<TSettleDomainListVo> selectAllSettleDomainSelectVos(){
R<List<TSettleDomainSelectVo>> res = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId(),"/tsettledomain/getSettleDomainSelectVoById","", Map.class, SecurityConstants.FROM_IN); R<TSettleDomainListVo> res = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId(),"/tsettledomain/selectAllSettleDomainSelectVos","", Map.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){ if (Common.isEmpty(res)){
return R.failed("获取所有客户单位的结算主体信息失败!"); return R.failed("获取所有客户单位的结算主体信息失败!");
} }
......
...@@ -636,9 +636,9 @@ public class TPreDispatchInfo extends BaseEntity { ...@@ -636,9 +636,9 @@ public class TPreDispatchInfo extends BaseEntity {
private String remark; private String remark;
/** /**
* 是否派单:0 是 2 否 * 是否派单:0 是 1 否
*/ */
@Schema(description ="是否派单:0 是 2 否 ") @Schema(description ="是否派单:0 是 1 否 ")
private String dispatchFlag; private String dispatchFlag;
/** /**
......
...@@ -494,7 +494,7 @@ public class TPreDispatchExportVo implements Serializable { ...@@ -494,7 +494,7 @@ public class TPreDispatchExportVo implements Serializable {
private String remark; private String remark;
/** /**
* 是否派单:0 是 2 * 是否派单:0 是 1
*/ */
@ExcelProperty(value ="是否派单") @ExcelProperty(value ="是否派单")
@ExcelAttribute(name = "是否派单", maxLength = 2, needExport = true, readConverterExp = "0=是,1=否") @ExcelAttribute(name = "是否派单", maxLength = 2, needExport = true, readConverterExp = "0=是,1=否")
......
...@@ -225,7 +225,7 @@ public class TPreDispatchInfoController { ...@@ -225,7 +225,7 @@ public class TPreDispatchInfoController {
@Operation(summary = "预派单批量新增派增", description = "预派单批量新增派增") @Operation(summary = "预派单批量新增派增", description = "预派单批量新增派增")
@SysLog("预派单批量新增派增") @SysLog("预派单批量新增派增")
@PostMapping("/analysisJsonStringImportAdd") @PostMapping("/analysisJsonStringImportAdd")
@PreAuthorize("@pms.hasPermission('social:tpredispatchinfo_importAddList')") @PreAuthorize("@pms.hasPermission('social_tpredispatchinfo_importAddList')")
public R analysisJsonStringImportAdd(@RequestBody String jsonString, @RequestParam(value = "socialHouse",required = false) String socialHouse, public R analysisJsonStringImportAdd(@RequestBody String jsonString, @RequestParam(value = "socialHouse",required = false) String socialHouse,
@RequestParam(value = "fundHouse",required = false) String fundHouse, @RequestParam String departId) { @RequestParam(value = "fundHouse",required = false) String fundHouse, @RequestParam String departId) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
...@@ -265,7 +265,7 @@ public class TPreDispatchInfoController { ...@@ -265,7 +265,7 @@ public class TPreDispatchInfoController {
@Operation(summary = "预派单批量新增派减", description = "预派单批量新增派减") @Operation(summary = "预派单批量新增派减", description = "预派单批量新增派减")
@SysLog("预派单批量新增派减") @SysLog("预派单批量新增派减")
@PostMapping("/analysisJsonStringImportReduce") @PostMapping("/analysisJsonStringImportReduce")
@PreAuthorize("@pms.hasPermission('social:tpredispatchinfo_importReduceList')") @PreAuthorize("@pms.hasPermission('social_tpredispatchinfo_importAddList')")
public R analysisJsonStringImportReduce(@RequestBody String jsonString) { public R analysisJsonStringImportReduce(@RequestBody String jsonString) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
if (null == user || null == user.getId()) { if (null == user || null == user.getId()) {
......
...@@ -24,6 +24,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -24,6 +24,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.entity.SysArea;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AreaVo; import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AreaVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainListVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.*; import com.yifu.cloud.plus.v1.yifu.common.core.constant.*;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*; import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
...@@ -323,14 +324,21 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -323,14 +324,21 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
if (Common.isEmpty(id)) { if (Common.isEmpty(id)) {
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR); return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
} }
R<List<TSettleDomainSelectVo>> settleDomainR = null; List<TSettleDomainSelectVo> settleDomainR = null;
R<TSettleDomainListVo> listVo = null;
//结算主体名称map key:结算主体id value:结算主体名称 //结算主体名称map key:结算主体id value:结算主体名称
Map<String, String> settleDomainNameMap = new HashMap<>(); Map<String, String> settleDomainNameMap = new HashMap<>();
//客户名称map key:客户id value:客户名称 //客户名称map key:客户id value:客户名称
Map<String, String> customerNameMap = new HashMap<>(); Map<String, String> customerNameMap = new HashMap<>();
//结算主体客户关系map key:结算主体id value:客户id //结算主体客户关系map key:结算主体id value:客户id
Map<String, String> settleIdAndCustomerIdMap = new HashMap<>(); Map<String, String> settleIdAndCustomerIdMap = new HashMap<>();
settleDomainR = archivesDaprUtil.selectAllSettleDomainSelectVos(); listVo = archivesDaprUtil.selectAllSettleDomainSelectVos();
if (Common.isNotNull(listVo)) {
TSettleDomainListVo tSettleDomainListVo = listVo.getData();
if (Common.isNotNull(tSettleDomainListVo) && Common.isNotEmpty(tSettleDomainListVo.getListSelectVO())) {
settleDomainR = tSettleDomainListVo.getListSelectVO();
}
}
//map数据封装 //map数据封装
initSettleDomainMaps(settleDomainR, settleDomainNameMap, customerNameMap, settleIdAndCustomerIdMap); initSettleDomainMaps(settleDomainR, settleDomainNameMap, customerNameMap, settleIdAndCustomerIdMap);
TPreDispatchInfo preInfo = baseMapper.selectById(id); TPreDispatchInfo preInfo = baseMapper.selectById(id);
...@@ -388,14 +396,21 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -388,14 +396,21 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
if (null == user || null == user.getId()) { if (null == user || null == user.getId()) {
return R.failed(CommonConstants.USER_FAIL); return R.failed(CommonConstants.USER_FAIL);
} }
R<List<TSettleDomainSelectVo>> settleDomainR = null; List<TSettleDomainSelectVo> settleDomainR = null;
R<TSettleDomainListVo> listVo = null;
//结算主体名称map key:结算主体id value:结算主体名称 //结算主体名称map key:结算主体id value:结算主体名称
Map<String, String> settleDomainNameMap = new HashMap<>(); Map<String, String> settleDomainNameMap = new HashMap<>();
//客户名称map key:客户id value:客户名称 //客户名称map key:客户id value:客户名称
Map<String, String> customerNameMap = new HashMap<>(); Map<String, String> customerNameMap = new HashMap<>();
//结算主体客户关系map key:结算主体id value:客户id //结算主体客户关系map key:结算主体id value:客户id
Map<String, String> settleIdAndCustomerIdMap = new HashMap<>(); Map<String, String> settleIdAndCustomerIdMap = new HashMap<>();
settleDomainR = archivesDaprUtil.selectAllSettleDomainSelectVos(); listVo = archivesDaprUtil.selectAllSettleDomainSelectVos();
if (Common.isNotNull(listVo)) {
TSettleDomainListVo tSettleDomainListVo = listVo.getData();
if (Common.isNotNull(tSettleDomainListVo) && Common.isNotEmpty(tSettleDomainListVo.getListSelectVO())) {
settleDomainR = tSettleDomainListVo.getListSelectVO();
}
}
//map数据封装 //map数据封装
initSettleDomainMaps(settleDomainR, settleDomainNameMap, customerNameMap, settleIdAndCustomerIdMap); initSettleDomainMaps(settleDomainR, settleDomainNameMap, customerNameMap, settleIdAndCustomerIdMap);
// 获取当前创建人 截止到当前时间的 正常未派单 未删除的预派单数据 // 获取当前创建人 截止到当前时间的 正常未派单 未删除的预派单数据
...@@ -480,6 +495,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -480,6 +495,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
@Override @Override
public R update(TPreDispatchInfo tPreDispatchInfo) { public R update(TPreDispatchInfo tPreDispatchInfo) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
if (null == user || null == user.getId()) { if (null == user || null == user.getId()) {
return R.failed(CommonConstants.USER_FAIL); return R.failed(CommonConstants.USER_FAIL);
...@@ -1847,7 +1863,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -1847,7 +1863,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
/** /**
* map数据封装 * map数据封装
* *
* @param settleDomainR * @param settleDomainList
* @param settleDomainNameMap * @param settleDomainNameMap
* @param customerNameMap * @param customerNameMap
* @param settleIdAndCustomerIdMap * @param settleIdAndCustomerIdMap
...@@ -1855,13 +1871,10 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -1855,13 +1871,10 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
* @Author huyc * @Author huyc
* @Date 2022-07-18 * @Date 2022-07-18
**/ **/
private void initSettleDomainMaps(R<List<TSettleDomainSelectVo>> settleDomainR, private void initSettleDomainMaps(List<TSettleDomainSelectVo> settleDomainList,
Map<String, String> settleDomainNameMap, Map<String, String> settleDomainNameMap,
Map<String, String> customerNameMap, Map<String, String> customerNameMap,
Map<String, String> settleIdAndCustomerIdMap) { Map<String, String> settleIdAndCustomerIdMap) {
List<TSettleDomainSelectVo> settleDomainList;
if (null != settleDomainR) {
settleDomainList = settleDomainR.getData();
//map数据封装 //map数据封装
if (Common.isNotNull(settleDomainList)) { if (Common.isNotNull(settleDomainList)) {
for (TSettleDomainSelectVo settleDomainSelectVo : settleDomainList) { for (TSettleDomainSelectVo settleDomainSelectVo : settleDomainList) {
...@@ -1872,7 +1885,6 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -1872,7 +1885,6 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
} }
} }
} }
}
} }
/** /**
......
package com.yifu.cloud.plus.v1.yifu.social.util; package com.yifu.cloud.plus.v1.yifu.social.util;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil; import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Date;
/** /**
* 公用方法提取 * 公用方法提取
...@@ -56,4 +58,40 @@ public class ServiceUtil { ...@@ -56,4 +58,40 @@ public class ServiceUtil {
} }
return null; return null;
} }
/**
* 抛个异常先
* @Author fxj
* @Date 2020-09-09
* @param errorInfo
* @return
**/
public static void runTimeExceptionDiy(String errorInfo) {
throw new CheckedException(errorInfo);
}
/**
* 参数2的是否大于等于参数1的
* @Author fxj
* @Date 20200403
* @param socialStartDate
* @param socialPayMonth
* @param reduceDate
* @return
**/
public static boolean checkMothForPaymentImport(Date socialStartDate, String socialPayMonth, Date reduceDate) {
if(socialStartDate != null) {
if (null == reduceDate){
if(Integer.parseInt(socialPayMonth) >= Integer.parseInt(DateUtil.dateToString(socialStartDate))){
return true;
}
}else {
if(Integer.parseInt(socialPayMonth) >= Integer.parseInt(DateUtil.dateToString(socialStartDate))
&& Integer.parseInt(socialPayMonth) < Integer.parseInt(DateUtil.dateToString(reduceDate))){
return true;
}
}
}
return false;
}
} }
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