|
|
@@ -27,6 +27,7 @@ import ss.auth.RauthU;
|
|
|
import ss.bpm.BpmC;
|
|
|
import ss.cb.CbB;
|
|
|
import ss.cb.CbU;
|
|
|
+import ss.cmn.str.StrDate;
|
|
|
import ss.ccp.CcpB;
|
|
|
import ss.ccp.CcpFieldB;
|
|
|
import ss.db.SqlCmd;
|
|
|
@@ -2504,12 +2505,14 @@ if (viewob.isBox &&
|
|
|
}
|
|
|
|
|
|
private static ObjFuncB rdMpRcLeaveXjFunc(ObjB viewob, Map<String, Object> row, HttpServletRequest request) {
|
|
|
- if (viewob == null || row == null || request == null || !MdU.isReqByMd(request))
|
|
|
+ if (viewob == null || row == null || request == null)
|
|
|
return null;
|
|
|
if (!RcC.OBJ_rcName.equals(viewob.name))
|
|
|
return null;
|
|
|
+ if (!isMpRcLeaveReq(request))
|
|
|
+ return null;
|
|
|
|
|
|
- String ssServ = StringUtils.trimToEmpty(request.getParameter("ssServ"));
|
|
|
+ String ssServ = rdMpRcLeaveServName(request);
|
|
|
if (!"rc_cxsy".equals(ssServ) && !"rc_cxlb".equals(ssServ))
|
|
|
return null;
|
|
|
|
|
|
@@ -2526,17 +2529,71 @@ if (viewob.isBox &&
|
|
|
if (rclbm != RcC.RCLB_sj && rclbm != RcC.RCLB_bj)
|
|
|
return null;
|
|
|
|
|
|
- Object jssjObj = row.get("jssj");
|
|
|
- if (!(jssjObj instanceof Timestamp))
|
|
|
+ Timestamp jssj = rdMpRcLeaveTime(row.get("jssj"));
|
|
|
+ if (jssj == null)
|
|
|
return null;
|
|
|
-
|
|
|
- Timestamp jssj = (Timestamp) jssjObj;
|
|
|
if (!jssj.after(new Timestamp(System.currentTimeMillis())))
|
|
|
return null;
|
|
|
|
|
|
return viewob.funcMap.get("xj");
|
|
|
}
|
|
|
|
|
|
+ private static boolean isMpRcLeaveReq(HttpServletRequest request) {
|
|
|
+ if (MdU.isReqByMd(request))
|
|
|
+ return true;
|
|
|
+
|
|
|
+ String referer = StringUtils.trimToEmpty(request.getHeader("Referer"));
|
|
|
+ if (referer.contains("/page/mp_"))
|
|
|
+ return true;
|
|
|
+
|
|
|
+ return "miniprogram".equalsIgnoreCase(StringUtils.trimToEmpty(request.getParameter("from")));
|
|
|
+ }
|
|
|
+
|
|
|
+ private static String rdMpRcLeaveServName(HttpServletRequest request) {
|
|
|
+ String ssServ = StringUtils.trimToEmpty(request.getParameter(ServC.URL_ssServ));
|
|
|
+ if (StringUtils.isBlank(ssServ))
|
|
|
+ ssServ = StringUtils.trimToEmpty(request.getParameter("service"));
|
|
|
+ return ssServ;
|
|
|
+ }
|
|
|
+
|
|
|
+ private static Timestamp rdMpRcLeaveTime(Object value) {
|
|
|
+ if (value instanceof Timestamp)
|
|
|
+ return (Timestamp) value;
|
|
|
+ if (value instanceof java.util.Date)
|
|
|
+ return new Timestamp(((java.util.Date) value).getTime());
|
|
|
+ if (value instanceof Number)
|
|
|
+ return new Timestamp(((Number) value).longValue());
|
|
|
+ if (value == null)
|
|
|
+ return null;
|
|
|
+
|
|
|
+ String valStr = StringUtils.trimToEmpty(String.valueOf(value));
|
|
|
+ if (StringUtils.isBlank(valStr))
|
|
|
+ return null;
|
|
|
+
|
|
|
+ String timeStr = valStr.replace('T', ' ');
|
|
|
+ if (timeStr.length() == 10)
|
|
|
+ timeStr += " 00:00:00";
|
|
|
+ else if (timeStr.length() == 16)
|
|
|
+ timeStr += ":00";
|
|
|
+
|
|
|
+ try {
|
|
|
+ return Timestamp.valueOf(timeStr);
|
|
|
+ } catch (Exception ignored) {
|
|
|
+ // 继续尝试兼容历史时间格式。Lin
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ return StrDate.toTimestamp(timeStr, "yyyy-MM-dd HH:mm:ss");
|
|
|
+ } catch (Exception ignored) {
|
|
|
+ // 继续尝试兼容到分钟的时间串。Lin
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ return StrDate.toTimestamp(timeStr, "yyyy-MM-dd HH:mm");
|
|
|
+ } catch (Exception ignored) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public static Map<String, String> rdRequestParam(HttpServletRequest request) {
|
|
|
Map<String, String> requestParam = new HashMap<>();
|