فهرست منبع

Merge remote-tracking branch 'origin/master' into master

yejian016332 4 سال پیش
والد
کامیت
944d4cd97e
22فایلهای تغییر یافته به همراه562 افزوده شده و 10 حذف شده
  1. 10 0
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/dispatchRecord/dao/DispatchExceptionMapper.java
  2. 10 0
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/dispatchRecord/dao/DispatchRecordMapper.java
  3. 7 0
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/dispatchRecord/service/DispatchExceptionService.java
  4. 8 0
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/dispatchRecord/service/DispatchRecordService.java
  5. 23 0
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/dispatchRecord/service/impl/DispatchExceptionServiceImpl.java
  6. 22 0
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/dispatchRecord/service/impl/DispatchRecordServiceImpl.java
  7. 7 0
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/TaskNodeService.java
  8. 8 0
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/WorkpieceService.java
  9. 33 0
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/TaskNodeServiceImpl.java
  10. 79 4
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/WorkpieceServiceImpl.java
  11. 4 1
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/impl/ProgramServiceImpl.java
  12. 2 2
      imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/operationManagementCenter/TWorkpieceMapper.xml
  13. 7 1
      imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/productionResourceCenter/ProductionresourcePositionMapper.xml
  14. 96 0
      imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/dispatchRecord/DispatchExceptionController.java
  15. 96 0
      imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/dispatchRecord/DispatchRecordController.java
  16. 21 0
      imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/operationManagementCenter/WorkpieceController.java
  17. 1 1
      imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/productionResourceCenter/ProgramController.java
  18. 62 0
      imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/dispatchRecord/entity/DispatchException.java
  19. 56 0
      imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/dispatchRecord/entity/DispatchRecord.java
  20. 1 1
      imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/operationManagementCenter/entity/TWorkpiece.java
  21. 7 0
      imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionResourceCenter/entity/ProductionresourcePosition.java
  22. 2 0
      imcs-admin-boot/imcs-tenant-biz/src/main/resources/mapper_tenant/base/defaults/ProductionresourceviewMapper.xml

+ 10 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/dispatchRecord/dao/DispatchExceptionMapper.java

@@ -0,0 +1,10 @@
+package com.github.zuihou.business.dispatchRecord.dao;
+
+import com.github.zuihou.base.mapper.SuperMapper;
+import com.github.zuihou.business.dispatchRecord.entity.DispatchException;
+import com.github.zuihou.business.dispatchRecord.entity.DispatchRecord;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface DispatchExceptionMapper extends SuperMapper<DispatchException> {
+}

+ 10 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/dispatchRecord/dao/DispatchRecordMapper.java

@@ -0,0 +1,10 @@
+package com.github.zuihou.business.dispatchRecord.dao;
+
+import com.github.zuihou.base.mapper.SuperMapper;
+import com.github.zuihou.business.dispatchRecord.entity.DispatchRecord;
+import com.github.zuihou.business.edgeLibrary.entity.Shelves;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface DispatchRecordMapper extends SuperMapper<DispatchRecord> {
+}

+ 7 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/dispatchRecord/service/DispatchExceptionService.java

@@ -0,0 +1,7 @@
+package com.github.zuihou.business.dispatchRecord.service;
+
+import com.github.zuihou.base.service.SuperCacheService;
+import com.github.zuihou.business.dispatchRecord.entity.DispatchException;
+
+public interface DispatchExceptionService extends SuperCacheService<DispatchException> {
+}

+ 8 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/dispatchRecord/service/DispatchRecordService.java

@@ -0,0 +1,8 @@
+package com.github.zuihou.business.dispatchRecord.service;
+
+import com.github.zuihou.base.service.SuperCacheService;
+import com.github.zuihou.business.dispatchRecord.entity.DispatchRecord;
+
+public interface DispatchRecordService extends SuperCacheService<DispatchRecord> {
+
+}

