|
|
@@ -7,12 +7,17 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.github.zuihou.base.service.SuperServiceImpl;
|
|
|
import com.github.zuihou.business.DemoLine.DemoCacheKey;
|
|
|
import com.github.zuihou.business.DemoLine.DemoLineConstant;
|
|
|
+import com.github.zuihou.business.edgeLibrary.dao.StockInfoMapper;
|
|
|
+import com.github.zuihou.business.edgeLibrary.dao.StorgeMapper;
|
|
|
+import com.github.zuihou.business.edgeLibrary.entity.StockInfo;
|
|
|
+import com.github.zuihou.business.edgeLibrary.entity.Storge;
|
|
|
import com.github.zuihou.business.mq.HandModeWorkNode;
|
|
|
import com.github.zuihou.business.operationManagementCenter.dao.*;
|
|
|
import com.github.zuihou.business.operationManagementCenter.dto.OrderProductUpdateDTO;
|
|
|
import com.github.zuihou.business.operationManagementCenter.dto.OrderUpdateDTO;
|
|
|
import com.github.zuihou.business.operationManagementCenter.entity.*;
|
|
|
import com.github.zuihou.business.operationManagementCenter.service.*;
|
|
|
+import com.github.zuihou.business.productionReadyCenter.dao.BBomMapper;
|
|
|
import com.github.zuihou.business.productionReadyCenter.entity.BomProcedure;
|
|
|
import com.github.zuihou.business.productionReadyCenter.service.AutoNodeService;
|
|
|
import com.github.zuihou.business.productionReadyCenter.service.BomProcedureService;
|
|
|
@@ -70,6 +75,12 @@ public class WorkpieceServiceImpl extends SuperServiceImpl<WorkpieceMapper, TWor
|
|
|
@Autowired
|
|
|
private HandModeWorkNode handModeWorkNode;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private StorgeMapper storgeMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private BBomMapper bomMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public IPage<TWorkpiece> pageList(IPage page, LbqWrapper<TWorkpiece> wrapper) {
|
|
|
return baseMapper.pageList(page, wrapper);
|
|
|
@@ -92,12 +103,21 @@ public class WorkpieceServiceImpl extends SuperServiceImpl<WorkpieceMapper, TWor
|
|
|
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 = new TWorkpiece();
|
|
|
+
|
|
|
+ if(!CollectionUtil.isEmpty(list)){
|
|
|
+ workpiece = list.get(0);
|
|
|
}
|
|
|
- TWorkpiece workpiece = list.get(0);
|
|
|
|
|
|
- BeanUtil.copyProperties(workpiece, map);
|
|
|
+ map.put("pointId",StringUtil.isEmpty(workpiece.getPointId())?"":workpiece.getPointId());
|
|
|
+ map.put("orderName",StringUtil.isEmpty(workpiece.getOrderName())?"":workpiece.getOrderName());
|
|
|
+ map.put("bomNo",StringUtil.isEmpty(workpiece.getBomNo())?"":workpiece.getBomNo());
|
|
|
+ map.put("bomName",StringUtil.isEmpty(workpiece.getBomName())?"":workpiece.getBomName());
|
|
|
+ map.put("procedureName",StringUtil.isEmpty(workpiece.getProcedureName())?"":workpiece.getProcedureName());
|
|
|
+// if(CollectionUtil.isEmpty(list)){
|
|
|
+// return new HashMap();
|
|
|
+// }
|
|
|
|
|
|
|
|
|
//根据库位查询
|
|
|
@@ -126,6 +146,7 @@ public class WorkpieceServiceImpl extends SuperServiceImpl<WorkpieceMapper, TWor
|
|
|
BaseContextHandler.setTenant("0000");
|
|
|
Map map = new HashMap();
|
|
|
map.put("fullFlag","1");
|
|
|
+ map.put("goodsName","1");
|
|
|
List<ProductionresourcePosition> list = productionresourcePositionMapper.getPPList(map);
|
|
|
Map<String, List<ProductionresourcePosition>> pointMap = list.stream().collect(groupingBy(ProductionresourcePosition::getPointId));
|
|
|
|
|
|
@@ -138,11 +159,13 @@ public class WorkpieceServiceImpl extends SuperServiceImpl<WorkpieceMapper, TWor
|
|
|
}
|
|
|
ProductionresourcePosition position0 = subList.get(0);
|
|
|
returnMap.put("pointId",key);
|
|
|
+ returnMap.put("name",position0.getName());
|
|
|
returnMap.put("lockStatus",position0.getLockStatus());
|
|
|
List<Map>l = new ArrayList<>();
|
|
|
for(ProductionresourcePosition p:subList){
|
|
|
if(p.getGoodsId()!=null){
|
|
|
Map m = new HashMap();
|
|
|
+ m.put("goodsName",p.getGoodsName());
|
|
|
m.put("goodsId",p.getGoodsId());
|
|
|
m.put("category",p.getCategory());
|
|
|
l.add(m);
|
|
|
@@ -163,4 +186,56 @@ public class WorkpieceServiceImpl extends SuperServiceImpl<WorkpieceMapper, TWor
|
|
|
BaseContextHandler.setTenant("0000");
|
|
|
return handModeWorkNode.getRequestParam(map);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String handMove(Map conMap) {
|
|
|
+ BaseContextHandler.setTenant("0000");
|
|
|
+ String startPointId = conMap.get("startPointId")==null?"":conMap.get("startPointId").toString();
|
|
|
+ String endPointId = conMap.get("endPointId")==null?"":conMap.get("endPointId").toString();
|
|
|
+ JSONObject callBackJson = new JSONObject();
|
|
|
+ callBackJson.put("srcPosition",startPointId);
|
|
|
+ callBackJson.put("targetPostion",endPointId);
|
|
|
+ return taskNodeService.handModeStock(callBackJson).getData();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String delete(Map conMap) {
|
|
|
+ BaseContextHandler.setTenant("0000");
|
|
|
+ return taskNodeService.handModeStockOut(conMap).getData();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String lock(Map map) {
|
|
|
+ BaseContextHandler.setTenant("0000");
|
|
|
+ String pointId = map.get("pointId")==null?"":map.get("pointId").toString();
|
|
|
+ String lockType = map.get("lockType")==null?"":map.get("lockType").toString();
|
|
|
+
|
|
|
+ List<ProductionresourcePosition> pointList = productionresourcePositionMapper.selectList(Wraps.<ProductionresourcePosition>lbQ().eq(ProductionresourcePosition::getPointId, pointId));
|
|
|
+ if(CollectionUtil.isEmpty(pointList)){
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ ProductionresourcePosition position = pointList.get(0);
|
|
|
+ //获取
|
|
|
+ List<Storge> list = storgeMapper.selectList(Wraps.<Storge>lbQ().eq(Storge::getId, position.getStorgeId()));
|
|
|
+
|
|
|
+
|
|
|
+ if(CollectionUtil.isEmpty(list)){
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+
|
|
|
+ Storge storge = list.get(0);
|
|
|
+
|
|
|
+ if("1".equals(lockType)){//锁定
|
|
|
+ storge.setLockStatus("0");
|
|
|
+ storgeMapper.updateById(storge);
|
|
|
+ }else if("0".equals(lockType)){//解锁
|
|
|
+ storge.setLockStatus("1");
|
|
|
+ storgeMapper.updateById(storge);
|
|
|
+ }
|
|
|
+
|
|
|
+ return "";
|
|
|
+
|
|
|
+ }
|
|
|
}
|