فهرست منبع

Merge remote-tracking branch 'origin/1.2' into 1.2

LiFei 4 سال پیش
والد
کامیت
eeb44f7bf0

+ 10 - 7
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlworder/service/impl/HlwOrderServiceImpl.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.hlworder.service.impl;
 
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -110,6 +111,7 @@ public class HlwOrderServiceImpl extends ServiceImpl<HlwOrderMapper, HlwOrder> i
             hlwUserSubcontractor.setStartDate(startDate);
             hlwUserSubcontractor.setEndDate(endDate);
             hlwUserSubcontractor.setCreateBy(createBy);
+            hlwUserSubcontractor.setUpdateBy(createBy);
             hlwUserSubcontractor.setIsAutoRenew(isAutoRenew);
             hlwUserSubcontractorService.save(hlwUserSubcontractor);
         }
@@ -125,13 +127,14 @@ public class HlwOrderServiceImpl extends ServiceImpl<HlwOrderMapper, HlwOrder> i
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Result<?> batchUploadWorkContract(JSONObject jsonObject) {
-        List<Map<String, Object>> syncList = (List<Map<String, Object>>) jsonObject.get("syncList");
-        for (Map<String, Object> map : syncList) {
-            Integer subcontractorId = (Integer) map.get("subcontractorId");
-            String orderCode = (String) map.get("orderCode");
-            String workContract = (String) map.get("workContract");
-            Date startDate = jsonObject.getDate("startDate");
-            Integer isAutoRenew = jsonObject.getInteger("isAutoRenew");
+        JSONArray syncList = jsonObject.getJSONArray("syncList");
+        for (int i = 0; i < syncList.size(); i++) {
+            JSONObject jsonObjectNew = syncList.getJSONObject(i);
+            Integer subcontractorId = jsonObjectNew.getInteger("subcontractorId");
+            String orderCode = jsonObjectNew.getString("orderCode");
+            String workContract = jsonObjectNew.getString("workContract");
+            Date startDate = jsonObjectNew.getDate("startDate");
+            Integer isAutoRenew = jsonObjectNew.getInteger("isAutoRenew");
             Date endDate = new Date();
             if (isAutoRenew == 1) {
                 LocalDate autoDate = LocalDate.parse("2100-01-01", DateTimeFormatter.ofPattern("yyyy-MM-dd"));