فهرست منبع

后台业务功能代码

oyq28 2 سال پیش
والد
کامیت
5f173b050f

+ 5 - 2
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/edgeLibrary/service/impl/StockInfoServiceImpl.java

@@ -411,7 +411,10 @@ public class StockInfoServiceImpl extends SuperServiceImpl<StockInfoMapper, Stoc
 
         StockInfo infoBean = new StockInfo();
         BeanUtil.copyProperties(trayStock, infoBean, new String[]{"id"});
-        infoBean.setStorgeId(storgeId).setLockStatus("1").setCompleteBatchNo(completeBatchNo);
+        infoBean.setStorgeId(storgeId).setLockStatus("1");
+        if(StringUtil.isNotEmpty(trayStock.getCompleteBatchNo())){
+            infoBean.setCompleteBatchNo(completeBatchNo);
+        }
         save(infoBean);
         //库存日志
         stockLogService.saveLog(infoBean,BizConstant.STOCK_TYPE_IN,completeBatchNo);
@@ -481,7 +484,7 @@ public class StockInfoServiceImpl extends SuperServiceImpl<StockInfoMapper, Stoc
 
     @Override
     public R<String> procedureTrayStockOut(BomProcedureTray bomProcedureTray,Long storgeId) {
-        List<StockInfo>list  = baseMapper.selectList(Wraps.<StockInfo>lbQ().eq(StockInfo::getStorgeId,storgeId).eq(StockInfo::getGoodsId,bomProcedureTray.getTrayId()));
+        List<StockInfo>list  = baseMapper.selectList(Wraps.<StockInfo>lbQ().eq(StockInfo::getStorgeId,storgeId).lt(StockInfo::getGoodsType, "2").eq(StockInfo::getGoodsId,bomProcedureTray.getTrayId()));
 //        if("1".equals(bomProcedureTray.getBizType())){//托盘
 //            list = baseMapper.selectList(Wraps.<StockInfo>lbQ().eq(StockInfo::getStorgeId,storgeId).eq(StockInfo::getGoodsId,bomProcedureTray.getTrayId()));
 //        }else{//夹具

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

@@ -1935,7 +1935,7 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
                     stockInfoList.stream().forEach(stockInfo -> {
                         stockInfo.setCompleteBatchNo("");
                     });
-                    stockInfoService.saveBatch(stockInfoList);
+                    stockInfoService.updateBatchById(stockInfoList);
                 }
                 return ckresult;
             }