+ 23 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/dispatchRecord/service/impl/DispatchExceptionServiceImpl.java

@@ -0,0 +1,23 @@
+package com.github.zuihou.business.dispatchRecord.service.impl;
+
+import com.github.zuihou.base.service.SuperCacheServiceImpl;
+import com.github.zuihou.business.dispatchRecord.dao.DispatchExceptionMapper;
+import com.github.zuihou.business.dispatchRecord.dao.DispatchRecordMapper;
+import com.github.zuihou.business.dispatchRecord.entity.DispatchException;
+import com.github.zuihou.business.dispatchRecord.entity.DispatchRecord;
+import com.github.zuihou.business.dispatchRecord.service.DispatchExceptionService;
+import com.github.zuihou.business.dispatchRecord.service.DispatchRecordService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import static com.github.zuihou.common.constant.CacheKey.TENANT;
+
+@Slf4j
+@Service
+public class DispatchExceptionServiceImpl extends SuperCacheServiceImpl<DispatchExceptionMapper, DispatchException> implements DispatchExceptionService {
+
+    @Override
+    protected String getRegion() {
+        return TENANT;
+    }
+}

+ 22 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/dispatchRecord/service/impl/DispatchRecordServiceImpl.java

@@ -0,0 +1,22 @@
+package com.github.zuihou.business.dispatchRecord.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.zuihou.base.service.SuperCacheServiceImpl;
+import com.github.zuihou.business.dispatchRecord.dao.DispatchRecordMapper;
+import com.github.zuihou.business.dispatchRecord.entity.DispatchRecord;
+import com.github.zuihou.business.dispatchRecord.service.DispatchRecordService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import static com.github.zuihou.common.constant.CacheKey.TENANT;
+
+@Slf4j
+@Service
+public class DispatchRecordServiceImpl extends SuperCacheServiceImpl<DispatchRecordMapper, DispatchRecord> implements DispatchRecordService {
+
+    @Override
+    protected String getRegion() {
+        return TENANT;
+    }
+}

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

@@ -1,5 +1,6 @@
 package com.github.zuihou.business.operationManagementCenter.service;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.zuihou.base.R;
 import com.github.zuihou.base.service.SuperService;
@@ -114,4 +115,10 @@ public interface TaskNodeService extends SuperService<TaskNode> {
     void taskNodeCallbackBiz(TaskNode taskNode,TTask task,List<TaskNode>taskNodeList,AAutoNodeLog lg, String bizCallBackData);
 
 
+     R<String> handModeStock(JSONObject callBackJson);
+
+
+    R<String> handModeStockOut(Map conMap);
+
+
 }

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

@@ -37,4 +37,12 @@ public interface WorkpieceService extends SuperService<TWorkpiece> {
     public String execute(Map map);
 
 
+    public String handMove(Map map);
+
+
+    public String delete(Map map);
+
+    public String lock(Map map);
+
+
 }

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

@@ -1435,4 +1435,37 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
         return result;
     }
 
+
+    @Override
+    public R<String> handModeStockOut(Map conMap) {
+        String pointId = conMap.get("pointId")==null?"":conMap.get("pointId").toString();
+        String category = conMap.get("category")==null?"":conMap.get("category").toString();
+        Map queryMap = new HashMap();
+        queryMap.put("pointId", pointId);
+        List<ProductionresourcePosition> list = productionresourcePositionMapper.getPPList(queryMap);
+
+        R<String> result = null;
+
+        for(ProductionresourcePosition p:list){
+            if(!category.equals(p.getCategory())){
+                continue;
+            }
+
+            if("1".equals(p.getCategory())||"2".equals(p.getCategory())){//托盘夹具
+                BomProcedureTray tray = new BomProcedureTray();
+                tray.setTrayId(p.getGoodsId());
+                result = stockInfoService.procedureTrayStockOut(tray, p.getStorgeId());
+            }
+
+            if("4".equals(p.getCategory())){//原材料
+                BomProcedureMeterial meterial = new BomProcedureMeterial();
+                meterial.setMeterialId(p.getGoodsId());
+                result = stockInfoService.meterialStockOut(meterial,  p.getStorgeId(), "");
+            }
+            if (!result.getIsSuccess()) {
+                break;
+            }
+        }
+        return result;
+    }
 }

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

