Explorar el Código

工控机页面数据改成真实数据,相应逻辑修改

yejian016332 hace 3 años
padre
commit
0962824f28

+ 2 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/dao/TTaskMapper.java

@@ -54,4 +54,6 @@ public interface TTaskMapper extends SuperMapper<TTask> {
     public List<Map> getTaskCountStatistics(Map<String, String> map);
 
     public List<TaskNode> getInstructions(TaskNode taskNode);
+
+    List<Map> getStationTasks(Map<String, Object> map);
 }

+ 3 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/TaskService.java

@@ -1,6 +1,7 @@
 package com.github.zuihou.business.operationManagementCenter.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.zuihou.base.R;
 import com.github.zuihou.base.service.SuperService;
 import com.github.zuihou.business.operationManagementCenter.entity.OrderProduct;
 import com.github.zuihou.business.operationManagementCenter.entity.PlanProduct;
@@ -75,5 +76,7 @@ public interface TaskService extends SuperService<TTask> {
     Map handleChangeHand(Map handMap,Map paramMap);
 
 
+    R getStationTasks(Map<String, Object> map);
 
+    R updateTaskStatus(Map<String, Object> map);
 }

+ 28 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/TaskServiceImpl.java

@@ -6,6 +6,7 @@ import com.github.zuihou.authority.dao.auth.StationUserLoginInfoMapper;
 import com.github.zuihou.authority.dao.auth.UserMapper;
 import com.github.zuihou.authority.entity.auth.StationUserLoginInfo;
 import com.github.zuihou.authority.entity.auth.User;
+import com.github.zuihou.base.R;
 import com.github.zuihou.base.service.SuperServiceImpl;
 import com.github.zuihou.business.DemoLine.DemoCacheKey;
 import com.github.zuihou.business.DemoLine.DemoLineConstant;
@@ -38,6 +39,7 @@ import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
 import com.github.zuihou.tenant.service.CodeRuleService;
 import com.google.common.collect.Maps;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
@@ -982,7 +984,33 @@ public class TaskServiceImpl extends SuperServiceImpl<TTaskMapper, TTask> implem
             }
         }
         return map;
+    }
 
+    @Override
+    public R getStationTasks(Map<String, Object> map){
+        List<Map> stationTasks = baseMapper.getStationTasks(map);
+        for(int i = 1; i<= stationTasks.size() ; i++){
+            stationTasks.get(i-1).put("step",i);
+        }
+        return  R.success(stationTasks);
+    }
 
+    @Override
+    public R updateTaskStatus(Map<String, Object> map){
+        TTask tTask = baseMapper.selectById(Long.valueOf(map.get("id").toString()));
+        String type = map.get("updateType").toString();
+        if("begin".equals(type)) {
+            if(null == tTask.getStartTime()) {
+                tTask.setStartTime(Calendar.getInstance().getTime());
+                baseMapper.updateById(tTask);
+            }
+        }else if("end".equals(type)) {
+            if(null == tTask.getEndTime()) {
+                tTask.setEndTime(Calendar.getInstance().getTime());
+                tTask.setStatus("3");
+                baseMapper.updateById(tTask);
+            }
+        }
+        return  R.success();
     }
 }

+ 1 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/WorkpieceServiceImpl.java

@@ -468,7 +468,7 @@ public class WorkpieceServiceImpl extends SuperServiceImpl<WorkpieceMapper, TWor
         String devicePort = "";
         if("execProgram".equals(manualInfo.getManualIdType())){
             // 机加设备执行程序,直接执行机床接口
-            Productionresource productionresource = productionresourceMapper.selectOne(Wraps.<Productionresource>lbQ().eq(Productionresource::getId, manualInfo.getStartResourceId()));
+            com.github.zuihou.business.productionResourceCenter.entity.Productionresource productionresource = productionresourceBizMapper.selectOne(Wraps.<com.github.zuihou.business.productionResourceCenter.entity.Productionresource>lbQ().eq(com.github.zuihou.business.productionResourceCenter.entity.Productionresource::getId, manualInfo.getStartResourceId()));
             deviceUrl = productionresource.getIp();
             devicePort = productionresource.getPort();
         }

+ 4 - 4
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/util/ManualTaskOperatorUtil.java

