Commit c4441c0b authored by fangxinjiang's avatar fangxinjiang

预派单调整

parent a7589c42
......@@ -1599,4 +1599,27 @@ public class DateUtil {
return null;
}
}
public static boolean isDate(String dateText,String format) {
if (dateText == null) {
return false;
}
DateFormat df = null;
try {
if (format != null) {
df = new SimpleDateFormat(format);
} else {
df = new SimpleDateFormat(ISO_DATE_FORMAT);
}
df.setLenient(false);
df.parse( dateText.replace("/","").replace("-","")
.replace(CommonConstants.YEAR,"").replace(CommonConstants.MONTH,"")
.replace(CommonConstants.DAY,""));
} catch (ParseException e) {
return false;
}
return true;
}
}
......@@ -45,4 +45,5 @@ public class PreDispatchConstants {
public static final String NO_SOCIAL_FUND_ADDRESS_REDUCE = "派减:养老城市和公积金城市不可同时为空,请确认表中有‘养老城市’和‘公积金城市’数据列及数据!";
public static final String GET_AREA_INFO = "获取区域数据失败!";
public static final String TEL_NOT_EMPTY = "联系电话2不可为空!";
public static final String LEAVE_DATE_FORMAT_ERROR = "离职日期格式错误,正确格式为'yyyy-MM-dd'";
}
......@@ -629,7 +629,11 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
}
}
if (Common.isNotNull(errorMsgList)) {
return R.ok(errorMsgList,"操作成功,存在异常数据,请核实");
for (ErrorMessage msg:errorMsgList){
if (CommonConstants.RED.equals(msg.getColor())){
return R.ok(errorMsgList,"操作成功,存在异常数据,请核实");
}
}
}
return R.ok();
}
......@@ -755,6 +759,11 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
if (checkAddRepeat(errorList, existsMap, i, info)) {
continue;
}
if (Common.isNotNull(info.getLeaveDate())
&& DateUtil.isDate(info.getLeaveDate(),DateUtil.ISO_EXPANDED_DATE_FORMAT)){
errorList.add(new ErrorMessage(i, PreDispatchConstants.LEAVE_DATE_FORMAT_ERROR));
continue;
}
// 2.基础封装 其他
initReduceBaseInfo(null, info);
// 3.先校验已有数据
......@@ -2264,7 +2273,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
errorMsgList.add(new ErrorMessage(i,
pre.getEmpIdcard() +
CommonConstants.COLON_STRING +
errorMessage.getMessage()));
errorMessage.getMessage(),errorMessage.getColor()));
}
}
}
......
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