@@ -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 "";
+
+    }
 }

+ 4 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/impl/ProgramServiceImpl.java

@@ -203,8 +203,11 @@ public class ProgramServiceImpl extends SuperServiceImpl<ProgramMapper, Program>
     }
 
     public Boolean equipmentDelete(Program data){
+        if(1==1){//调用删除接口
+            baseMapper.deleteById(data.getId());
+        }
+        return true;
 
-        return null;
     }
 
     public Map implementProgram(Program data){

+ 2 - 2
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/operationManagementCenter/TWorkpieceMapper.xml

@@ -30,8 +30,8 @@
     <select id="pageList" resultMap="BaseResultMap">
         select
         <include refid="Base_Column_List"/>
-        from (select w.*,b.name bom_name, b.no bom_no
-        from imcs_t_workpiece w left join imcs_b_bom b on w.bom_id = b.id
+        from (select w.*
+        from imcs_t_workpiece w
         ) s ${ew.customSqlSegment}
     </select>
 

+ 7 - 1
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/productionResourceCenter/ProductionresourcePositionMapper.xml

@@ -44,11 +44,17 @@
     <select id="getPPList" resultType="com.github.zuihou.business.productionResourceCenter.entity.ProductionresourcePosition" parameterType="map">
         SELECT
         p.*,r.code,s.lock_status lockStatus,i.goods_id goodsId,i.goods_type category,i.complete_batch_no completeBatchNo,s.complete_batch_no campCompleteBatchNo,i.unique_code uniqueCode
-        FROM
+        <if test="goodsName != null and goodsName != ''">
+            ,b.name goodsName
+        </if>
+       FROM
         imcs_p_productionresource_position p
         LEFT JOIN imcs_s_storge s on p.storge_id = s.id
         LEFT JOIN imcs_s_stock_info i ON p.storge_id = i.storge_id
         INNER JOIN imcs_tenant_productionresource r ON p.resource_id = r.id
+        <if test="goodsName != null and goodsName != ''">
+            left join view_stock_goods b on i.spec_id = b.specId
+        </if>
         where 1=1
         <if test="haveGoods != null and haveGoods != ''">
             and i.storge_id is not null

+ 96 - 0
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/dispatchRecord/DispatchExceptionController.java

@@ -0,0 +1,96 @@
+package com.github.zuihou.business.controller.dispatchRecord;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.ReflectUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.zuihou.base.R;
+import com.github.zuihou.base.controller.SuperSimpleController;
+import com.github.zuihou.base.request.PageParams;
+import com.github.zuihou.business.dispatchRecord.entity.DispatchException;
+import com.github.zuihou.business.dispatchRecord.entity.DispatchRecord;
+import com.github.zuihou.business.dispatchRecord.service.DispatchExceptionService;
+import com.github.zuihou.business.dispatchRecord.service.DispatchRecordService;
+import com.github.zuihou.database.mybatis.conditions.Wraps;
+import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
+import com.github.zuihou.database.mybatis.conditions.query.QueryWrap;
+import com.github.zuihou.log.annotation.SysLog;
+import com.github.zuihou.utils.DateUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.lang.reflect.Field;
+import java.util.Iterator;
+import java.util.Map;
+
+@Slf4j
+@Validated
+@RestController
+@RequestMapping("/dispatchException")
+@Api(value = "dispatchException", tags = "调度异常")
+@SysLog(enabled = true)
+public class DispatchExceptionController extends SuperSimpleController<DispatchExceptionService, DispatchException> {
+
+    @ApiOperation(value = "查询设备刀具管理", notes = "查询设备刀具管理")
+    @PostMapping("/page")
+    public R<IPage<DispatchException>> page(@RequestBody @Validated PageParams<DispatchException> params) {
+        IPage<DispatchException> page = params.buildPage();
+        QueryWrap<DispatchException> wrap = handlerWrapper(null, params);
+        LbqWrapper<DispatchException> wrapper = wrap.lambda();
+        wrapper.like(DispatchException::getName, params.getModel().getName())
+                .orderByDesc(DispatchException::getCreateTime);
+        baseService.page(page, wrapper);
+        return this.success(page);
+    }
+
+    private QueryWrap<DispatchException> handlerWrapper(DispatchException model, PageParams<DispatchException> params) {
+       QueryWrap<DispatchException> wrapper = model == null ? Wraps.q() : Wraps.q(model);
+       if (CollUtil.isNotEmpty(params.getMap())) {
+           Map<String, String> map = params.getMap();
+           Iterator var5 = map.entrySet().iterator();
+
+           while (var5.hasNext()) {
+               Map.Entry<String, String> field = (Map.Entry) var5.next();
+               String key = (String) field.getKey();
+               String value = (String) field.getValue();
+               if (!StrUtil.isEmpty(value)) {
+                   String beanField;
+                   if (key.endsWith("_st")) {
+                       beanField = StrUtil.subBefore(key, "_st", true);
+                       wrapper.ge(this.getDbField(beanField, this.getEntityClass()), DateUtils.getStartTime(value));
+                   }
+
+                   if (key.endsWith("_ed")) {
+                       beanField = StrUtil.subBefore(key, "_ed", true);
+                       wrapper.le(this.getDbField(beanField, this.getEntityClass()), DateUtils.getEndTime(value));
+                   }
+               }
+           }
+       }
+       return wrapper;
+   }
+
+    private String getDbField(String beanField, Class<?> clazz) {
+           Field field = ReflectUtil.getField(clazz, beanField);
+           if (field == null) {
+               return "";
+           } else {
+               TableField tf = (TableField)field.getAnnotation(TableField.class);
+               if (tf != null && StringUtils.isNotEmpty(tf.value())) {
+                   String str = tf.value();
+                   return str;
+               } else {
+                   return "";
+               }
+           }
+       }
+
+}

+ 96 - 0
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/dispatchRecord/DispatchRecordController.java

@@ -0,0 +1,96 @@
+package com.github.zuihou.business.controller.dispatchRecord;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.ReflectUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.zuihou.base.R;
+import com.github.zuihou.base.controller.SuperSimpleController;
+import com.github.zuihou.base.request.PageParams;
+import com.github.zuihou.business.dispatchRecord.entity.DispatchRecord;
+import com.github.zuihou.business.dispatchRecord.service.DispatchRecordService;
+import com.github.zuihou.business.productionResourceCenter.entity.Tool;
+import com.github.zuihou.database.mybatis.conditions.Wraps;
+import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
+import com.github.zuihou.database.mybatis.conditions.query.QueryWrap;
+import com.github.zuihou.log.annotation.SysLog;
+import com.github.zuihou.utils.DateUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.lang.reflect.Field;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+@Slf4j
+@Validated
+@RestController
+@RequestMapping("/dispatchRecord")
+@Api(value = "dispatchRecord", tags = "调度对话")
+@SysLog(enabled = true)
+public class DispatchRecordController extends SuperSimpleController<DispatchRecordService, DispatchRecord> {
+
+    @ApiOperation(value = "查询设备刀具管理", notes = "查询设备刀具管理")
+    @PostMapping("/page")
+    public R<IPage<DispatchRecord>> page(@RequestBody @Validated PageParams<DispatchRecord> params) {
+        IPage<DispatchRecord> page = params.buildPage();
+        QueryWrap<DispatchRecord> wrap = handlerWrapper(null, params);
+        LbqWrapper<DispatchRecord> wrapper = wrap.lambda();
+        wrapper.like(DispatchRecord::getName, params.getModel().getName())
+                .orderByDesc(DispatchRecord::getCreateTime);
+        baseService.page(page, wrapper);
+        return this.success(page);
+    }
+
+    private QueryWrap<DispatchRecord> handlerWrapper(DispatchRecord model, PageParams<DispatchRecord> params) {
+       QueryWrap<DispatchRecord> wrapper = model == null ? Wraps.q() : Wraps.q(model);
+       if (CollUtil.isNotEmpty(params.getMap())) {
+           Map<String, String> map = params.getMap();
+           Iterator var5 = map.entrySet().iterator();
+
+           while (var5.hasNext()) {
+               Map.Entry<String, String> field = (Map.Entry) var5.next();
+               String key = (String) field.getKey();
+               String value = (String) field.getValue();
+               if (!StrUtil.isEmpty(value)) {
+                   String beanField;
+                   if (key.endsWith("_st")) {
+                       beanField = StrUtil.subBefore(key, "_st", true);
+                       wrapper.ge(this.getDbField(beanField, this.getEntityClass()), DateUtils.getStartTime(value));
+                   }
+
+                   if (key.endsWith("_ed")) {
+                       beanField = StrUtil.subBefore(key, "_ed", true);
+                       wrapper.le(this.getDbField(beanField, this.getEntityClass()), DateUtils.getEndTime(value));
+                   }
+               }
+           }
+       }
+       return wrapper;
+   }
+
+    private String getDbField(String beanField, Class<?> clazz) {
+           Field field = ReflectUtil.getField(clazz, beanField);
+           if (field == null) {
+               return "";
+           } else {
+               TableField tf = (TableField)field.getAnnotation(TableField.class);
+               if (tf != null && StringUtils.isNotEmpty(tf.value())) {
+                   String str = tf.value();
+                   return str;
+               } else {
+                   return "";
+               }
+           }
+       }
+
+}

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

@@ -154,5 +154,26 @@ public class WorkpieceController extends SuperController<WorkpieceService, Long,
     }
 
 
+    @ApiOperation(value = "手工移位(非订单)", notes = "机器人取到(非订单)")
+    @PostMapping("/handMode/handMove")
+    public R<String>  handMove(@RequestBody Map map) {
+        return success(baseService.handMove(map));
+    }
+
+
+    @ApiOperation(value = "删除(非订单)", notes = "删除(非订单)")
+    @PostMapping("/handMode/delete")
+    public R<String>  delete(@RequestBody Map map) {
+        return success(baseService.delete(map));
+    }
+
+
+    @ApiOperation(value = "锁定(非订单)", notes = "锁定(非订单)")
+    @PostMapping("/handMode/lock")
+    public R<String>  lock(@RequestBody Map map) {
+        return success(baseService.lock(map));
+    }
+
+
 
 }

