|
|
@@ -2,9 +2,11 @@ package com.github.zuihou.business.operationManagementCenter.service.impl;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
+import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGAlterTableAlterColumnSetNotNull;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.github.zuihou.authority.entity.common.DictionaryItem;
|
|
|
import com.github.zuihou.base.R;
|
|
|
import com.github.zuihou.base.service.SuperServiceImpl;
|
|
|
import com.github.zuihou.business.DemoLine.DemoCacheKey;
|
|
|
@@ -257,10 +259,11 @@ public class OrderServiceImpl extends SuperServiceImpl<OrderMapper, Order> imple
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public Order updateData(OrderUpdateDTO data) {
|
|
|
- Order bean = BeanPlusUtil.toBean(data, Order.class);
|
|
|
- updateById(bean);
|
|
|
- return bean;
|
|
|
+ public R updateData(OrderUpdateDTO data) {
|
|
|
+
|
|
|
+ Plan bean = BeanPlusUtil.toBean(data, Plan.class);
|
|
|
+ planMapper.updateById(bean);
|
|
|
+ return R.success();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -321,7 +324,7 @@ public class OrderServiceImpl extends SuperServiceImpl<OrderMapper, Order> imple
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Map<String,Object> oneTouchSchedule(Map<String,Object> map) {
|
|
|
+ public R oneTouchSchedule(Map<String,Object> map) {
|
|
|
List<Map>list = new ArrayList<Map>();
|
|
|
if(map!=null&&map.get("orderList")!=null){
|
|
|
list = (List<Map>)map.get("orderList");
|
|
|
@@ -336,7 +339,7 @@ public class OrderServiceImpl extends SuperServiceImpl<OrderMapper, Order> imple
|
|
|
if(obj==null){
|
|
|
redisTemplate.opsForValue().set(RepeatCacheKey.ONETOUCHSCHEDULE_UNION_KEY+"_"+ids,"1",60,TimeUnit.SECONDS);
|
|
|
}else{
|
|
|
- return map;
|
|
|
+ return R.success();
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -366,6 +369,18 @@ public class OrderServiceImpl extends SuperServiceImpl<OrderMapper, Order> imple
|
|
|
List<Long> bomIdList = orderProductList.stream().map(p -> p.getBomId()).collect(Collectors.toList());
|
|
|
//查出本次需要得工艺信息
|
|
|
Map<Long, List<BomProcedure>> bomProcedureMap = bomProcedureService.getBomProcedureMap(bomIdList);
|
|
|
+
|
|
|
+ if(bomProcedureMap.size() == 0){
|
|
|
+ return R.fail("当前排产零件中存在未配置工艺路线,无法进行排产");
|
|
|
+ }else{
|
|
|
+ for(Long key : bomProcedureMap.keySet()){//keySet获取map集合key的集合 然后在遍历key即可
|
|
|
+ List<BomProcedure> bomProcedures = bomProcedureMap.get(key);
|
|
|
+ if(bomProcedures.size() == 0){
|
|
|
+ return R.fail("当前排产零件中存在未配置工艺路线,无法进行排产");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//查出所有的计划产品
|
|
|
List<PlanProduct> planProductList = planProductService.list(Wraps.<PlanProduct>lbQ().in(PlanProduct::getPlanId, planIdList));
|
|
|
//生成任务
|
|
|
@@ -375,7 +390,7 @@ public class OrderServiceImpl extends SuperServiceImpl<OrderMapper, Order> imple
|
|
|
}finally {
|
|
|
redisTemplate.delete(RepeatCacheKey.ONETOUCHSCHEDULE_UNION_KEY+"_"+ids);
|
|
|
}
|
|
|
- return map;
|
|
|
+ return R.success();
|
|
|
}
|
|
|
|
|
|
|