|
|
@@ -15,23 +15,24 @@ import com.kingdee.eas.base.attachment.BoAttchAssoFactory;
|
|
|
import com.kingdee.eas.base.attachment.BoAttchAssoInfo;
|
|
|
import com.kingdee.eas.base.codingrule.CodingRuleManagerFactory;
|
|
|
import com.kingdee.eas.base.codingrule.ICodingRuleManager;
|
|
|
-import com.kingdee.eas.base.common.DCInfo;
|
|
|
import com.kingdee.eas.base.permission.UserCollection;
|
|
|
import com.kingdee.eas.base.permission.UserFactory;
|
|
|
import com.kingdee.eas.base.permission.UserInfo;
|
|
|
import com.kingdee.eas.basedata.org.*;
|
|
|
import com.kingdee.eas.basedata.person.PersonInfo;
|
|
|
import com.kingdee.eas.common.EASBizException;
|
|
|
-import com.kingdee.eas.cp.eip.sso.util.LoginUtil;
|
|
|
import com.kingdee.eas.custom.beisen.utils.Helper;
|
|
|
import com.kingdee.eas.custom.beisenconfig.*;
|
|
|
import com.kingdee.eas.custom.enumerations.ViewTypeEnum;
|
|
|
+import com.kingdee.eas.custom.interfacelog.businessoperationlog.*;
|
|
|
+import com.kingdee.eas.fi.arap.util.DBUtil;
|
|
|
import com.kingdee.eas.framework.CoreBaseCollection;
|
|
|
import com.kingdee.eas.framework.CoreBaseInfo;
|
|
|
import com.kingdee.eas.framework.ICoreBase;
|
|
|
import com.kingdee.eas.hr.affair.*;
|
|
|
import com.kingdee.eas.hr.base.ApproveTypeEnum;
|
|
|
import com.kingdee.eas.hr.base.HRBillStateEnum;
|
|
|
+import com.kingdee.eas.hr.base.HRBizDefineInfo;
|
|
|
import com.kingdee.eas.hr.emp.PersonPhotoFactory;
|
|
|
import com.kingdee.eas.hr.emp.PersonPhotoInfo;
|
|
|
import com.kingdee.shr.attachment.AttachmentState;
|
|
|
@@ -52,12 +53,10 @@ import com.kingdee.shr.base.syssetting.util.SysSettingUIViewUtil;
|
|
|
import com.kingdee.shr.base.syssetting.web.dynamic.model.FieldInfo;
|
|
|
import com.kingdee.shr.base.syssetting.web.dynamic.view.converter.IUIViewConverter;
|
|
|
import com.kingdee.shr.base.syssetting.web.dynamic.view.converter.UIViewConverterFactory;
|
|
|
-import com.kingdee.shr.guilogin.web.wechart.WeChartUtil;
|
|
|
import com.kingdee.shr.ml.MLServiceFactory;
|
|
|
import com.kingdee.shr.ml.ResourceType;
|
|
|
import com.kingdee.util.LocaleUtils;
|
|
|
import com.kingdee.util.StringUtils;
|
|
|
-import com.kingdee.util.Uuid;
|
|
|
import org.apache.log4j.Logger;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
@@ -98,25 +97,25 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
.getUserCollection("select *,person.* where id = '" + caller.toString() + "'");
|
|
|
if (userCollection.size() > 0) {
|
|
|
UserInfo userInfo = userCollection.get(0);
|
|
|
- if (userInfo.getPerson()==null){
|
|
|
+ if (userInfo.getPerson() == null) {
|
|
|
userCollection = UserFactory.getLocalInstance(context)
|
|
|
.getUserCollection("select *,person.* where number = '" + userName + "'");
|
|
|
- if (userCollection.size()>0){
|
|
|
+ if (userCollection.size() > 0) {
|
|
|
UserInfo userInfo1 = userCollection.get(0);
|
|
|
BOSUuid id = userInfo1.getId();
|
|
|
- System.out.println("===userInfo======"+userInfo1.getPerson().getName());
|
|
|
+ System.out.println("===userInfo======" + userInfo1.getPerson().getName());
|
|
|
context.setCaller(new ObjectUuidPK(id));
|
|
|
SHRContext shrContext = new SHRContext(null, null, null);
|
|
|
context.put("UserInfo", userInfo1);
|
|
|
shrContext.setContext(context);
|
|
|
SHRContext.setInstance(shrContext);
|
|
|
}
|
|
|
-
|
|
|
- }else {
|
|
|
+
|
|
|
+ } else {
|
|
|
SHRContext instance = SHRContext.getInstance();
|
|
|
- System.out.println("++++++++"+instance);
|
|
|
- if (instance==null){
|
|
|
- System.out.println("======================"+null);
|
|
|
+ System.out.println("++++++++" + instance);
|
|
|
+ if (instance == null) {
|
|
|
+ System.out.println("======================" + null);
|
|
|
SHRContext shrContext = new SHRContext(null, null, null);
|
|
|
context.put("UserInfo", userCollection.get(0));
|
|
|
shrContext.setContext(context);
|
|
|
@@ -172,11 +171,13 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
BSViewConfigEntryInfo bsViewConfigEntryInfo = headBsViewConfigEntryCollection.get(0);
|
|
|
UIViewInfo view = bsViewConfigEntryInfo.getView();
|
|
|
String file = bsViewConfigEntryInfo.getFile();
|
|
|
+ IOperateLog localInstance = OperateLogFactory.getLocalInstance(ctx);
|
|
|
for (int i = 0; i < beiSenData.size(); i++) {
|
|
|
JSONObject jsonObject1 = beiSenData.getJSONObject(i);
|
|
|
JSONArray fileArray = jsonObject1.getJSONArray(file);
|
|
|
boolean isCreateData = bsViewConfigEntryInfo.isIsCreateData();
|
|
|
String headId = null;
|
|
|
+ OperateLogInfo operateLogInfo = new OperateLogInfo();
|
|
|
if (isCreateData) {
|
|
|
String headDataEntry = bsViewConfigEntryInfo.getHeadDataEntry();
|
|
|
if (headDataEntry != null && !headDataEntry.equals("")) {
|
|
|
@@ -190,27 +191,90 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
}
|
|
|
// 创建对应的实体对象
|
|
|
CoreBaseInfo coreBaseInfo = (CoreBaseInfo) MetaDataUtil.newInstance(objectValueClass, headDataEntry);
|
|
|
+ EntityObjectInfo entityObjectInfo = MetaDataUtil.getEntityObjectByBosType(coreBaseInfo.getBOSType());
|
|
|
+ operateLogInfo.setBusinessName(entityObjectInfo.getAlias());
|
|
|
+ operateLogInfo.setBosType(coreBaseInfo.getBOSType().toString());
|
|
|
+ OperateLogEntryCollection entrys = operateLogInfo.getEntrys();
|
|
|
if (coreBaseInfo instanceof EmpEnrollBizBillInfo) {
|
|
|
System.out.println("针对入职单处理");
|
|
|
String string = jsonObject1.getJSONObject("staffInfos").getString("id");
|
|
|
+ JSONArray entryRecord = jsonObject1.getJSONArray("entryRecord");
|
|
|
+ String entryRecordId = "";
|
|
|
+ if (entryRecord.size()>1){
|
|
|
+ JSONArray datas = paixu(entryRecord, "entryDate");
|
|
|
+ System.out.println("排序后"+datas);
|
|
|
+ entryRecordId = datas.getJSONObject(0).getString("id");
|
|
|
+ }else {
|
|
|
+ entryRecordId = entryRecord.getJSONObject(0).getString("id");
|
|
|
+ }
|
|
|
+
|
|
|
EmpEnrollBizBillCollection collection = EmpEnrollBizBillFactory.getLocalInstance(context)
|
|
|
- .getEmpEnrollBizBillCollection("select *,entrys.*,entrys.person.* where beisenid='" + string + "'");
|
|
|
+ .getEmpEnrollBizBillCollection("select *,entrys.*,entrys.person.* where entryRecordId='" + entryRecordId + "'");
|
|
|
if (collection.size() > 0) {
|
|
|
System.out.println("=======入职单已存在=============");//0044610
|
|
|
+ OperateLogEntryInfo operateLogEntryInfo = new OperateLogEntryInfo();
|
|
|
+ operateLogEntryInfo.setErrorInfo("入职单已存在");
|
|
|
+ entrys.add(operateLogEntryInfo);
|
|
|
+ try {
|
|
|
+ localInstance.save(operateLogInfo);
|
|
|
+ } catch (EASBizException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ System.out.println(e.getMessage());
|
|
|
+ }
|
|
|
continue;
|
|
|
+ }else {
|
|
|
+ EmpEnrollBizBillCollection collection1 = EmpEnrollBizBillFactory.getLocalInstance(context)
|
|
|
+ .getEmpEnrollBizBillCollection("select *,entrys.*,entrys.person.* where beisenid='" + string + "'");
|
|
|
+ if (collection1.size() > 0) {
|
|
|
+ System.out.println("==========清空beisenid=========");
|
|
|
+ String sql = "update T_HR_EmpEnrollBizBill set cfbeisenid = null where cfbeisenid = '"+string+"'";
|
|
|
+ DBUtil.execute(ctx,sql);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
try {
|
|
|
headId = headProcessing(view, jsonObject1, fileArray, file);
|
|
|
+ //operateLogInfo = new OperateLogInfo();
|
|
|
+ operateLogInfo.setBusinessId(headId);
|
|
|
+ OperateLogEntryCollection entrys = operateLogInfo.getEntrys();
|
|
|
+ OperateLogEntryInfo operateLogEntryInfo = new OperateLogEntryInfo();
|
|
|
+ String boy = jsonObject1.toJSONString();
|
|
|
+ if (boy.length()>500){
|
|
|
+ boy = boy.substring(0, 500);
|
|
|
+ }
|
|
|
+ operateLogEntryInfo.setErrorInfo(boy);
|
|
|
+ entrys.add(operateLogEntryInfo);
|
|
|
+ try {
|
|
|
+ localInstance.save(operateLogInfo);
|
|
|
+ } catch (EASBizException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ System.out.println(e.getMessage());
|
|
|
+ }
|
|
|
} catch (Exception e) {
|
|
|
+ operateLogInfo.setBusinessId(headId);
|
|
|
+ OperateLogEntryCollection entrys = operateLogInfo.getEntrys();
|
|
|
+ OperateLogEntryInfo operateLogEntryInfo = new OperateLogEntryInfo();
|
|
|
+ String f = e.getMessage();
|
|
|
+ if (f!=null&&f.length()>500){
|
|
|
+ f = f.substring(0, 500);
|
|
|
+ }
|
|
|
+ operateLogEntryInfo.setErrorInfo("整理保存头部数据失败!!!!" + f);
|
|
|
+ entrys.add(operateLogEntryInfo);
|
|
|
+ System.out.println(e.getMessage());
|
|
|
System.out.println("整理保存头部数据失败!!!!");
|
|
|
+ try {
|
|
|
+ localInstance.save(operateLogInfo);
|
|
|
+ } catch (EASBizException ex) {
|
|
|
+ ex.printStackTrace();
|
|
|
+ }
|
|
|
e.printStackTrace();
|
|
|
continue;
|
|
|
}
|
|
|
id += headId + ",";
|
|
|
} else {
|
|
|
+ //operateLogInfo = new OperateLogInfo();
|
|
|
String headDataEntry = bsViewConfigEntryInfo.getHeadDataEntry();
|
|
|
Class objectValueClass = null;
|
|
|
try {
|
|
|
@@ -220,6 +284,10 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
e.printStackTrace();
|
|
|
continue;
|
|
|
}
|
|
|
+ operateLogInfo.setBusinessId(headId);
|
|
|
+ OperateLogEntryCollection entrys1 = operateLogInfo.getEntrys();
|
|
|
+ OperateLogEntryInfo operateLogEntryInfo = new OperateLogEntryInfo();
|
|
|
+
|
|
|
// 创建对应的实体对象
|
|
|
CoreBaseInfo coreBaseInfo = (CoreBaseInfo) MetaDataUtil.newInstance(objectValueClass, headDataEntry);
|
|
|
if (coreBaseInfo instanceof EmpEnrollBizBillInfo) {
|
|
|
@@ -237,6 +305,18 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
try {
|
|
|
headProcessing(view, jsonObject1, person, fileArray, file);
|
|
|
} catch (Exception e) {
|
|
|
+ String f = e.getMessage();
|
|
|
+ if (f!=null&&f.length()>500){
|
|
|
+ f = f.substring(0, 500);
|
|
|
+ }
|
|
|
+ operateLogEntryInfo.setErrorInfo("获取头部信息失败!!!!" + f);
|
|
|
+ entrys1.add(operateLogEntryInfo);
|
|
|
+ try {
|
|
|
+ localInstance.save(operateLogInfo);
|
|
|
+ } catch (EASBizException ex) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
System.out.println("获取头部信息失败");
|
|
|
e.printStackTrace();
|
|
|
continue;
|
|
|
@@ -263,20 +343,55 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
BSViewConfigEntryCollection boyBsViewConfigEntryCollection = BSViewConfigEntryFactory
|
|
|
.getLocalInstance(context).getBSViewConfigEntryCollection(entryBoyEntityViewInfo);
|
|
|
for (int j = 0; j < boyBsViewConfigEntryCollection.size(); j++) {
|
|
|
+ operateLogInfo = new OperateLogInfo();
|
|
|
+ //operateLogInfo.setBusinessId(headId);
|
|
|
+ OperateLogEntryCollection entrys1 = operateLogInfo.getEntrys();
|
|
|
+ OperateLogEntryInfo operateLogEntryInfo = new OperateLogEntryInfo();
|
|
|
+
|
|
|
BSViewConfigEntryInfo boybsViewConfigEntryInfo = boyBsViewConfigEntryCollection.get(j);
|
|
|
UIViewInfo view1 = boybsViewConfigEntryInfo.getView();
|
|
|
String beiSenData1 = boybsViewConfigEntryInfo.getBeiSenData();
|
|
|
UIType type = view1.getType();
|
|
|
+ operateLogInfo.setBusinessName(view1.getName());
|
|
|
boolean isCreateData1 = boybsViewConfigEntryInfo.isIsCreateData();
|
|
|
try {
|
|
|
if (type.getValue().equals("list")) {
|
|
|
boyProcessing(view1, headId, jsonObject1.getJSONArray(beiSenData1), null, "fileInfos", beiSenData1);
|
|
|
+ String boy = jsonObject1.getJSONArray(beiSenData1).toJSONString();
|
|
|
+ if (boy.length()>500){
|
|
|
+ boy = boy.substring(0, 500);
|
|
|
+ }
|
|
|
+
|
|
|
+ operateLogEntryInfo.setErrorInfo(boy);
|
|
|
} else {
|
|
|
boyProcessing(view1, isCreateData1, headId, jsonObject1.getJSONObject(beiSenData1), null, "fileInfos", beiSenData1);
|
|
|
+ String boy =jsonObject1.getJSONObject(beiSenData1).toJSONString();
|
|
|
+ if (boy.length()>500){
|
|
|
+ boy = boy.substring(0, 500);
|
|
|
+ }
|
|
|
+ operateLogEntryInfo.setErrorInfo(boy);
|
|
|
}
|
|
|
+ entrys1.add(operateLogEntryInfo);
|
|
|
+ try {
|
|
|
+ localInstance.save(operateLogInfo);
|
|
|
+ } catch (EASBizException ex) {
|
|
|
+ ex.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
} catch (Exception e) {
|
|
|
System.out.println("整理报错主题信息失败!!!");
|
|
|
e.printStackTrace();
|
|
|
+ String f = e.getMessage();
|
|
|
+ if (f!=null&&f.length()>500){
|
|
|
+ f = f.substring(0, 500);
|
|
|
+ }
|
|
|
+ operateLogEntryInfo.setErrorInfo("获取头部信息失败!!!!" + f);
|
|
|
+ entrys1.add(operateLogEntryInfo);
|
|
|
+ try {
|
|
|
+ localInstance.save(operateLogInfo);
|
|
|
+ } catch (EASBizException ex) {
|
|
|
+
|
|
|
+ }
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
@@ -321,6 +436,7 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
ICoreBase bosObject = (ICoreBase) (BOSObjectFactory.createBOSObject(context, coreBaseInfo.getBOSType()));
|
|
|
// 获取关联字段
|
|
|
String relateField = uiViewInfo1.getRelatedField();
|
|
|
+ System.out.println("==============判断是否需要同步====="+!isCreateData1+"============"+isCreateData1);
|
|
|
if (!isCreateData1) {
|
|
|
System.out.println("=============查询不需要同步数据============" + "where " + relateField + " = '" + id + "'");
|
|
|
CoreBaseCollection collection = bosObject.getCollection("where " + relateField + " = '" + id + "'");
|
|
|
@@ -710,7 +826,17 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
value = attributes.get("data-defaultValue");
|
|
|
} else {
|
|
|
JSONArray jsonArray = jsonObject.getJSONArray(split[0]);
|
|
|
- data1 = jsonArray.getJSONObject(0);
|
|
|
+ if ((split[0].equals("entryRecord")||split[0].equals("employmentRecord"))&&jsonArray.size()>0){
|
|
|
+ // 定义日期格式
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
|
|
|
+ JSONArray sortedJsonArray = paixu(jsonArray, "entryDate");
|
|
|
+ System.out.println("排序后entryRecord/employmentRecord"+sortedJsonArray);
|
|
|
+ // (可选)将排序后的List转回JSONArray
|
|
|
+ data1 = sortedJsonArray.getJSONObject(0);
|
|
|
+ }else {
|
|
|
+ data1 = jsonArray.getJSONObject(0);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
} else {
|
|
|
data1 = jsonObject.getJSONObject(split[0]);
|
|
|
@@ -746,7 +872,7 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
if (s != null && !s.equals("")) {
|
|
|
// 解析自定义映射值的 JSON 对象
|
|
|
JSONObject jsonObject1 = JSONObject.parseObject(s);
|
|
|
- if (jsonObject1 != null) {
|
|
|
+ if (jsonObject1 != null && value != null) {
|
|
|
// 根据值获取映射后的值
|
|
|
String string = jsonObject1.getString(value.toString());
|
|
|
if (string != null) {
|
|
|
@@ -783,7 +909,7 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
if (coreBaseInfo1 instanceof PersonInfo) {
|
|
|
where += " or bsUserId = '" + value + "'";
|
|
|
} else if (coreBaseInfo1 instanceof AdminOrgUnitInfo) {
|
|
|
- where += " or originalId = '" + value + "'";
|
|
|
+ where += " or reserveFieldFirst = '" + value + "'";
|
|
|
} else if (coreBaseInfo1 instanceof PositionInfo) {
|
|
|
where += " or OriginalId = '" + value + "'";
|
|
|
}
|
|
|
@@ -800,7 +926,7 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
if (coreBaseInfo1 instanceof PersonInfo) {
|
|
|
where += " or bsUserId = '" + value + "'";
|
|
|
} else if (coreBaseInfo1 instanceof AdminOrgUnitInfo) {
|
|
|
- where += " or originalId = '" + value + "'";
|
|
|
+ where += " or reserveFieldFirst = '" + value + "'";
|
|
|
} else if (coreBaseInfo1 instanceof PositionInfo) {
|
|
|
where += " or OriginalId = '" + value + "'";
|
|
|
}
|
|
|
@@ -840,6 +966,21 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
//coreBaseInfo.put("passportNO", value);
|
|
|
setCoreBaseInfo(coreBaseInfo, "entrys.passportNO", value);
|
|
|
}
|
|
|
+ String where = "where IDCardNo = '"+value+"' or passportNO='"+value+"'";
|
|
|
+ System.out.println("====判断是否再入职=="+where);
|
|
|
+ EmpEnrollBizBillEntryCollection empEnrollBizBills = EmpEnrollBizBillEntryFactory
|
|
|
+ .getLocalInstance(context).getEmpEnrollBizBillEntryCollection(where);
|
|
|
+ HRBizDefineInfo hrBizDefineInfo = new HRBizDefineInfo();
|
|
|
+ System.out.println("====empEnrollBizBills=="+empEnrollBizBills.size());
|
|
|
+ if (empEnrollBizBills.size()>0){
|
|
|
+ System.out.println("====empEnrollBizBills= DawAAAApC9TmaL7Z= 是");
|
|
|
+ hrBizDefineInfo.setId(BOSUuid.read("DawAAAApC9TmaL7Z"));
|
|
|
+ setCoreBaseInfo(coreBaseInfo, "entrys.hrBizDefine", hrBizDefineInfo);
|
|
|
+ }else {
|
|
|
+ System.out.println("====empEnrollBizBills= DawAAAApC9DmaL7Z= 否");
|
|
|
+ hrBizDefineInfo.setId(BOSUuid.read("DawAAAApC9DmaL7Z"));
|
|
|
+ setCoreBaseInfo(coreBaseInfo, "entrys.hrBizDefine", hrBizDefineInfo);
|
|
|
+ }
|
|
|
} else {
|
|
|
setCoreBaseInfo(coreBaseInfo, name, value);
|
|
|
// 将值设置到当前实体对象中
|
|
|
@@ -883,10 +1024,14 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
throw new RuntimeException(e);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
objectValue.put(split[1], value);
|
|
|
+ if (split[1].equals("position")) {
|
|
|
+ if (value instanceof PositionInfo) {
|
|
|
+ objectValue.put("job", ((PositionInfo) value).getJob());
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
coreBaseInfo.put(name, value);
|
|
|
@@ -1520,6 +1665,34 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ JSONArray paixu (JSONArray jsonArray,String entryDate){
|
|
|
+ List<JSONObject> list = jsonArray.toJavaList(JSONObject.class);
|
|
|
+ // 定义日期格式
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
|
|
|
+ // 排序
|
|
|
+ Collections.sort(list, new Comparator<JSONObject>() {
|
|
|
+ @Override
|
|
|
+ public int compare(JSONObject o1, JSONObject o2) {
|
|
|
+ try {
|
|
|
+ // 获取entryDate字段
|
|
|
+ String dateStr1 = o1.getString(entryDate);
|
|
|
+ String dateStr2 = o2.getString(entryDate);
|
|
|
+
|
|
|
+ // 解析为Date对象
|
|
|
+ Date date1 = sdf.parse(dateStr1);
|
|
|
+ Date date2 = sdf.parse(dateStr2);
|
|
|
+
|
|
|
+ // 比较日期
|
|
|
+ return date2.compareTo(date1);
|
|
|
+ } catch (ParseException e) {
|
|
|
+ // 处理日期解析异常
|
|
|
+ e.printStackTrace();
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // (可选)将排序后的List转回JSONArray
|
|
|
+ return JSONArray.parseArray(JSONArray.toJSONString(list));
|
|
|
+ }
|
|
|
|
|
|
}
|