+ 1 - 1
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/productionResourceCenter/ProgramController.java

@@ -118,7 +118,7 @@ public class ProgramController extends SuperController<ProgramService, Long, Pro
         return success(baseService.synchronousNumericalProgram(model));
     }
 
-    @ApiOperation(value = "设备删除", notes = "设备删除")
+    @ApiOperation(value = "设备删除", notes = "设备删除")
     @PostMapping("/equipmentDelete")
     public R<Boolean> equipmentDelete(@RequestBody Program model) {
 

+ 62 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/dispatchRecord/entity/DispatchException.java

@@ -0,0 +1,62 @@
+package com.github.zuihou.business.dispatchRecord.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.github.zuihou.base.entity.Entity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.*;
+import lombok.experimental.Accessors;
+import org.hibernate.validator.constraints.Length;
+
+import java.time.LocalDateTime;
+
+import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;
+
+@Data
+@NoArgsConstructor
+@ToString(callSuper = true)
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@TableName("imcs_dispatch_exception")
+@ApiModel(value = "DispatchException", description = "调度异常处理")
+@AllArgsConstructor
+public class DispatchException  extends Entity<Long> {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "指令内容")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "name", condition = LIKE)
+    @Excel(name = "指令内容")
+    private String name;
+
+    @ApiModelProperty(value = "操作设备")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "device", condition = LIKE)
+    @Excel(name = "device")
+    private String device;
+
+    @ApiModelProperty(value = "执行时间")
+    @TableField(value = "operation_time", condition = LIKE)
+    @Excel(name = "执行时间")
+    private LocalDateTime operationTime;
+
+    @ApiModelProperty(value = "状态(1-运行中2-执行失败3-发送失败)")
+    @TableField(value = "status", condition = LIKE)
+    @Length(max = 1, message = "名称长度不能超过1")
+    @Excel(name = "状态(1-运行中2-执行失败3-发送失败)")
+    private String status;
+
+    @Builder
+    public DispatchException(LocalDateTime createTime, Long createUser, LocalDateTime updateTime, Long updateUser, String name, String device, LocalDateTime operationTime, String status) {
+        this.name = name;
+        this.device = device;
+        this.operationTime = operationTime;
+        this.status = status;
+        this.createTime = createTime;
+        this.createUser = createUser;
+        this.updateTime = updateTime;
+        this.updateUser = updateUser;
+    }
+}

