Commit e1ace434 authored by wangzb's avatar wangzb

Merge remote-tracking branch 'origin/MVP1.5.4' into MVP1.5.4

# Conflicts:
#	yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/constant/CommonConstants.java
parents abb8787f 4cb319c2
......@@ -115,6 +115,7 @@ public class TEmployeeContractInfo extends BaseEntity {
@ExcelAttribute(name = "合同到期时间", needExport = true)
@Schema(description = "合同到期时间", name = "contractEnd")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
@TableField(value = "contract_end", updateStrategy = FieldStrategy.IGNORED)
private Date contractEnd;
/**
* 项目名称
......
......@@ -395,7 +395,8 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
TEmployeeProject newEmpProject = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, vo.getEmpIdcard()).eq(TEmployeeProject::getDeptNo,vo.getNewDeptNo())
.eq(TEmployeeProject::getDeleteFlag,CommonConstants.STATUS_NORMAL));
if (Common.isNotNull(newEmpProject.getProjectStatus())
if (Common.isNotNull(newEmpProject)
&& Common.isNotNull(newEmpProject.getProjectStatus())
&& newEmpProject.getProjectStatus().intValue() == CommonConstants.ONE_INT){
return R.failed("目标项目档案已减项,请复项后重新划转!");
}
......@@ -407,9 +408,13 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
.eq(TEmployeeProject::getDeleteFlag,CommonConstants.STATUS_NORMAL).eq(TEmployeeProject::getProjectStatus,CommonConstants.ZERO_INT));
if (Common.isNotNull(updateTEmployeeProject)) {
if (updateTEmployeeProject.getSocialStatus() == CommonConstants.dingleDigitIntArray[1] ||
updateTEmployeeProject.getFundStatus() == CommonConstants.dingleDigitIntArray[1]) {
return R.failed("人员在原项目中存在在途的服务(社保或公积金在途),请先终止后,再进行划转");
if (updateTEmployeeProject.getSocialStatus() == CommonConstants.dingleDigitIntArray[1]
&& vo.getChangeItems().indexOf(CommonConstants.ONE_STRING) >= CommonConstants.ZERO_INT) {
return R.failed("人员在原项目中存在在途的社保,请先终止后,再进行划转");
}
if (updateTEmployeeProject.getFundStatus() == CommonConstants.dingleDigitIntArray[1]
&& vo.getChangeItems().indexOf(CommonConstants.TWO_STRING) >= CommonConstants.ZERO_INT){
return R.failed("人员在原项目中存在在途的公积金,请先终止后,再进行划转");
}
TSettleDomain tSettleDomain = tSettleDomainMapper.selectOne(Wrappers.<TSettleDomain>query().lambda()
......@@ -517,7 +522,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
tEmployeeProjectService.saveOrUpdate(newEmpProject);
//同步减项老项目档案
if (CommonConstants.ONE_STRING.equals(vo.getChangeType())){
oldEmpProject.setIsLeaveEmployee(CommonConstants.ONE_INT);
oldEmpProject.setIsLeaveEmployee(CommonConstants.ZERO_INT);
R res = tEmployeeProjectService.deleteEmpPro(oldEmpProject);
resStr.append(res.getMsg());
}
......
......@@ -296,10 +296,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
// 初始化
tEmployeeContractInfo.setUpdateBy(user.getId());
tEmployeeContractInfo.setUpdateTime(LocalDateTime.now());
if (CommonConstants.TWO_STRING.equals(tEmployeeContractInfo.getContractType())
|| CommonConstants.ZERO_STRING.equals(tEmployeeContractInfo.getContractType())) {
tEmployeeContractInfo.setContractEnd(null);
}
//是否归档:否
tEmployeeContractInfo.setIsFile(CommonConstants.ONE_STRING);
//是否在用:否
......@@ -342,6 +339,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
}
if (CommonConstants.TWO_STRING.equals(tEmployeeContractInfo.getContractType())
|| CommonConstants.ZERO_STRING.equals(tEmployeeContractInfo.getContractType())) {
tEmployeeContractInfo.setContractEnd(null);
}
return this.saveContractAndAtta(tEmployeeContractInfo, user);
} catch (Exception e) {
log.error("员工合同保存异常:" + e.getMessage());
......@@ -449,6 +450,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (Common.isNotNull(tEmployeeContractInfo.getAttaList())) {
tEmployeeContractInfo.setIsFile(CommonConstants.ZERO_STRING);
}
if (CommonConstants.TWO_STRING.equals(tEmployeeContractInfo.getContractType())
|| CommonConstants.ZERO_STRING.equals(tEmployeeContractInfo.getContractType())) {
tEmployeeContractInfo.setContractEnd(null);
}
if (null != tEmployeeContractInfo.getSettleDomain()
&& (Common.isEmpty(tEmployeeContractInfo.getSubjectUnit())
|| Common.isEmpty(tEmployeeContractInfo.getSubjectDepart()))) {
......@@ -472,7 +477,6 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
// 标准合同、劳动派遣合同、其他。————社保公积金都派减,自动审核通过
this.judgeAuditStatus(tEmployeeContractInfo, user);
if (Common.isEmpty(tEmployeeContractInfo.getId())) {
// 针对编码再做一次重复性校验
String isCur = baseMapper.getContractByApplyNo(tEmployeeContractInfo.getApplyNo());
......@@ -485,12 +489,14 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
this.updateFileMainId(tEmployeeContractInfo);
}
} else {
baseMapper.updateById(tEmployeeContractInfo);
}
// 不是待提交,记录审核记录
this.setAuditInfo(tEmployeeContractInfo);
// 更新档案合同状态
if (tEmployeeContractInfo.getAuditStatus() == CommonConstants.TWO_INT) {
this.updateEmployeeContractStatus(tEmployeeContractInfo);
}
......
......@@ -580,6 +580,7 @@ public interface CommonConstants {
String START = "启用";
String STOP = "停用";
String CONTRACT_TYPE_TWO="无固定期限";
String CONTRACT_TYPE_ZERO="已完成一定工作任务为期限";
}
......@@ -567,4 +567,8 @@ public interface ErrorCodes {
* 社保办理:无办理权限或无可需要办理的社保数据
*/
String SOCIAL_IMPORT_HANDLE_NOT_EXITS = "social.import.handle.not.exits";
/**
* 社保办理:该数据已处理,请勿重复操作
*/
String SOCIAL_IMPORT_SAME_INFO = "social.import.same.info";
}
......@@ -221,6 +221,7 @@ fund_import_handle_reason_not_empty=\u516C\u79EF\u91D1\u529E\u7406\uFF1A\u529E\u
social_import_handle_reason_not_empty=\u793E\u4FDD\u529E\u7406\uFF1A\u4EFB\u4E00\u9669\u79CD\u529E\u7406\u5931\u8D25\uFF0C\u5931\u8D25\u7C7B\u578B\u5FC5\u586B
social_import_handle_not_empty=\u793E\u4FDD\u529E\u7406\u5931\u8D25\uFF0C\u5FC5\u987B\u529E\u7406\u5176\u4E2D\u4E00\u4E2A\u9669\u79CD
social.import.handle.not.exits=\u65E0\u529E\u7406\u6743\u9650\u6216\u65E0\u53EF\u9700\u8981\u529E\u7406\u7684\u793E\u4FDD\u6570\u636E
social.import.same.info=\u8BE5\u6570\u636E\u5DF2\u5904\u7406\uFF0C\u8BF7\u52FF\u91CD\u590D\u64CD\u4F5C
......
......@@ -299,6 +299,23 @@ public class SalaryAccountUtil implements Serializable {
errorList.add(new ErrorMessage((i + 2), "请注意:工资发放时间,只能是【立即发】或【暂停发】!你的内容:【"+cellValueStr+"】"));
continue;
}
if (SalaryConstants.SALARY_STYLE.equals(scs.getJavaFiedName())
&& !SalaryConstants.SALARY_STYLE_YIN.equals(cellValueStr)
&& !SalaryConstants.SALARY_STYLE_XIAN.equals(cellValueStr)) {
errorFlag = false;
errorList.add(new ErrorMessage((i + 2), "请注意:发放方式,只能是【银行】或【现金】!你的内容:【"+cellValueStr+"】"));
continue;
}
if (SalaryConstants.IS_PERSON_TAX.equals(scs.getJavaFiedName())
&& !SalaryConstants.IS_COMPANY.equals(cellValueStr)
&& !SalaryConstants.IS_PERSON_OTHER.equals(cellValueStr)
&& !SalaryConstants.IS_PERSON.equals(cellValueStr)) {
errorFlag = false;
errorList.add(new ErrorMessage((i + 2), "请注意:是否个人承担部分税费,只能是【"
+SalaryConstants.IS_COMPANY+"】或【"+SalaryConstants.IS_PERSON_OTHER+"】或【"
+SalaryConstants.IS_PERSON+"】!你的内容:【"+cellValueStr+"】"));
continue;
}
setFields(field, cellValueStr, attr, fieldType, entity);
error = validateUtil(cellValueStr, attr, (i + 2));
if (null != error) {
......@@ -481,6 +498,7 @@ public class SalaryAccountUtil implements Serializable {
continue;
}
newEmps.setSalaryGiveTime(entity.getSalaryGiveTime());
log.error(newEmps.getEmpName());
saveNewEmpList.add(newEmps);
checkTaxMonthList.add(newEmps.getEmpIdcard());
} else {
......@@ -963,9 +981,14 @@ public class SalaryAccountUtil implements Serializable {
}
areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + entity.getBankCity().trim()
+ CommonConstants.DOWN_LINE_STRING + entity.getBankProvince().trim());
log.error("entity.getBankCity():"+entity.getBankCity());
log.error("entity.getBankProvince():"+entity.getBankProvince());
log.error("areaStr:"+areaStr);
if (Common.isNotNull(areaStr)) {
newEmp.setBankCity(areaStr);
log.error("1:areaStr:"+areaStr);
} else {
log.error("2:开户行市错误:"+areaStr);
error = "第" + (i + 2) + "行:" + newEmpStr + "-开户行市错误:" + entity.getBankCity();
errorList.add(new ErrorMessage((i + 2), error));
return false;
......
......@@ -195,4 +195,9 @@ public class SalaryConstants {
public static final String TAX_MONTH_LENGTH = "计税月份错误";
// 暂停发java
public static final String SALARY_GIVE_TIME_JAVA = "salaryGiveTime";
public static final String SALARY_STYLE = "salaryStyle";
public static final String SALARY_STYLE_YIN = "银行";
public static final String SALARY_STYLE_XIAN = "现金";
public static final String IS_PERSON_TAX = "isPersonTax";
}
......@@ -27,6 +27,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.ErrorDetailVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
......@@ -66,6 +67,8 @@ public class TPaymentInfoController {
private final TPaymentInfoService tPaymentInfoService;
private final MenuUtil menuUtil;
/**
* 简单分页查询
*
......@@ -89,6 +92,16 @@ public class TPaymentInfoController {
@Operation(description = "简单分页查询")
@GetMapping("/newPage")
public R<IPage<TPaymentInfoNewVo>> getTPaymentInfoNewPage(Page<TPaymentInfo> page, TPaymentInfoSearchVo tPaymentInfo) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, tPaymentInfo);
if (Common.isNotNull(tPaymentInfo.getAuthSql())) {
if (tPaymentInfo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
tPaymentInfo.setAuthSql(tPaymentInfo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "a.SETTLE_DOMAIN"));
}
if (tPaymentInfo.getAuthSql().contains("1=2 EXISTS")) {
tPaymentInfo.setAuthSql(tPaymentInfo.getAuthSql().replace("1=2 EXISTS", "EXISTS"));
}
}
return new R<>(tPaymentInfoService.getTPaymentInfoNewPage(page, tPaymentInfo));
}
......@@ -101,6 +114,16 @@ public class TPaymentInfoController {
@Operation(description = "简单分页查询")
@GetMapping("/newPageInfo")
public R<TPaymentInfoNewVo> getTPaymentInfoNewPageInfo(TPaymentInfoSearchVo tPaymentInfo) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, tPaymentInfo);
if (Common.isNotNull(tPaymentInfo.getAuthSql())) {
if (tPaymentInfo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
tPaymentInfo.setAuthSql(tPaymentInfo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "a.SETTLE_DOMAIN"));
}
if (tPaymentInfo.getAuthSql().contains("1=2 EXISTS")) {
tPaymentInfo.setAuthSql(tPaymentInfo.getAuthSql().replace("1=2 EXISTS", "EXISTS"));
}
}
return R.ok(tPaymentInfoService.getTPaymentInfoNewPageInfo(tPaymentInfo));
}
......@@ -313,6 +336,16 @@ public class TPaymentInfoController {
@PostMapping("/sumSearchExport")
@PreAuthorize("@pms.hasPermission('social_tpaymentinfo_export')")
public void sumSearchExport(HttpServletResponse response, @RequestBody TPaymentInfoSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo);
if (Common.isNotNull(searchVo.getAuthSql())) {
if (searchVo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
searchVo.setAuthSql(searchVo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "a.SETTLE_DOMAIN"));
}
if (searchVo.getAuthSql().contains("1=2 EXISTS")) {
searchVo.setAuthSql(searchVo.getAuthSql().replace("1=2 EXISTS", "EXISTS"));
}
}
tPaymentInfoService.sumSearchExport(response, searchVo);
}
......
......@@ -78,6 +78,7 @@ import java.math.BigDecimal;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
/**
......@@ -5029,6 +5030,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<FundImportHandleVo> util1 = new ExcelUtil<>(FundImportHandleVo.class);
ConcurrentHashMap<String, String> map = new ConcurrentHashMap<>();
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
......@@ -5073,7 +5075,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
fundImportHandle(cachedDataList, errorMessageList,user,tDispatchInfo);
fundImportHandle(cachedDataList, errorMessageList,user,tDispatchInfo,map);
log.info("存储数据库成功!");
}
}).sheet().doRead();
......@@ -5091,7 +5093,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
* @Param
* @return
**/
public void fundImportHandle(List<FundImportHandleVo> excelVOList, List<ErrorMessage> errorMessageList, YifuUser user,TDispatchInfo dispatchInfo) {
public void fundImportHandle(List<FundImportHandleVo> excelVOList, List<ErrorMessage> errorMessageList,
YifuUser user,TDispatchInfo dispatchInfo,ConcurrentHashMap<String, String> map) {
if (!Common.isNotNull(excelVOList)) {
return;
}
......@@ -5127,6 +5130,13 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(CommonConstants.PARAM_INFO_ERROR),excel));
continue;
}
//表内数据重复 员工身份证
if (null == map.get(excel.getEmpIdcard())) {
map.put(excel.getEmpIdcard(),excel.getRowIndex().toString());
} else {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.SOCIAL_IMPORT_SAME_INFO) , excel));
continue;
}
// 办理失败,原因必填
if (CommonConstants.ONE_STRING.equals(excel.getHandleStatus()) && Common.isEmpty(excel.getReasonType())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.FUND_IMPORT_HANDLE_REASON_NOT_EMPY),excel));
......@@ -5185,6 +5195,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<SocialImportHandleVo> util1 = new ExcelUtil<>(SocialImportHandleVo.class);
ConcurrentHashMap<String, String> idcardMap = new ConcurrentHashMap<>();
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
......@@ -5229,7 +5240,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
socialImportHandle(cachedDataList, errorMessageList,user,mId);
socialImportHandle(cachedDataList, errorMessageList,user,mId,idcardMap);
log.info("存储数据库成功!");
}
}).sheet().doRead();
......@@ -5247,7 +5258,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
* @Param
* @return
**/
public void socialImportHandle(List<SocialImportHandleVo> excelVOList, List<ErrorMessage> errorMessageList, YifuUser user,String mId) {
public void socialImportHandle(List<SocialImportHandleVo> excelVOList, List<ErrorMessage> errorMessageList,
YifuUser user,String mId,ConcurrentHashMap<String, String> map) {
if (!Common.isNotNull(excelVOList)) {
return;
}
......@@ -5274,8 +5286,6 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
String handlerRemaek;
Map<String,String> map = new HashMap<>();
for (int i = 0; i < excelVOList.size(); i++) {
StringBuilder socialSucessType = new StringBuilder();
StringBuilder socialFailureType = new StringBuilder();
......@@ -5285,7 +5295,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (null == map.get(excel.getEmpIdcard())) {
map.put(excel.getEmpIdcard(),excel.getRowIndex().toString());
} else {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "存在重复身份证行(" + map.get(excel.getEmpIdcard())+ ")请先去重" , excel));
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.SOCIAL_IMPORT_SAME_INFO) , excel));
continue;
}
//身份证加任一险种必填
......
......@@ -809,6 +809,9 @@
AND a.SOCIAL_TOWN = '${tPaymentInfo.socialTown}'
</if>
</if>
<if test="tPaymentInfo.authSql != null and tPaymentInfo.authSql.trim() != ''">
${tPaymentInfo.authSql}
</if>
<!-- 区域 默认精准查询 0 包含下级查询 1 结束 2023-03-02 fxj -->
</if>
</if>
......@@ -878,6 +881,9 @@
AND a.FUND_TOWN = '${tPaymentInfo.socialTown}'
</if>
</if>
<if test="tPaymentInfo.authSql != null and tPaymentInfo.authSql.trim() != ''">
${tPaymentInfo.authSql}
</if>
<!-- 区域 默认精准查询 0 包含下级查询 1 结束 2023-03-02 fxj -->
</if>
</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