@@ -2790,17 +2790,17 @@ planId));
     private List<StockInfo> getConnectTray(List<BomProcedureTray> bomProcedureTrayList, int isReload){
         List<StockInfo> stockInfoList = null;
         List<Long> trayIds = bomProcedureTrayList.stream().map(tray->tray.getTrayId()).collect(Collectors.toList());
-        stockInfoList = stockInfoService.list(new LbqWrapper<StockInfo>().in(StockInfo::getGoodsId, trayIds).in(StockInfo::getGoodsType, "1,2").last("limit 2").orderByAsc(StockInfo::getGoodsType));
+        stockInfoList = stockInfoService.list(new LbqWrapper<StockInfo>().in(StockInfo::getGoodsId, trayIds).in(StockInfo::getGoodsType, new String[]{"1","2"}).last("limit 2").orderByAsc(StockInfo::getGoodsType));
 
         if(CollectionUtil.isNotEmpty(stockInfoList)) {
             boolean bool = stockInfoList.get(0).getStorgeId().equals(stockInfoList.get(1).getStorgeId());
             if (!bool) {
                 //已经换装,以工装作为点位参考
                 if (isReload > 0) {
-                    stockInfoList = stockInfoService.list(new LbqWrapper<StockInfo>().eq(StockInfo::getStorgeId, stockInfoList.get(1).getStorgeId()).orderByAsc(StockInfo::getGoodsType));
+                    stockInfoList = stockInfoService.list(new LbqWrapper<StockInfo>().eq(StockInfo::getStorgeId, stockInfoList.get(1).getStorgeId()).lt(StockInfo::getGoodsType, "2").orderByAsc(StockInfo::getGoodsType));
                 } else {
                     //未换装,以子盘作为点位参考
-                    stockInfoList = stockInfoService.list(new LbqWrapper<StockInfo>().eq(StockInfo::getStorgeId, stockInfoList.get(0).getStorgeId()).orderByAsc(StockInfo::getGoodsType));
+                    stockInfoList = stockInfoService.list(new LbqWrapper<StockInfo>().eq(StockInfo::getStorgeId, stockInfoList.get(0).getStorgeId()).lt(StockInfo::getGoodsType, "2").orderByAsc(StockInfo::getGoodsType));
                 }
             }
         }

+ 24 - 5
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/impl/RobotNodeServiceImpl.java

@@ -27,11 +27,11 @@ import com.github.zuihou.business.operationManagementCenter.service.WorkpieceSer
 import com.github.zuihou.business.productionReadyCenter.dao.BBomMapper;
 import com.github.zuihou.business.productionReadyCenter.dao.BomProcedureMapper;
 import com.github.zuihou.business.productionReadyCenter.dao.BomProcedureTrayMapper;
-import com.github.zuihou.business.productionReadyCenter.entity.BBom;
-import com.github.zuihou.business.productionReadyCenter.entity.BomProcedure;
-import com.github.zuihou.business.productionReadyCenter.entity.BomProcedureTray;
+import com.github.zuihou.business.productionReadyCenter.entity.*;
 import com.github.zuihou.business.productionReadyCenter.service.BomProcedureService;
 import com.github.zuihou.business.productionReadyCenter.service.BomProcedureTrayService;
+import com.github.zuihou.business.productionReadyCenter.service.MToolClampService;
+import com.github.zuihou.business.productionReadyCenter.service.TrayService;
 import com.github.zuihou.business.productionResourceCenter.dao.*;
 import com.github.zuihou.business.productionResourceCenter.entity.*;
 import com.github.zuihou.business.productionResourceCenter.service.NodeOperationService;
@@ -128,6 +128,8 @@ public class RobotNodeServiceImpl implements NodeOperationService {
     private RestTemplate restTemplate;
     @Autowired
     private PlanMapper planMapper;
+    @Autowired
+    private TrayService trayService;
 
     private Map<String, Object> map = Maps.newHashMap();
 
@@ -1207,11 +1209,11 @@ public class RobotNodeServiceImpl implements NodeOperationService {
         List<ProductionresourcePosition> startProductionresourcePositions = productionresourcePositionMapper.selectList(Wraps.<ProductionresourcePosition>lbQ().in(ProductionresourcePosition::getResourceId, productionresourceIds).eq(ProductionresourcePosition::getStatus,"0"));
         List<Long> startProductionresourcePositionIds = startProductionresourcePositions.stream().map(t->t.getStorgeId()).collect(Collectors.toList());
 
-        List<BomProcedureTray>trayList = procedureTrayService.list(Wraps.<BomProcedureTray>lbQ().eq(BomProcedureTray::getProcedureId, task.getProcedureId()));
+        List<BomProcedureTray>trayList = procedureTrayService.list(Wraps.<BomProcedureTray>lbQ().eq(BomProcedureTray::getProcedureId, task.getProcedureId()).orderByAsc(BomProcedureTray::getBizType));
         List<Long>trayIdList = trayList.stream().map(t->t.getTrayId()).collect(Collectors.toList());
         // 判断夹具是否有可用的,查询330个库位信息中是否还有夹具
 
-        List<StockInfo> allStockInfos = stockInfoMapper.selectList(Wraps.<StockInfo>lbQ().in(StockInfo::getGoodsId,trayIdList).in(StockInfo::getStorgeId,startProductionresourcePositionIds).orderByAsc(StockInfo::getWeight, StockInfo::getGoodsType));
+        List<StockInfo> allStockInfos = stockInfoMapper.selectList(Wraps.<StockInfo>lbQ().in(StockInfo::getGoodsId,trayIdList).in(StockInfo::getStorgeId,startProductionresourcePositionIds).orderByAsc(StockInfo::getGoodsType));
 
         if(CollectionUtil.isNotEmpty(allStockInfos)){
             //托盘和夹具判断
@@ -1231,6 +1233,23 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                     returnList = allStockInfos;
                 }
             }
+        }else{
+            List<StockInfo> stockList = stockInfoMapper.selectList(Wraps.<StockInfo>lbQ().in(StockInfo::getGoodsId,trayIdList).orderByAsc(StockInfo::getGoodsType));
+            Tray currTray = trayService.getById(trayIdList.get(0));
+            List<StockInfo> currStockList = stockInfoMapper.selectList(new LbqWrapper<StockInfo>().eq(StockInfo::getStorgeId, stockList.get(1).getStorgeId()));
+            Tray stockTray = trayService.getById(currStockList.get(0).getGoodsId());
+            //判断是否已经翻面
+            if(stockTray.getFiveAxis().equals("0")){
+                // 获取三轴同类型子盘和工装
+                Tray otherTray = trayService.list(new LbqWrapper<Tray>().eq(Tray::getProductionType, currTray.getProductionType())).get(0);
+                StockInfo otherStock = stockInfoMapper.selectOne(new LbqWrapper<StockInfo>().eq(StockInfo::getGoodsId, otherTray.getId()));
+                returnList = stockInfoMapper.selectList(new LbqWrapper<StockInfo>().eq(StockInfo::getStorgeId, otherStock.getStorgeId()));
+            }else{
+                //翻面获取五轴同类型子盘和工装
+                Tray axisTray = trayService.list(new LbqWrapper<Tray>().eq(Tray::getProductionType, currTray.getProductionType()).eq(Tray::getFiveAxis, "1")).get(0);
+                StockInfo axisStock = stockInfoMapper.selectOne(new LbqWrapper<StockInfo>().eq(StockInfo::getGoodsId, axisTray.getId()));
+                returnList = stockInfoMapper.selectList(new LbqWrapper<StockInfo>().eq(StockInfo::getStorgeId, axisStock.getStorgeId()));
+            }
         }
         return returnList;
     }

