From f84d9e69907cb678150eaa6393fd74cf042fcca4 Mon Sep 17 00:00:00 2001
From: zenglf <18502938215@163.com>
Date: 星期四, 28 九月 2023 14:39:03 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master' into develop

---
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcShiftSubServiceImpl.java |   33 ++++++++++++++++-----------------
 1 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcShiftSubServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcShiftSubServiceImpl.java
index ba7f3a4..c03dac6 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcShiftSubServiceImpl.java
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcShiftSubServiceImpl.java
@@ -14,6 +14,7 @@
 import org.jeecg.modules.mdc.entity.MdcShiftSub;
 import org.jeecg.modules.mdc.mapper.MdcShiftSubMapper;
 import org.jeecg.modules.mdc.service.IMdcShiftSubService;
+import org.jeecg.modules.mdc.util.DateUtils;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -21,8 +22,7 @@
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 
 /**
  * @Description: 鐝琛�(娆¤〃)
@@ -51,21 +51,7 @@
     }
 
     @Override
-    public MdcShiftSub addMdcShiftSub(JSONObject jsonbject) {
-        MdcShiftSub mdcShiftSub = jsonbject.toJavaObject(MdcShiftSub.class);
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm:ss");
-        String startDate = simpleDateFormat.format(jsonbject.getDate("startDate"));
-        mdcShiftSub.setStartDate(startDate);
-        String endDate = simpleDateFormat.format(jsonbject.getDate("endDate"));
-        mdcShiftSub.setEndDate(endDate);
-        if (jsonbject.getDate("sleepStartDate") != null) {
-            String sleepStartDate = simpleDateFormat.format(jsonbject.getDate("sleepStartDate"));
-            mdcShiftSub.setSleepStartDate(sleepStartDate);
-        }
-        if (jsonbject.getDate("sleepEndDate") != null) {
-            String sleepEndDate = simpleDateFormat.format(jsonbject.getDate("sleepEndDate"));
-            mdcShiftSub.setSleepEndDate(sleepEndDate);
-        }
+    public MdcShiftSub addMdcShiftSub(MdcShiftSub mdcShiftSub) {
         this.save(mdcShiftSub);
         return mdcShiftSub;
     }
@@ -95,5 +81,18 @@
         return Result.error("褰撳墠鏃ユ湡宸茶璁惧鏃ュ巻寮曠敤鏃犳硶鍒犻櫎");
     }
 
+    @Override
+    public List<Map<String, String>> initShiftSubList(String shiftId) {
+        List<MdcShiftSub> mdcShiftSubs = this.baseMapper.selectList(new LambdaQueryWrapper<MdcShiftSub>().eq(MdcShiftSub::getShiftSubStatus, "1").eq(MdcShiftSub::getShiftId, shiftId));
+        List<Map<String, String>> result = new ArrayList<>();
+        for (MdcShiftSub mdcShiftSub : mdcShiftSubs) {
+            Map<String, String> map = new HashMap<>();
+            map.put("label", mdcShiftSub.getShiftSubName());
+            map.put("value", mdcShiftSub.getId());
+            result.add(map);
+        }
+        return result;
+    }
+
 
 }

--
Gitblit v1.9.3