|
@@ -21,6 +21,7 @@ import restcontroller.system.attachment.Attachment;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
|
|
@@ -140,6 +141,17 @@ public class cashbill extends Controller {
|
|
|
msg = msg + "【账户名称为空】";
|
|
|
|
|
|
}
|
|
|
+ if (StringUtils.isEmpty(row.getString("accountname"))) {
|
|
|
+ iserr = true;
|
|
|
+ msg = msg + "【账户名称为空】";
|
|
|
+
|
|
|
+ }
|
|
|
+ if (!isValidFormat(row.getString("period"))) {
|
|
|
+ iserr = true;
|
|
|
+ msg = msg + "【归属日期格式错误】";
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
if (!isBigDecimal(row.getString("amount"))) {
|
|
|
iserr = true;
|
|
|
msg = msg + "【金额错误:" + row.getString("amount") + "】";
|
|
@@ -1319,5 +1331,15 @@ public class cashbill extends Controller {
|
|
|
remind.setTouserid(userList);
|
|
|
remind.sendByDialogMsg().createSys_message();
|
|
|
}
|
|
|
+ public boolean isValidFormat(String date) throws ParseException {
|
|
|
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ dateFormat.setLenient(false); // 设置解析日期时是否宽松,即是否允许解析不严格符合格式的日期字符串
|
|
|
+ try {
|
|
|
+ Date parsedDate = dateFormat.parse(date);
|
|
|
+ return true;
|
|
|
+ } catch (ParseException e) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
}
|