Browse Source

2024年9月27日16:53:05 中电禅道

纪新园 10 months ago
parent
commit
d2b4e7f1d4

+ 24 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/check/TWarehouseCheckController.java

@@ -19,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Calendar;
 import java.util.List;
 
 /**
@@ -126,9 +127,31 @@ public class TWarehouseCheckController extends BaseController {
         if (fId > 0) {
             if (tWarehouseCheck.gettWarehouseCheckItemsList() != null) {
                 List<TWarehouseCheckItems> tWarehouseCheckItemsList = tWarehouseCheck.gettWarehouseCheckItemsList();
-                if (tWarehouseCheckItemsList.size() > 0) {
+                if (!tWarehouseCheckItemsList.isEmpty()) {
                     //有数据情况下
                     for (TWarehouseCheckItems tWarehouseCheckItems : tWarehouseCheckItemsList) {
+                        Calendar calendar = Calendar.getInstance();
+                        calendar.setTime(tWarehouseCheckItems.getfInspectionDatetime());
+                        tWarehouseCheckItems.setfInspectionDatetime(calendar.getTime());
+                        // 获取星期数(星期日为1,星期六为7)
+                        int weekDay = calendar.get(Calendar.DAY_OF_WEEK);
+                        String week = "星期";
+                        if (1 == weekDay) {
+                            week = week + "日";
+                        } else if (2 == weekDay) {
+                            week = week + "一";
+                        } else if (weekDay == 3) {
+                            week = week + "二";
+                        } else if (4 == weekDay) {
+                            week = week + "三";
+                        } else if (5 == weekDay) {
+                            week = week + "四";
+                        } else if (6 == weekDay) {
+                            week = week + "五";
+                        } else {
+                            week = week + "六";
+                        }
+                        tWarehouseCheckItems.setWeek(week);
                         if (tWarehouseCheckItems.getfId() != null) {
                             //更新数据
                             itWarehouseCheckItemsService.updateTWarehouseCheckItems(tWarehouseCheckItems);