+ 56 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/dispatchRecord/entity/DispatchRecord.java

@@ -0,0 +1,56 @@
+package com.github.zuihou.business.dispatchRecord.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.github.zuihou.base.entity.Entity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.*;
+import lombok.experimental.Accessors;
+import org.hibernate.validator.constraints.Length;
+
+import java.time.LocalDateTime;
+
+import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;
+
+@Data
+@NoArgsConstructor
+@ToString(callSuper = true)
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@TableName("imcs_dispatch_record")
+@ApiModel(value = "DispatchRecord", description = "调度对话记录")
+@AllArgsConstructor
+public class DispatchRecord extends Entity<Long> {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 名称
+     */
+    @ApiModelProperty(value = "指令内容")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "name", condition = LIKE)
+    @Excel(name = "指令内容")
+    private String name;
+
+
+    @ApiModelProperty(value = "下发时间")
+    @TableField(value = "distribute_time", condition = LIKE)
+    @Excel(name = "下发时间")
+    private LocalDateTime distributeTime;
+
+
+    @Builder
+    public DispatchRecord(Long id, LocalDateTime createTime, Long updateUser, Long createUser, LocalDateTime updateTime,
+                  LocalDateTime distributeTime, String name) {
+        this.id = id;
+        this.createTime = createTime;
+        this.updateUser = updateUser;
+        this.createUser = createUser;
+        this.updateTime = updateTime;
+        this.name = name;
+        this.distributeTime = distributeTime;
+    }
+
+}

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

@@ -103,7 +103,7 @@ 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;
 

+ 7 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionResourceCenter/entity/ProductionresourcePosition.java

@@ -229,6 +229,13 @@ public class ProductionresourcePosition extends Entity<Long> {
 
 
 
+    @ApiModelProperty(value = "物品名称")
+    @TableField(exist = false)
+    @Excel(name = "物品名称")
+    private String goodsName;
+
+
+
 
 
     @Builder

+ 2 - 0
imcs-admin-boot/imcs-tenant-biz/src/main/resources/mapper_tenant/base/defaults/ProductionresourceviewMapper.xml

@@ -23,6 +23,8 @@
             v.production_no  productionNo,
             v.manufacturer,
             v.is_auto_code isAutoCode,
+            v.program_syn_time programSynTime,
+            v.program_num programNum,
             pic,
             name,
             code,