+ 2 - 1
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/productionReadyCenter/TrayMapper.xml

@@ -12,6 +12,7 @@
         <result column="name" jdbcType="VARCHAR" property="name"/>
         <result column="no" jdbcType="VARCHAR" property="no"/>
         <result column="brand" jdbcType="VARCHAR" property="brand"/>
+        <result column="production_type" jdbcType="VARCHAR" property="productionType"/>
         <result column="num" jdbcType="INTEGER" property="num"/>
         <result column="specification" jdbcType="VARCHAR" property="specification"/>
         <result column="status" jdbcType="VARCHAR" property="status"/>
@@ -21,7 +22,7 @@
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
         id,create_time,create_user,update_time,update_user,material_type,factory,period,expiry_date,join_date,
-        name, no, brand, zone_id, num, specification, status,positionSort,org_id
+        name, no, zone_id, num, specification,production_type,five_axis,status,positionSort,org_id
     </sql>
 
     <!-- 分页 -->

+ 3 - 1
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/productionReadyCenter/TrayController.java

@@ -60,7 +60,9 @@ public class TrayController extends SuperController<TrayService, Long, Tray, Tra
 
         wrapper.like(Tray::getName, tray.getName())
                 .like(Tray::getSpecification, tray.getSpecification())
-                .eq(Tray::getBrand,tray.getBrand()).eq(Tray::getStatus,tray.getStatus());
+                //.eq(Tray::getBrand,tray.getBrand())
+                .eq(Tray::getProductionType, tray.getProductionType())
+                .eq(Tray::getStatus,tray.getStatus());
 
         IPage<Tray> list= baseService.pageList(page, wrapper);
 //        //取出分页里面得数据

+ 9 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionReadyCenter/dto/TrayPageDTO.java

@@ -6,6 +6,7 @@ import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
+import com.github.zuihou.authority.entity.core.Org;
 import com.github.zuihou.base.entity.Entity;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.github.zuihou.model.RemoteData;
