瀏覽代碼

手动模式添加字段

yaoyq 3 年之前
父節點
當前提交
84b1986aa9

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

@@ -28,4 +28,7 @@ public interface WorkpieceService extends SuperService<TWorkpiece> {
     String getUnionCode(String completeBatchNo);
 
 
+    public Map getInfoByPoint(String pointId);
+
+
 }

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

@@ -114,7 +114,7 @@ public class TaskServiceImpl extends SuperServiceImpl<TTaskMapper, TTask> implem
 
                             TWorkpiece workpiece = new TWorkpiece();
                             workpiece.setBomId(bomProcedure.getBomId()).setCompleteBatchNo(task.getCompleteBatchNo()).setOrderId(planProduct.getOrderId()).setOrderNo(planProduct.getOrderNo())
-                                    .setPlanId(planProduct.getPlanId()).setPlanNo(planProduct.getPlanNo());
+                                    .setPlanId(planProduct.getPlanId()).setPlanNo(planProduct.getPlanNo()).setProcedureId(bomProcedure.getId()).setProcedureNmae(bomProcedure.getName());
                             workpieceMapper.insert(workpiece);
                         }
                         task.setProcedureSort(j);

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

@@ -15,6 +15,8 @@ import com.github.zuihou.business.operationManagementCenter.service.*;
 import com.github.zuihou.business.productionReadyCenter.entity.BomProcedure;
 import com.github.zuihou.business.productionReadyCenter.service.AutoNodeService;
 import com.github.zuihou.business.productionReadyCenter.service.BomProcedureService;
+import com.github.zuihou.business.productionResourceCenter.entity.ProductionresourcePosition;
+import com.github.zuihou.business.productionResourceCenter.service.ProductionresourcePositionService;
 import com.github.zuihou.business.util.DynamicRabbitMq;
 import com.github.zuihou.common.constant.BizConstant;
 import com.github.zuihou.common.constant.CodeRuleModule;
@@ -53,6 +55,8 @@ import static java.util.stream.Collectors.groupingBy;
 @Slf4j
 @Service
 public class WorkpieceServiceImpl extends SuperServiceImpl<WorkpieceMapper, TWorkpiece> implements WorkpieceService {
+    @Autowired
+    private ProductionresourcePositionService productionresourcePositionService;
 
     @Override
     public IPage<TWorkpiece> pageList(IPage page, LbqWrapper<TWorkpiece> wrapper) {
@@ -68,4 +72,30 @@ public class WorkpieceServiceImpl extends SuperServiceImpl<WorkpieceMapper, TWor
         }
         return "";
     }
+
+
+    @Override
+    public Map getInfoByPoint(String pointId) {
+        Map<String,String> map = new<String,String> HashMap();
+
+        List<TWorkpiece> list = baseMapper.selectList(Wraps.<TWorkpiece>lbQ().eq(TWorkpiece::getPointId,pointId));
+        if(CollectionUtil.isEmpty(list)){
+            return null;
+        }
+        TWorkpiece workpiece = list.get(0);
+
+        BeanUtil.copyProperties(workpiece, map);
+
+
+        //根据库位查询
+        List<ProductionresourcePosition>positionList = productionresourcePositionService.list(Wraps.<ProductionresourcePosition>lbQ().eq(ProductionresourcePosition::getStorgeId,workpiece.getStorgeId()));
+        if(CollectionUtil.isNotEmpty(positionList)){
+            ProductionresourcePosition pp = positionList.get(0);
+            map.put("lockStatus",pp.getStatus());
+        }
+
+
+        return map;
+
+    }
 }

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

@@ -13,6 +13,7 @@ import com.github.zuihou.business.operationManagementCenter.entity.TWorkpiece;
 import com.github.zuihou.business.operationManagementCenter.service.TaskService;
 import com.github.zuihou.business.operationManagementCenter.service.WorkpieceService;
 import com.github.zuihou.business.productionReadyCenter.entity.Plate;
+import com.github.zuihou.business.websocket.WebSocketServer;
 import com.github.zuihou.common.util.StringUtil;
 import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
 import com.github.zuihou.database.mybatis.conditions.query.QueryWrap;
@@ -117,4 +118,15 @@ public class WorkpieceController extends SuperController<WorkpieceService, Long,
         return null;
     }
 
+    @ApiOperation(value = "根据点位查询手动模式信息", notes = "根据点位查询手动模式信息")
+    @PostMapping("/handMode/getInfoByPoint")
+    public R<Map>  getInfoByPoint(@RequestBody String pointId) {
+        if(StringUtil.isEmpty(pointId))
+            return fail("点位不能为空");
+        Map map = baseService.getInfoByPoint(pointId);
+        return success(map);
+    }
+
+
+
 }

+ 28 - 2
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/operationManagementCenter/entity/TWorkpiece.java

@@ -103,14 +103,14 @@ public class TWorkpiece extends Entity {
     @ApiModelProperty(value = "bom_name")
     @NotEmpty(message = "bom_name不能为空")
     @Length(max = 32, message = "bom_name长度不能超过32")
-    @TableField(exist = false)
+//    @TableField(exist = false)
     @Excel(name = "bom_name")
     private String bomName;
 
     @ApiModelProperty(value = "bom_no")
     @NotEmpty(message = "bom_no不能为空")
     @Length(max = 32, message = "bom_no长度不能超过32")
-    @TableField(exist = false)
+//    @TableField(exist = false)
     @Excel(name = "bom_no")
     private String bomNo;
 
@@ -130,6 +130,32 @@ public class TWorkpiece extends Entity {
     @Excel(name = "plan_no")
     private String planNo;
 
+    @ApiModelProperty(value = "库位ID")
+    @TableField("storge_id")
+    @Excel(name = "库位ID")
+    private Long storgeId;
+
+    @ApiModelProperty(value = "点位ID")
+    @Length(max = 4, message = "点位ID")
+    @TableField(value = "point_id", condition = LIKE)
+    private String pointId;
+
+    @ApiModelProperty(value = "订单名称")
+    @Length(max = 256, message = "订单名称")
+    @TableField(value = "order_name", condition = LIKE)
+    private String orderName;
+
+
+    @ApiModelProperty(value = "工序ID")
+    private Long procedureId;
+
+
+    @ApiModelProperty(value = "工序名称")
+    @Length(max = 256, message = "工序名称")
+    @TableField(value = "procedure_name", condition = LIKE)
+    private String procedureNmae;
+
+
 
     @Builder
     public TWorkpiece(Long id, LocalDateTime createTime, Long createUser, LocalDateTime updateTime, Long updateUser,