@@ -93,11 +93,11 @@ public class ManualTaskOperatorUtil {
             deviceUrl = ZK_ip_zndy;
             devicePort = ZK_ip_zndy_port;
         }else if("framework".equals(unit)){
-            deviceUrl = ZK_ip_zndy;
-            devicePort = ZK_ip_zndy_port;
+            deviceUrl = ZK_ip_rxx;
+            devicePort = ZK_ip_rxx_port;
         }else if("safeguard".equals(unit)){
-            deviceUrl = ZK_ip_zndy;
-            devicePort = ZK_ip_zndy_port;
+            deviceUrl = ZK_ip_zlzx;
+            devicePort = ZK_ip_zlzx_port;
         }
         if("general".equals(manualType)){
             if("capsule".equals(unit)){

+ 38 - 0
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/operationManagementCenter/TTaskMapper.xml

@@ -248,4 +248,42 @@
         </if>
     </select>
 
+    <select id="getStationTasks" resultType="java.util.Map">
+        SELECT
+          itt.id,
+          ibbp.name AS taskName,
+          ibbp.remark AS content,
+          ibbp.no AS taskNo,
+          itt.task_no AS no,
+          ibb.name,
+          (SELECT itt1.no FROM  imcs_t_tray itt1, imcs_b_bom_procedure_tray ibbpt1 WHERE ibbpt1.biz_type = 1 AND itt1.id = ibbpt1.tray_id AND ibbpt1.procedure_id = ibbp.id) AS trayNo,
+          imfc.no  AS clampNo,
+          imfc.name  AS clampName,
+          imfc.material_type AS clampType,
+          ibbp.rated_workHours AS time,
+          itt.expect_start_time AS startTime,
+          itt.expect_end_time AS endTime,
+          itt.status,
+          imm.meterial_code AS meterialCode,
+          imm.equipment_name AS equipmentName,
+          imm.trade_mark AS tradeMark,
+          ibbpt.armor_pic AS armorPic
+        FROM imcs_t_task itt,
+             imcs_b_bom_procedure ibbp,
+             imcs_b_bom_procedure_tray ibbpt,
+             imcs_b_bom ibb,
+
+             imcs_m_frock_clamp imfc,
+             imcs_m_meterial imm
+        WHERE itt.status IN  ('1','2')
+        AND ibbp.id = itt.procedure_id
+        AND ibbp.bom_id = ibb.id
+        AND ibbpt.procedure_id = ibbp.id
+        AND ibbpt.biz_type='2'
+        AND imfc.id = ibbpt.tray_id
+        AND imm.id = ibb.meterial_id
+        AND itt.resource_id = #{resourceId}
+        ORDER BY itt.expect_start_time LIMIT 0, 2
+    </select>
+
 </mapper>

+ 14 - 0
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/operationManagementCenter/TaskController.java

@@ -191,4 +191,18 @@ public class TaskController extends SuperController<TaskService, Long, TTask, TT
     }
 
 
+    @ApiOperation(value = "上下料站工作任务列表", notes = "上下料站工作任务列表")
+    @PostMapping("/getStationTasks")
+    public R getStationTasks(@RequestBody Map<String,Object> map) {
+        log.info("开始查询上下料站任务集合,请求参数{}",map);
+        return baseService.getStationTasks(map);
+    }
+
+    @ApiOperation(value = "更新上下料时间", notes = "更新上下料时间")
+    @PostMapping("/updateTaskStatus")
+    public R updateTaskStatus(@RequestBody Map<String,Object> map) {
+        log.info("开始更新上下料时间,请求参数{}",map);
+        return baseService.updateTaskStatus(map);
+    }
+
 }

+ 6 - 10
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/productionResourceCenter/StationUserController.java

@@ -21,7 +21,6 @@ import com.github.zuihou.log.annotation.SysLog;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.collections.map.HashedMap;
 import org.apache.commons.compress.utils.Lists;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
@@ -124,11 +123,12 @@ public class StationUserController extends SuperController<StationUserService, L
 
     @ApiOperation(value = "查询上下料用户", notes = "查询上下料用户")
     @GetMapping("/stationUser")
-    public R<List<StationUser>> getStationUser(@RequestParam(value="userId",required = false) Long userId) {
+    public R getStationUser(@RequestParam(value="userId",required = false) Long userId) {
         LbqWrapper<StationUser> wrapper = Wraps.<StationUser>lbQ();
         if(userId!= null){
             wrapper.eq(StationUser::getUserId, userId);
         }
+
         return success(baseService.getStationUser(wrapper));
     }
 
@@ -140,13 +140,9 @@ public class StationUserController extends SuperController<StationUserService, L
             wrapper.eq(StationUserLoginInfo::getUserId, userId);
         }
         StationUserLoginInfo stationUserLoginInfo = stationUserLoginInfoMapper.selectOne(wrapper);
-        // 查找上下料站信息
-        Productionresource productionresource = productionresourceBizMapper.selectById(stationUserLoginInfo.getStationId());
-//        Productionresource productionresource = new Productionresource();
-//        productionresource.setId( Long.valueOf("1496363582865014784"));
-//        productionresource.setName("保障中心_上下料站1");
-        List<Productionresource> stations = new ArrayList<Productionresource>();
-        stations.add(productionresource);
-        return success(stations);
+        com.github.zuihou.business.productionResourceCenter.entity.Productionresource productionresource =  productionresourceBizMapper.selectById(stationUserLoginInfo.getStationId());
+        List<Productionresource> productionresources = new ArrayList<>();
+        productionresources.add(productionresource);
+        return success(productionresources);
     }
 }