@@ -66,6 +67,7 @@ public class TrayPageDTO implements Serializable {
     @ApiModelProperty(value = "品牌")
     @Length(max = 64, message = "品牌长度不能超过64")
     private RemoteData<String, String> brand;
+
     /**
      * 规格
      */
@@ -85,4 +87,11 @@ public class TrayPageDTO implements Serializable {
     @ApiModelProperty(value = "产线")
     private Long zoneId;
 
+    @ApiModelProperty(value = "产品分类")
+    @Length(max = 64, message = "品牌长度不能超过64")
+    private RemoteData<String, String> productionType;
+
+    @ApiModelProperty(value = "是否五轴(0-否1-是)")
+    private Integer fiveAxis;
+
 }

+ 6 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionReadyCenter/dto/TraySaveDTO.java

@@ -103,6 +103,12 @@ public class TraySaveDTO implements Serializable {
     @Excel(name = "生产分厂")
     private String factory;
 
+    @ApiModelProperty(value = "产品分类")
+    private RemoteData<String, String> productionType;
+
+    @ApiModelProperty(value = "是否五轴(0-否1-是)")
+    private Integer fiveAxis;
+
     @ApiModelProperty(value = "有效期(月)")
     private Integer expiryDate;
 

+ 7 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionReadyCenter/dto/TrayUpdateDTO.java

@@ -68,6 +68,7 @@ public class TrayUpdateDTO implements Serializable {
     @ApiModelProperty(value = "品牌")
     @Length(max = 64, message = "品牌长度不能超过64")
     private RemoteData<String, String> brand;
+
     /**
      * 规格
      */
@@ -103,6 +104,12 @@ public class TrayUpdateDTO implements Serializable {
     @Excel(name = "生产分厂")
     private String factory;
 
+    @ApiModelProperty(value = "产品分类")
+    private RemoteData<String, String> productionType;
+
+    @ApiModelProperty(value = "是否五轴(0-否1-是)")
+    private Integer fiveAxis;
+
     @ApiModelProperty(value = "有效期(月)")
     private Integer expiryDate;
 

+ 17 - 3
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionReadyCenter/entity/Tray.java

@@ -5,6 +5,7 @@ import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
+import com.github.zuihou.authority.entity.common.DictionaryItem;
 import com.github.zuihou.base.entity.Entity;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.github.zuihou.injection.annonation.InjectionField;
@@ -27,8 +28,8 @@ import lombok.ToString;
 import lombok.experimental.Accessors;
 import com.github.zuihou.common.constant.DictionaryType;
 
-import static com.github.zuihou.common.constant.InjectionFieldConstants.DICTIONARY_ITEM_CLASS;
-import static com.github.zuihou.common.constant.InjectionFieldConstants.DICTIONARY_ITEM_METHOD;
+import static com.github.zuihou.common.constant.InjectionFieldConstants.*;
+import static com.github.zuihou.common.constant.InjectionFieldConstants.ORG_ID_METHOD;
 import static com.github.zuihou.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;
 
 import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;
@@ -143,6 +144,18 @@ public class Tray extends Entity<Long> {
     @TableField(value = "period", condition = LIKE)
     private Integer period;
 
+    @ApiModelProperty(value = "产品分类")
+    @InjectionField(api = DICTIONARY_ITEM_CLASS, method = DICTIONARY_ITEM_METHOD, dictType = DictionaryType.BUSINESS_PRODUCT_TYPE)
+    @TableField(value = "production_type", condition = LIKE)
+    @Length(max = 64, message = "品牌长度不能超过64")
+    @Excel(name = "产品分类")
+    private RemoteData<String, String> productionType;
+
+    @ApiModelProperty(value = "是否五轴(0-否1-是)")
+    @TableField(value = "five_axis", condition = LIKE)
+    @Excel(name = "是否五轴")
+    private Integer fiveAxis;
+
     /**
      * 夹紧位置
      */
@@ -156,7 +169,7 @@ public class Tray extends Entity<Long> {
 
     @Builder
     public Tray(Long id, LocalDateTime createTime, Long createUser, LocalDateTime updateTime, Long updateUser, Long zoneId,
-                    String name, String no, RemoteData<String, String> brand, String specification, String status) {
+                    String name, String no, RemoteData<String, String> brand, RemoteData<String, String> productionType, String specification, String status) {
         this.id = id;
         this.createTime = createTime;
         this.createUser = createUser;
@@ -168,6 +181,7 @@ public class Tray extends Entity<Long> {
         this.brand = brand;
         this.specification = specification;
         this.status = status;
+        this.productionType = productionType;
     }
 
 }

+ 5 - 1
imcs-admin-boot/imcs-common/src/main/java/com/github/zuihou/common/constant/DictionaryType.java

@@ -148,9 +148,13 @@ public class DictionaryType {
      */
     public static final String MODEL_CNC_SYSTEM = "MODEL_CNC_SYSTEM";
 
+    /**
+     *  业务产品分类
+     */
+    public static final String BUSINESS_PRODUCT_TYPE = "BUSINESS_PRODUCT_TYPE";
 
     public static final String[] ALL = new String[]{
-            EDUCATION, NATION, POSITION_STATUS, AREA_LEVEL,RESOURCES_TYPE,RESOURCES_CATEGORY,MODEL_CATEGORY,MODEL_NODE_TYPE,MODEL_NET_MODE,MODEL_JOIN_AGREEMENT,
+            EDUCATION, NATION, POSITION_STATUS, AREA_LEVEL,RESOURCES_TYPE,RESOURCES_CATEGORY,MODEL_CATEGORY,MODEL_NODE_TYPE,MODEL_NET_MODE,MODEL_JOIN_AGREEMENT, BUSINESS_PRODUCT_TYPE,
             DATA_TYPE,COMPANY,OPERATOR,ISSUE_INSTRUCTIONS,PRESCRIPTION,INTERFACE_MODULE_TYPE,METERIAL_CATEGORY,METERIAL_BRAND,FREQUENCY,MONITOR_WAY, IGEN_PROJECT_STATUS,INTERFACE_TYPE,CUTTING_TOOL_TYPE,MODEL_CNC_SYSTEM
     };