|
@@ -13,11 +13,7 @@ import com.github.zuihou.business.DemoLine.DemoLineConstant;
|
|
|
import com.github.zuihou.business.aps.algorithm.ga.GAScheduler;
|
|
|
import com.github.zuihou.business.aps.instance.domain.basicdata.*;
|
|
|
import com.github.zuihou.business.classSchedule.dao.ScheduleUserDateMapper;
|
|
|
-import com.github.zuihou.business.edgeLibrary.dao.StockInfoMapper;
|
|
|
-import com.github.zuihou.business.edgeLibrary.entity.StockInfo;
|
|
|
import com.github.zuihou.business.edgeLibrary.entity.Storge;
|
|
|
-import com.github.zuihou.business.edgeLibrary.service.StockInfoService;
|
|
|
-import com.github.zuihou.business.edgeLibrary.service.StockLogService;
|
|
|
import com.github.zuihou.business.edgeLibrary.service.StorgeService;
|
|
|
import com.github.zuihou.business.operationManagementCenter.dao.OrderMapper;
|
|
|
import com.github.zuihou.business.operationManagementCenter.dao.TTaskMapper;
|
|
@@ -29,14 +25,11 @@ import com.github.zuihou.business.productionReadyCenter.dao.BomProcedureProducti
|
|
|
import com.github.zuihou.business.productionReadyCenter.dao.BomProcedureProgramMapper;
|
|
|
import com.github.zuihou.business.productionReadyCenter.entity.*;
|
|
|
import com.github.zuihou.business.productionResourceCenter.dao.ProductionresourceBizMapper;
|
|
|
-import com.github.zuihou.business.productionResourceCenter.dao.ProductionresourcePositionMapper;
|
|
|
import com.github.zuihou.business.productionResourceCenter.dao.ZZoneMapper;
|
|
|
import com.github.zuihou.business.productionResourceCenter.entity.Productionresource;
|
|
|
-import com.github.zuihou.business.productionResourceCenter.entity.ProductionresourcePosition;
|
|
|
import com.github.zuihou.business.productionResourceCenter.entity.Repair;
|
|
|
import com.github.zuihou.business.productionResourceCenter.entity.ZZone;
|
|
|
import com.github.zuihou.business.productionResourceCenter.service.RepairService;
|
|
|
-import com.github.zuihou.common.constant.BizConstant;
|
|
|
import com.github.zuihou.common.constant.CacheKey;
|
|
|
import com.github.zuihou.common.constant.CodeRuleModule;
|
|
|
import com.github.zuihou.common.util.DateUtil;
|
|
@@ -46,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;
|
|
@@ -97,14 +91,6 @@ public class TaskServiceImpl extends SuperServiceImpl<TTaskMapper, TTask> implem
|
|
|
private UserMapper userMapper;
|
|
|
@Autowired
|
|
|
private ProductionresourceBizMapper productionresourceBizMapper;
|
|
|
- @Autowired
|
|
|
- private StockInfoService stockInfoService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ProductionresourcePositionMapper productionresourcePositionMapper;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private StockLogService stockLogService;
|
|
|
|
|
|
@Override
|
|
|
public List<TTask> createTaskByPlan(List<PlanProduct> planProductList, Map<Long,List<BomProcedure>> bomProcedureMap,String taskBatchNo) {
|
|
@@ -220,16 +206,6 @@ public class TaskServiceImpl extends SuperServiceImpl<TTaskMapper, TTask> implem
|
|
|
//设置completeBatchNo
|
|
|
Map<String,String> completeBatchNoMap = new HashMap<String,String>();
|
|
|
double totalOpNum = 0.0;
|
|
|
-
|
|
|
- LbqWrapper<StationUserLoginInfo> stationUserLoginInfoWrapper = new LbqWrapper<StationUserLoginInfo>().in(StationUserLoginInfo::getUserId, userIds);
|
|
|
- List<StationUserLoginInfo> stationUserLoginInfos = stationUserLoginInfoMapper.selectList(stationUserLoginInfoWrapper);
|
|
|
- // 工人上下料站人员信息
|
|
|
- List<Long> stationResourcesIds = stationUserLoginInfos.stream().map(p -> p.getStationId()).collect(Collectors.toList());
|
|
|
-
|
|
|
- if(stationResourcesIds.size() == 0){
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
for(int partIndex = 1;partIndex <= planProductList.size(); partIndex++){
|
|
|
PlanProduct planProduct = planProductList.get(partIndex - 1);
|
|
|
OrderProduct orderProduct = orderProductMap.get(planProduct.getOrderProductId());
|
|
@@ -248,7 +224,14 @@ public class TaskServiceImpl extends SuperServiceImpl<TTaskMapper, TTask> implem
|
|
|
LbqWrapper<User> userWrapper = new LbqWrapper<User>().eq(User::getOrg, orgId);
|
|
|
List<User> orgUsers = userMapper.selectList(userWrapper);
|
|
|
List<Long> userIds = orgUsers.stream().map(p -> p.getId()).collect(Collectors.toList());
|
|
|
+ LbqWrapper<StationUserLoginInfo> stationUserLoginInfoWrapper = new LbqWrapper<StationUserLoginInfo>().in(StationUserLoginInfo::getUserId, userIds);
|
|
|
+ List<StationUserLoginInfo> stationUserLoginInfos = stationUserLoginInfoMapper.selectList(stationUserLoginInfoWrapper);
|
|
|
+ // 工人上下料站人员信息
|
|
|
+ List<Long> stationResourcesIds = stationUserLoginInfos.stream().map(p -> p.getStationId()).collect(Collectors.toList());
|
|
|
|
|
|
+ if(stationResourcesIds.size() == 0){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
|
|
|
//产品批次号,用于产品分解任务关联
|
|
|
String bomBatchNo = UUID.randomUUID().toString().replace("-", "");
|
|
@@ -1030,39 +1013,4 @@ public class TaskServiceImpl extends SuperServiceImpl<TTaskMapper, TTask> implem
|
|
|
}
|
|
|
return R.success();
|
|
|
}
|
|
|
-
|
|
|
- @Override
|
|
|
- public R releaseClamp(Map<String, Object> map){
|
|
|
- TTask tTask = baseMapper.selectById(Long.valueOf(map.get("id").toString()));
|
|
|
- // 根据设备点位信息删除对应的库位上的夹具信息
|
|
|
- Map queryMap = new HashMap();
|
|
|
- queryMap.put("resourceId", tTask.getResourceId());
|
|
|
- List<ProductionresourcePosition> list = productionresourcePositionMapper.getStorgeIdByResource(queryMap);
|
|
|
-
|
|
|
- if(CollectionUtil.isEmpty(list)){
|
|
|
- return R.fail("设备不存在");
|
|
|
- }
|
|
|
- ProductionresourcePosition productionresourcePosition = list.get(0);
|
|
|
-
|
|
|
- List<StockInfo> StockInfos = stockInfoService.list(Wraps.<StockInfo>lbQ().eq(StockInfo::getStorgeId,productionresourcePosition.getStorgeId()));
|
|
|
- if(CollectionUtil.isEmpty(StockInfos)){
|
|
|
- return R.fail("当前库位无料");
|
|
|
- }
|
|
|
-
|
|
|
- for(StockInfo stockInfo : StockInfos){
|
|
|
- baseMapper.deleteById(stockInfo.getId());
|
|
|
- //库存日志
|
|
|
- stockLogService.saveLog(stockInfo, BizConstant.STOCK_TYPE_OUT);
|
|
|
- }
|
|
|
- return R.success();
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public R procesRfid(Map<String, Object> map){
|
|
|
- // 先读取rfid内容是否有子盘信息
|
|
|
- // 第一次使用子盘写入子盘唯一编码
|
|
|
- TTask tTask = baseMapper.selectById(Long.valueOf(map.get("id").toString()));
|
|
|
- // 调用rfid读取接口判断rfid里面是否子盘信息,第一次内容为空,写入自盘信息,后续只需更新夹具、和原材料信息
|
|
|
- return R.success();
|
|
|
- }
|
|
|
}
|