Commit 746abc42 authored by hongguangwu's avatar hongguangwu

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

parents f9f68621 7afc6e87
......@@ -148,7 +148,17 @@ public class Common {
Matcher match = pattern.matcher(str);
return match.matches() != false;
}
// 字符串为数字 可以带N位小数点
private static final Pattern NUMBER_PATTERN = compile("^-?\\d+(\\.\\d+)?$");
public static boolean isNumberStr(String str) {
// 判断字符串为数字 可以带N位小数点的正则表达式
if (str == null || str.isEmpty()) {
return false;
}
Matcher match = NUMBER_PATTERN.matcher(str);
return match.matches();
}
/**
* 允许上传的文件类型
*
......@@ -793,10 +803,8 @@ public class Common {
return false;
}
// 使用正则表达式匹配格式
// 格式要求: 数字(可带小数),数字(可带小数);数字(可带小数),数字(可带小数);...
// 其中数字为一个或多个数字字符,可能包含小数点
return str.matches("\\d+(\\.\\d+)?,\\d+(\\.\\d+)?(;\\d+(\\.\\d+)?,\\d+(\\.\\d+)?)*");
// 使用正则表达式匹配格式 10.01,10;12,13 ,数字最多两位小数
return str.matches("\\d+(\\.\\d{1,2})?,\\d+(\\.\\d{1,2})?(;\\d+(\\.\\d{1,2})?,\\d+(\\.\\d{1,2})?)*");
}
/**
* 校验字符串是否符合格式 2025-11 或 2025/11 或202511
......
......@@ -697,6 +697,11 @@ public class ExcelUtil <T> implements Serializable {
}
//最大值校验
if (Common.isNotNull(attr.max()) && !CommonConstants.ZERO_STRING.equals(attr.max())) {
//先判断是否为科学计数的数,然后转换成非科学计数的字符串
if (c.indexOf("E+") >= 0 && Common.isNumberStr(c.replace("E+", ""))){
//如果金额科学计数,转出正常值 如 c = 1.23456789E+9 转换成 c = 1234567890
c = new BigDecimal(c).toPlainString();
}
if (Common.isNumber(c)) {
if (attr.isDouble() && Double.doubleToLongBits(Double.valueOf(c).doubleValue()) > Double.valueOf(attr.max()).doubleValue()){
return errorInfo(attr, "_超出最大值", i);
......@@ -708,12 +713,17 @@ public class ExcelUtil <T> implements Serializable {
return errorInfo(attr, "_超出最大值", i);
}
}
} else {
}else {
return errorInfo(attr, "_必须为数字且最多两位小数", i);
}
}
//最小值校验
if (attr.min() > 0) {
//先判断是否为科学计数的数,然后转换成非科学计数的字符串
if (c.indexOf("E+") >= 0 && Common.isNumberStr(c.replace("E+", ""))){
//如果金额科学计数,转出正常值 如 c = 1.23456789E+9 转换成 c = 1234567890
c = new BigDecimal(c).toPlainString();
}
if (Common.isNumber(c)) {
if (attr.isFloat()){
if (Float.valueOf(c).compareTo(attr.min()) < CommonConstants.ZERO_INT) {
......
......@@ -17,6 +17,8 @@ public class HolidayCrawler {
* 年度法定节假日、公休日查询接口地址
*/
private static final String YEAR_HOLIDAY_URL = "https://api.apihubs.cn/holiday/get?field=date,weekend&year="+DateUtil.getYear(new Date())+"&workday=2&order_by=1&cn=1&page=1&size=500";
private static final String NEXT_YEAR_HOLIDAY_URL = "https://api.apihubs.cn/holiday/get?field=date,weekend&year="+(DateUtil.getYearOfInt(new Date())+1)+"&workday=2&order_by=1&cn=1&page=1&size=500";
/**
* http请求工具类
*/
......@@ -42,4 +44,25 @@ public class HolidayCrawler {
}
return null;
}
public static List<Map<String,Object>> initNextYearHolidays(){
long ts = System.currentTimeMillis();
Map<String,Object> result = REST_TEMPLATE.getForObject(String.format(NEXT_YEAR_HOLIDAY_URL, ts, ts), Map.class);
if(null!=result){
String code=String.valueOf(result.get("code"));
String msg=String.valueOf(result.get("msg"));
if(code.equals("0") && msg.equals("ok")){
Map data= (Map) result.get("data");
if(null!=data){
List<Map<String,Object>> list= (List<Map<String, Object>>) data.get("list");
return list;
/*int i=0;
for(Map<String,Object> d:list){
System.out.println("i="+(++i)+" 日期="+d.get("date")+" 类型="+d.get("weekend")+" weekend_cn="+d.get("weekend_cn"));
}*/
}
}
}
return null;
}
}
......@@ -685,7 +685,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
return R.other(CommonConstants.THREE_INT,null,"该人员存在在途/有效的公积金数据,请将'是否已参保'调整为'是'");
}
//判断公积金基数 是否小于 公积金户配置的最低基数
if (Common.isNotNull(preVo.getDispatchInfoFundPreVo().getConfigHouseId())
/*if (Common.isNotNull(preVo.getDispatchInfoFundPreVo().getConfigHouseId())
&& Common.isNotNull(preVo.getDispatchInfoFundPreVo().getProvidentCardinal())){
R<SysBaseSetInfoVo> resR = socialDaprUtils.getSocialHouseBaseSet(preVo.getDispatchInfoFundPreVo().getConfigHouseId());
if (Common.isNotNull(resR) && resR.getData() != null) {
......@@ -697,7 +697,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
}else {
return R.other(CommonConstants.THREE_INT,null,"获取公积金配置信息失败!");
}
}
}*/
}
//点击“接收确认”的时候,监测到该人员该项目下已有在项的档案时,再次提醒:该人员已在项,
......@@ -1206,7 +1206,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
continue;
}
//判断公积金基数 是否小于 公积金户配置的最低基数
if (Common.isNotNull(preVo.getDispatchInfoFundPreVo().getConfigHouseId())
/*if (Common.isNotNull(preVo.getDispatchInfoFundPreVo().getConfigHouseId())
&& Common.isNotNull(preVo.getDispatchInfoFundPreVo().getProvidentCardinal())){
resR = socialDaprUtils.getSocialHouseBaseSet(preVo.getDispatchInfoFundPreVo().getConfigHouseId());
if (Common.isNotNull(resR) && resR.getData() != null) {
......@@ -1224,7 +1224,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
errorList.add(exitCheckVo);
continue;
}
}
}*/
}
//点击“接收确认”的时候,监测到该人员该项目下已有在项的档案时,再次提醒:该人员已在项,
//状态将更新成“已处理”;处理记录中,针对此情况,记录真实的进项时间,备注:先于登记入项
......
......@@ -55,7 +55,7 @@ public class SysBaseSetFundExportVo implements Serializable {
/**
* 0.在用1.终止2过期
*/
@ExcelAttribute(name = "状态",readConverterExp = "0=在用,1=终止,2=过期")
@ExcelAttribute(name = "状态",readConverterExp = "0=启用,1=禁用,2=过期")
@Schema(description = "状态")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("状态")
......
......@@ -44,7 +44,7 @@ public class SysBaseSetSocialExportVo implements Serializable {
/**
* 0.在用1.终止2过期
*/
@ExcelAttribute(name = "状态",readConverterExp = "0=在用,1=终止,2=过期")
@ExcelAttribute(name = "状态",readConverterExp = "0=启用,1=禁用,2=过期")
@Schema(description = "状态")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("状态")
......
......@@ -175,6 +175,18 @@ public class THolidayInfoController {
tHolidayInfoService.createHolidayInfo();
}
/**
* @Description: 手动生成次年年度假期表 --考虑到数据没出来可多次操作,线上再添加
* @Author: fxj
* @Date: 2024/5/8
**/
@Operation(summary = "手动生成次年年度假期表 ", description = "手动生成次年年度假期表 ")
@SysLog("手动生成次年年度假期表 ")
@PostMapping("/createNextYearHolidayInfo")
public void createNextYearHolidayInfo() {
tHolidayInfoService.createHolidayInfo();;
}
/**
* @Author huyc
* @Description 查询日期的前一个/后一个工作日
......
......@@ -54,7 +54,9 @@ public interface THolidayInfoService extends IService<THolidayInfo> {
TEmployeeInsuranceWorkDayVo getInitBeforeOrAfterWorkDay(TEmployeeInsuranceWorkDayVo vo);
TEmployeeInsuranceWorkDayVo selectBeforeOrAfterWorkDay(TEmployeeInsuranceWorkDayVo vo);
void createNextYearHolidayInfo();
TEmployeeInsuranceWorkDayVo selectBeforeOrAfterWorkDay(TEmployeeInsuranceWorkDayVo vo);
TEmployeeInsuranceWorkDayVo selectBeforeOrAfterWorkDayCommon(TEmployeeInsuranceWorkDayVo vo);
......
......@@ -906,15 +906,7 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
infoVo.setUpBig(excel.getUpBig());
infoVo.setLowerBig(excel.getLowerBig());
}
//大病缴纳周期为按月缴纳方式为按比例需要填写比例无值提示
if (null == excel.getPayCompanyPro()
|| null == excel.getPayPersonalPro()
|| excel.getPayPersonalPro().compareTo(BigDecimal.ZERO) < 0
|| excel.getPayPersonalPro().compareTo(BigDecimal.ZERO) < 0){
errorMsg = new ErrorMessage(excel.getRowIndex(),"大病是否收取为是时,大病缴纳周期为“按月”的,单位或个人大病比例字段必填,且填写正确比例即可,请修改后重新提交",excel);
errorMessageList.add(errorMsg);
continue;
}
infoVo.setPayCompanyPro(excel.getPayCompanyPro());
infoVo.setPayPersonalPro(excel.getPayPersonalPro());
}
......@@ -1219,7 +1211,7 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
if (null != dateUse){
infoVo.setDoMonth(DateUtil.getYearAndMonth(dateFormat,0));
}else {
errorMsg = new ErrorMessage(excel.getRowIndex(),"执行月份格式错误,请修改后重新提交。");
errorMsg = new ErrorMessage(excel.getRowIndex(),"执行月份格式错误,请修改后重新提交。", excel);
errorMessageList.add(errorMsg);
continue;
}
......@@ -1354,12 +1346,12 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
fundPro.setPersonalPro(Double.valueOf(splitSub[1]));
//如果单位比例大于100或小于0 则报错
if (fundPro.getCompanyPro() > 100 || fundPro.getCompanyPro() < 0) {
errorMsg = new ErrorMessage(excel.getRowIndex(), "单位比例必填,只可填写“0-100”之间的数字,请修改后重新提交");
errorMsg = new ErrorMessage(excel.getRowIndex(), "单位比例必填,只可填写“0-100”之间的数字,请修改后重新提交", excel);
break;
}
//如果个人比例大于100或小于等于0 则报错
if (fundPro.getPersonalPro() > 100 || fundPro.getPersonalPro() < 0) {
errorMsg = new ErrorMessage(excel.getRowIndex(), "个人比例必填,只可填写“0-100”之间的数字,请修改后重新提交");
errorMsg = new ErrorMessage(excel.getRowIndex(), "个人比例必填,只可填写“0-100”之间的数字,请修改后重新提交", excel);
break;
}
}
......
......@@ -800,7 +800,12 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
if (null != domainR && null != domainR.getData() && null != domainR.getData().getDeptNos() && !domainR.getData().getDeptNos().isEmpty()) {
searchVo.setDeptNoList(domainR.getData().getDeptNos());
} else {
searchVo.setId(CommonConstants.ONE_STRING_NEGATE);
domainR = archivesDaprUtil.getAllDeptByCustomerLoginName(user.getUsername());
if (null != domainR && null != domainR.getData() && null != domainR.getData().getDeptNos() && !domainR.getData().getDeptNos().isEmpty()) {
searchVo.setDeptNoList(domainR.getData().getDeptNos());
} else {
searchVo.setId(CommonConstants.ONE_STRING_NEGATE);
}
}
}
}
......
......@@ -257,7 +257,7 @@ public class THolidayInfoServiceImpl extends ServiceImpl<THolidayInfoMapper, THo
@Override
public void createHolidayInfo() {
baseMapper.delete(Wrappers.<THolidayInfo>query().lambda());
baseMapper.delete(Wrappers.<THolidayInfo>query().lambda().eq(THolidayInfo::getYear,DateUtil.getYear(new Date())));
List<Map<String,Object>> json = HolidayCrawler.initHolidays();
List<THolidayInfo> saveList = new ArrayList<>();
THolidayInfo save;
......@@ -284,6 +284,35 @@ public class THolidayInfoServiceImpl extends ServiceImpl<THolidayInfoMapper, THo
log.info(DateUtil.getYear(new Date())+"年假期表初始化完成:");
}
@Override
public void createNextYearHolidayInfo() {
baseMapper.delete(Wrappers.<THolidayInfo>query().lambda().eq(THolidayInfo::getYear,(DateUtil.getYearOfInt(new Date())+1)+""));
List<Map<String,Object>> json = HolidayCrawler.initNextYearHolidays();
List<THolidayInfo> saveList = new ArrayList<>();
THolidayInfo save;
for(Map<String,Object> d:json){
save = new THolidayInfo();
try {
save.setDate(DateUtil.stringToDate((String) d.get("date").toString(),DateUtil.ISO_DATE_FORMAT));
}catch (Exception e){
log.error("假期表初始化异常:"+d.get("date"),e);
continue;
}
save.setDay(DateUtil.getDay(save.getDate()));
save.setMonth(DateUtil.getMonth(save.getDate()));
save.setYear(DateUtil.getYear(save.getDate()));
save.setCreateBy("1");
save.setCreateName("admin");
save.setCreateTime(LocalDateTime.now());
save.setUpdateBy("1");
saveList.add(save);
}
if (Common.isNotNull(saveList)){
this.saveBatch(saveList);
}
log.info(DateUtil.getYear(new Date())+"年假期表初始化完成:");
}
@Override
public TEmployeeInsuranceWorkDayVo selectBeforeOrAfterWorkDay(TEmployeeInsuranceWorkDayVo vo) {
//获取当年所有假期配置表
......
......@@ -1267,7 +1267,7 @@
DATE_FORMAT(d.CREATE_TIME, '%Y-%m-%d %H:%i:%s') as dispatchTime,
a.UNIT_PROVIDENT_PER,
a.PERSONAL_PROVIDENT_PER,
a.UNIT_PROVIDENG_CARDINAL as 'providentCardinal'
a.UNIT_PROVIDENG_CARDINAL
FROM t_social_fund_info a
inner join t_dispatch_info d on a.DISPATCH_ID = d.ID
where a.EMP_IDCARD = #{empIdcard}
......
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