瀏覽代碼

fix 数据确认

32197351@qq.com 2 年之前
父節點
當前提交
5ceb6cae09

+ 3 - 2
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/gongdandetail/service/impl/ItdmGongdanQuerenServiceImpl.java

@@ -128,9 +128,10 @@ public class ItdmGongdanQuerenServiceImpl extends ServiceImpl<ItdmGongdanDetailM
         queryWrapper.apply("FIND_IN_SET('" + shiyanType + "',shiji_shiiyan_type)");
         List<ItdmGongdanDetail> list = itdmGongdanDetailMapper.selectList(queryWrapper);
         Map<String, String> map = new HashMap<>();
-        map.put("shiyanKaishitime","00:00");
+        map.put("shiyanKaishitime", "00:00");
         map.put("shiyanJieshutime", "23:59");
-                if (list.size() <= 1) {
+        if (list.size() > 0 && list.size() <= 1) {
+
             map.put("shiyanKaishitime", list.get(0).getShijiStartTime());
             map.put("shiyanJieshutime", list.get(0).getShijiEndTime());
         }

+ 3 - 2
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/itdmgongdanshuju/controller/ItdmGongdanshujuController.java

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.modules.itdmgongdanshuju.dto.ItdmGongdanEditListDto;
 import org.jeecg.modules.itdmgongdanshuju.dto.ItdmGongdanUploadDto;
 import org.jeecg.modules.weituo.dto.WeituoInsertCommand;
 import org.jeecg.modules.weituo.entity.ItdmWeituoInfo;
@@ -113,8 +114,8 @@ public class ItdmGongdanshujuController {
     @ApiOperation(value = "工单数据-批量编辑", notes = "工单数据-批量编辑")
     //@RequiresPermissions("org.jeecg.modules:itdm_gongdan_shuju:edit")
     @RequestMapping(value = "/editList", method = {RequestMethod.PUT, RequestMethod.POST})
-    public Result<String> editList(@RequestBody List<ItdmGongdanShuju> itdmGongdanShuju) {
-        itdmGongdanShujuService.editList(itdmGongdanShuju);
+    public Result<String> editList(@RequestBody ItdmGongdanEditListDto dto) {
+        itdmGongdanShujuService.editList(dto);
         return Result.OK("编辑成功!");
     }
 

+ 24 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/itdmgongdanshuju/dto/ItdmGongdanEditListDto.java

@@ -0,0 +1,24 @@
+package org.jeecg.modules.itdmgongdanshuju.dto;
+
+import lombok.Data;
+import org.jeecg.modules.itdmgongdanshuju.entity.ItdmGongdanShuju;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ */
+@Data
+public class ItdmGongdanEditListDto  {
+    private static final long serialVersionUID = 1L;
+
+	/**工单id*/
+    private String woId;
+
+
+    private String shiyanDateTime;
+
+
+
+    private List<ItdmGongdanShuju> list;
+}

+ 2 - 1
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/itdmgongdanshuju/service/ItdmGongdanShujuService.java

@@ -2,6 +2,7 @@ package org.jeecg.modules.itdmgongdanshuju.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.modules.itdmgongdanshuju.dto.ItdmGongdanDto;
+import org.jeecg.modules.itdmgongdanshuju.dto.ItdmGongdanEditListDto;
 import org.jeecg.modules.itdmgongdanshuju.dto.ItdmGongdanUploadDto;
 import org.jeecg.modules.itdmgongdanshuju.entity.ItdmGongdanDetail;
 import org.jeecg.modules.itdmgongdanshuju.entity.ItdmGongdanShuju;
@@ -16,7 +17,7 @@ public interface ItdmGongdanShujuService extends IService<ItdmGongdanShuju> {
     void upload(ItdmGongdanUploadDto upload);
 
 
-    public void editList(List<ItdmGongdanShuju> itdmGongdanShuju);
+    public void editList(ItdmGongdanEditListDto itdmGongdanShuju);
 
 
 }

+ 20 - 16
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/itdmgongdanshuju/service/impl/ItdmGongdanShujuServiceImpl.java

@@ -12,6 +12,7 @@ import org.jeecg.common.exception.JeecgBootException;
 import org.jeecg.modules.itdmDataHistory.entity.ItdmWenxiang;
 import org.jeecg.modules.itdmDataHistory.mapper.ItdmWenxiangMapper;
 import org.jeecg.modules.itdmgongdanshuju.dto.ItdmGongdanDto;
+import org.jeecg.modules.itdmgongdanshuju.dto.ItdmGongdanEditListDto;
 import org.jeecg.modules.itdmgongdanshuju.dto.ItdmGongdanUploadDto;
 import org.jeecg.modules.itdmgongdanshuju.entity.ItdmGongdanDetail;
 import org.jeecg.modules.itdmgongdanshuju.entity.ItdmGongdanImage;
@@ -119,7 +120,7 @@ public class ItdmGongdanShujuServiceImpl extends ServiceImpl<ItdmGongdanShujuMap
                 }
             }
         } catch (Exception e) {
-            throw new JeecgBootException(e.getMessage(),e);
+            throw new JeecgBootException(e.getMessage(), e);
 
         }
         return true;
@@ -137,7 +138,7 @@ public class ItdmGongdanShujuServiceImpl extends ServiceImpl<ItdmGongdanShujuMap
             itdmGong1.setWoId(upload.getWoId());
             itdmGong1.setExtraPic(upload.getImages());
             gongdanImageMapper.insert(itdmGong1);
-        }else{
+        } else {
             itdmGong.setExtraPic(upload.getImages());
             gongdanImageMapper.updateById(itdmGong);
         }
@@ -147,27 +148,30 @@ public class ItdmGongdanShujuServiceImpl extends ServiceImpl<ItdmGongdanShujuMap
 
 
     @Override
-    public void editList(List<ItdmGongdanShuju> itdmGongdanShuju) {
+    public void editList(ItdmGongdanEditListDto itdmGongdanShuju) {
 
+        itdmGongdanShujuMapper.delete(Wrappers.lambdaQuery(ItdmGongdanShuju.class)
+                .eq(ItdmGongdanShuju::getWoId, itdmGongdanShuju.getWoId()));
 
+        for (ItdmGongdanShuju i : itdmGongdanShuju.getList()) {
 
-        for (ItdmGongdanShuju i : itdmGongdanShuju) {
-            if (StringUtils.isBlank(i.getId())) {
-                itdmGongdanShujuMapper.insert(i);
-            }else{
-                ItdmGongdanShuju selection = itdmGongdanShujuMapper.selectById(i.getId());
-                if (selection != null) {
-                    selection.setShiyanWendu(i.getShiyanWendu());
-                    selection.setShiyanShidu(i.getShiyanShidu());
-                    itdmGongdanShujuMapper.updateById(selection);
-                }else{
-                    itdmGongdanShujuMapper.deleteById(i.getId());
-                }
+            if (StringUtils.isBlank(i.getWoId())) {
+
+                i.setWoId(itdmGongdanShuju.getWoId());
 
             }
-        }
 
 
+            if (StringUtils.isBlank(i.getShiyanDateTime())) {
+
+                i.setShiyanDateTime(itdmGongdanShuju.getShiyanDateTime());
+
+            }
+
+            itdmGongdanShujuMapper.insert(i);
+
+        }
+
 
     }