Explorar el Código

Merge branch 'test' of http://1.94.244.160:3000/shuzhihua/pms-iot into test

zhangcl hace 1 semana
padre
commit
981cc1a9ee

+ 3 - 5
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/FileUploadController.java

@@ -37,9 +37,8 @@ public class FileUploadController {
     @PermitAll
     @TenantIgnore
     public CommonResult<Map<String, Object>> uploadFiles(
-            @RequestParam("files") MultipartFile[] files,
-            @RequestParam(value = "isFolder", defaultValue = "false") boolean isFolder,
-            HttpServletRequest request) {
+            @RequestParam("files") MultipartFile[] files, @RequestParam(value = "isFolder", defaultValue = "false") boolean isFolder,
+            @RequestHeader("device-id") String deviceId, HttpServletRequest request) {
 
         // 创建根目录(如果不存在)
         File rootDir = new File(uploadPath);
@@ -77,7 +76,7 @@ public class FileUploadController {
                 // 记录文件信息
                 Map<String, Object> fileInfo = new HashMap<>();
                 fileInfo.put("name", FileUtil.getName(originalFilename));
-                String filePaths = fileService.createFile(FileUtil.getName(originalFilename), originalFilename, IoUtil.readBytes(file.getInputStream()));
+                String filePaths = fileService.createFile(FileUtil.getName(originalFilename), deviceId+File.separator+originalFilename, IoUtil.readBytes(file.getInputStream()));
 
                 fileInfo.put("path", originalFilename);
                 fileInfo.put("filePath", filePaths);
@@ -94,7 +93,6 @@ public class FileUploadController {
             result.put("folderStructure", folderStructure);
             result.put("message", "上传成功");
 
-            System.out.println("------------------"+ JSON.toJSONString(result));
             return CommonResult.success(result);
 
         } catch (IOException e) {

+ 1 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotopeationfill/IotOpeationFillController.java

@@ -229,7 +229,7 @@ public class IotOpeationFillController {
         if(fillDO1.getIsReport()!=null && fillDO1.getIsReport()==1){
 
             IotRhDailyReportSaveReqVO saveReqVO = new IotRhDailyReportSaveReqVO();
-            IotRyDailyReportPageReqVO saveReqRyVO = new IotRyDailyReportPageReqVO();
+            IotRyDailyReportSaveReqVO saveReqRyVO = new IotRyDailyReportSaveReqVO();
 
             Map<String,Object> stringRhObjectMap = BeanUtil.beanToMap(saveReqVO);
             Map<String,Object> stringRyObjectMap = BeanUtil.beanToMap(saveReqRyVO);

+ 24 - 19
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/job/IotOperationPlanJob.java

@@ -228,14 +228,6 @@ public class IotOperationPlanJob implements JobHandler {
         iotOpeationFillOrderMapper.insertBatch(orderList1);
 
 
-        Set<Long> pdeptList = new HashSet<>();
-        pdeptList =  deptService.getChildDeptIdListFromCache(plan.getDeptId());
-        pdeptList.add(plan.getDeptId());
-
-        //查询日报计划
-        List<IotOperationPlanDO> rpList = planMapper.getReportPlan(pdeptList);
-        List<Long> rpdList = rpList.stream().map(IotOperationPlanDO::getDeptId).collect(Collectors.toList());
-
 
         Set<Long> rdIdList = new HashSet<>();
         rdIdList =  deptService.getChildDeptIdListFromCache(163L);
@@ -249,18 +241,31 @@ public class IotOperationPlanJob implements JobHandler {
         boolean exist = rdIdList.contains(plan.getDeptId());
 
         if(!exist){
-            //1、有指定队伍插入指定队伍日报设备
 
-            if(rpList.size()>0){
+
+            //瑞鹰SCP项目部50010队伍临时创建
+            if(plan.getDeptId()==287){
                 //筛选日报工单
-                List<IotOpeationFillOrderDO> virOrderList = orderList1.stream().filter(e->rpdList.contains(e.getDeptId())).collect(Collectors.toList());
-                if(virOrderList.size()>0){
-                    //创建日报设备
-                    List <IotOpeationFillDO> devList = opeationFillService.reportMethod(virOrderList);
-                    //插入日报设备
-                    iotOpeationFillMapper.insertFill(devList);
+                List<IotOpeationFillOrderDO> virOrderList = new ArrayList<>();
+
+                IotOpeationFillOrderDO fillDO = new IotOpeationFillOrderDO();
+
+                fillDO.setOrderName("50010队"+"/"+LocalDate.now()+"运行记录填报");
+                fillDO.setDeptId(293L);
+                fillDO.setOrderStatus(0);
+                fillDO.setCreateTime(LocalDateTime.now());
+                fillDO.setUserName("李小虎");
+                fillDO.setUserId(486);
+                fillDO.setMobile(String.valueOf(17723897643L));
+                virOrderList.add(fillDO);
+
+                orderList1.addAll(virOrderList);
+                iotOpeationFillOrderMapper.insertBatch(virOrderList);
+                //创建日报设备
+                List <IotOpeationFillDO> devList = opeationFillService.reportMethod(virOrderList);
+                //插入日报设备
+                iotOpeationFillMapper.insertFill(devList);
 
-                }
 
             }
 
@@ -323,7 +328,7 @@ public class IotOperationPlanJob implements JobHandler {
 
 
 
-        /*//发送钉钉通知
+        //发送钉钉通知
         pmsThreadPoolTaskExecutor.execute(()->{
             try{
                 for (IotOpeationFillOrderDO order:orderList1) {
@@ -332,7 +337,7 @@ public class IotOperationPlanJob implements JobHandler {
             }catch (Exception e){
                 e.printStackTrace();
             }
-        });*/
+        });
 
 
         //正常工单设备

+ 1 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/maintain/IotMaintainServiceImpl.java

@@ -193,6 +193,7 @@ public class IotMaintainServiceImpl implements IotMaintainService {
                 maintainMaterial.getMaterials().forEach(e ->{
                     IotMaintainMaterialsDO iotMaintainMaterialsDO = new IotMaintainMaterialsDO();
                     BeanUtils.copyProperties(e, iotMaintainMaterialsDO);
+                    iotMaintainMaterialsDO.setId(null);
                     iotMaintainMaterialsDO.setDeleted(false);
                     iotMaintainMaterialsDO.setMaintainId(iotMaintain.getId());
                     iotMaintainMaterialsDO.setBomId(iotMaintainBomDO.getId());