| | |
| | | // @ManagerAuth |
| | | public R overview(@RequestParam(required = false) String areaId){ |
| | | |
| | | //digitalTwinService.overview(areaId); |
| | | DtOverviewVo dtOverviewVo = digitalTwinService.overview(areaId); |
| | | |
| | | DtOverviewVo dtOverviewVo = DtOverviewVo.builder() |
| | | .totalLoc(999) |
| | | .useLoc(900) |
| | | .idleLoc(99) |
| | | .todayOutbound(160) |
| | | .todayWarehousing(170) |
| | | .remainingStock(180) |
| | | .build(); |
| | | // DtOverviewVo dtOverviewVo = DtOverviewVo.builder() |
| | | // .totalLoc(999) |
| | | // .useLoc(900) |
| | | // .idleLoc(99) |
| | | // .todayOutbound(160) |
| | | // .todayWarehousing(170) |
| | | // .remainingStock(180) |
| | | // .build(); |
| | | |
| | | return R.ok().add(dtOverviewVo); |
| | | } |
| | |
| | | public R recentOrder(@RequestParam(required = false) String startDate, |
| | | @RequestParam(required = false) String endDate){ |
| | | |
| | | // digitalTwinService.order(startDate, endDate); |
| | | List<DtOrderVo> orderVoList = digitalTwinService.order(startDate, endDate); |
| | | |
| | | DtOrderVo dtOrderVo = DtOrderVo.builder() |
| | | .orderDate("2025-10-22") |
| | | .orderNum(156) |
| | | .build(); |
| | | DtOrderVo dtOrderVo2 = DtOrderVo.builder() |
| | | .orderDate("2025-10-23") |
| | | .orderNum(166) |
| | | .build(); |
| | | List<DtOrderVo> orderVoList = new ArrayList<>(); |
| | | orderVoList.add(dtOrderVo); |
| | | orderVoList.add(dtOrderVo2); |
| | | // DtOrderVo dtOrderVo = DtOrderVo.builder() |
| | | // .orderDate("2025-10-22") |
| | | // .orderNum(156) |
| | | // .build(); |
| | | // DtOrderVo dtOrderVo2 = DtOrderVo.builder() |
| | | // .orderDate("2025-10-23") |
| | | // .orderNum(166) |
| | | // .build(); |
| | | // List<DtOrderVo> orderVoList = new ArrayList<>(); |
| | | // orderVoList.add(dtOrderVo); |
| | | // orderVoList.add(dtOrderVo2); |
| | | |
| | | return R.ok().add(orderVoList); |
| | | } |
| | |
| | | @RequestParam(required = false) String startDate, |
| | | @RequestParam(required = false) String endDate){ |
| | | |
| | | // digitalTwinService.recentLoc(areaId, startDate, endDate); |
| | | List<DtLocVo> locVoList = digitalTwinService.recentLoc(areaId, startDate, endDate); |
| | | |
| | | DtLocVo dtLocVo = DtLocVo.builder() |
| | | .locDate("2025-10-22") |
| | | .idleNum(208) |
| | | .build(); |
| | | DtLocVo dtLocVo2 = DtLocVo.builder() |
| | | .locDate("2025-10-23") |
| | | .idleNum(177) |
| | | .build(); |
| | | List<DtLocVo> locVoList = new ArrayList<>(); |
| | | locVoList.add(dtLocVo); |
| | | locVoList.add(dtLocVo2); |
| | | // DtLocVo dtLocVo = DtLocVo.builder() |
| | | // .locDate("2025-10-22") |
| | | // .idleNum(208) |
| | | // .build(); |
| | | // DtLocVo dtLocVo2 = DtLocVo.builder() |
| | | // .locDate("2025-10-23") |
| | | // .idleNum(177) |
| | | // .build(); |
| | | // List<DtLocVo> locVoList = new ArrayList<>(); |
| | | // locVoList.add(dtLocVo); |
| | | // locVoList.add(dtLocVo2); |
| | | |
| | | return R.ok().add(locVoList); |
| | | } |
| | |
| | | @RequestParam(required = false) String startDate, |
| | | @RequestParam(required = false) String endDate){ |
| | | |
| | | // digitalTwinService.inAndOutBound(areaId, startDate, endDate); |
| | | List<DtInAndOutBoundVo> inAndOutBoundVoList = digitalTwinService.inAndOutBound(areaId, startDate, endDate); |
| | | |
| | | DtInAndOutBoundVo dtInAndOutBoundVo = DtInAndOutBoundVo.builder() |
| | | .boundDate("2025-10-22") |
| | | .inBoundNum(237) |
| | | .outBoundNum(487) |
| | | .build(); |
| | | DtInAndOutBoundVo dtInAndOutBoundVo2 = DtInAndOutBoundVo.builder() |
| | | .boundDate("2025-10-23") |
| | | .inBoundNum(187) |
| | | .outBoundNum(287) |
| | | .build(); |
| | | List<DtInAndOutBoundVo> inAndOutBoundVoList = new ArrayList<>(); |
| | | inAndOutBoundVoList.add(dtInAndOutBoundVo); |
| | | inAndOutBoundVoList.add(dtInAndOutBoundVo2); |
| | | // DtInAndOutBoundVo dtInAndOutBoundVo = DtInAndOutBoundVo.builder() |
| | | // .boundDate("2025-10-22") |
| | | // .inBoundNum(237) |
| | | // .outBoundNum(487) |
| | | // .build(); |
| | | // DtInAndOutBoundVo dtInAndOutBoundVo2 = DtInAndOutBoundVo.builder() |
| | | // .boundDate("2025-10-23") |
| | | // .inBoundNum(187) |
| | | // .outBoundNum(287) |
| | | // .build(); |
| | | // List<DtInAndOutBoundVo> inAndOutBoundVoList = new ArrayList<>(); |
| | | // inAndOutBoundVoList.add(dtInAndOutBoundVo); |
| | | // inAndOutBoundVoList.add(dtInAndOutBoundVo2); |
| | | |
| | | return R.ok().add(inAndOutBoundVoList); |
| | | } |
| | |
| | | @RequestParam(required = false) Integer pageIndex, |
| | | @RequestParam(required = false) Integer pageSize){ |
| | | |
| | | // digitalTwinService.recentDetainMat(areaId, overDayNum, pageIndex, pageSize); |
| | | List<DtDetainMatVo> detainMatVoList = digitalTwinService.recentDetainMat(areaId, overDayNum, pageIndex, pageSize); |
| | | |
| | | DtDetainMatVo dtDetainMatVo = DtDetainMatVo.builder() |
| | | .belongAreaId("A1") |
| | | .belongAreaName("刀具库") |
| | | .matId("mat10001") |
| | | .matName("道具把") |
| | | .lokId("loc1001") |
| | | .lokName("库位10001") |
| | | .detainTime(765) |
| | | .inBoundTime("2025-10-11T11:15:16") |
| | | .build(); |
| | | DtDetainMatVo dtDetainMatVo2 = DtDetainMatVo.builder() |
| | | .belongAreaId("A1") |
| | | .belongAreaName("刀具库") |
| | | .matId("mat10002") |
| | | .matName("道具把") |
| | | .lokId("loc1002") |
| | | .lokName("库位10002") |
| | | .detainTime(665) |
| | | .inBoundTime("2025-10-10T11:15:16") |
| | | .build(); |
| | | List<DtDetainMatVo> detainMatVoList = new ArrayList<>(); |
| | | detainMatVoList.add(dtDetainMatVo); |
| | | detainMatVoList.add(dtDetainMatVo2); |
| | | // DtDetainMatVo dtDetainMatVo = DtDetainMatVo.builder() |
| | | // .belongAreaId("A1") |
| | | // .belongAreaName("刀具库") |
| | | // .matId("mat10001") |
| | | // .matName("道具把") |
| | | // .lokId("loc1001") |
| | | // .lokName("库位10001") |
| | | // .detainTime(765) |
| | | // .inBoundTime("2025-10-11T11:15:16") |
| | | // .build(); |
| | | // DtDetainMatVo dtDetainMatVo2 = DtDetainMatVo.builder() |
| | | // .belongAreaId("A1") |
| | | // .belongAreaName("刀具库") |
| | | // .matId("mat10002") |
| | | // .matName("道具把") |
| | | // .lokId("loc1002") |
| | | // .lokName("库位10002") |
| | | // .detainTime(665) |
| | | // .inBoundTime("2025-10-10T11:15:16") |
| | | // .build(); |
| | | // List<DtDetainMatVo> detainMatVoList = new ArrayList<>(); |
| | | // detainMatVoList.add(dtDetainMatVo); |
| | | // detainMatVoList.add(dtDetainMatVo2); |
| | | |
| | | return R.ok().add(detainMatVoList); |
| | | } |
| | |
| | | // @ManagerAuth |
| | | public R equipment(@RequestParam(required = false) String areaId){ |
| | | |
| | | DtEquipmentVo dtDetainMatVo = DtEquipmentVo.builder() |
| | | .equipmentId("eq1001") |
| | | .equipmentName("堆垛机1") |
| | | .equipmentType(1) |
| | | .belongAreaId("A1") |
| | | .belongAreaName("刀具库") |
| | | .verticalSpeed(288) |
| | | .horizontalSpeed(203) |
| | | .voltage(48) |
| | | .status(1) |
| | | .operateMethod(1) |
| | | .build(); |
| | | DtEquipmentVo dtDetainMatVo2 = DtEquipmentVo.builder() |
| | | .equipmentId("eq1002") |
| | | .equipmentName("堆垛机2") |
| | | .equipmentType(1) |
| | | .belongAreaId("A1") |
| | | .belongAreaName("刀具库") |
| | | .verticalSpeed(208) |
| | | .horizontalSpeed(253) |
| | | .voltage(48) |
| | | .status(1) |
| | | .operateMethod(1) |
| | | .build(); |
| | | List<DtEquipmentVo> dtEquipmentVoList = new ArrayList<>(); |
| | | dtEquipmentVoList.add(dtDetainMatVo); |
| | | dtEquipmentVoList.add(dtDetainMatVo2); |
| | | return R.ok(digitalTwinService.equipment(areaId)); |
| | | // DtEquipmentVo dtDetainMatVo = DtEquipmentVo.builder() |
| | | // .equipmentId("eq1001") |
| | | // .equipmentName("堆垛机1") |
| | | // .equipmentType(1) |
| | | // .belongAreaId("A1") |
| | | // .belongAreaName("刀具库") |
| | | // .verticalSpeed(288) |
| | | // .horizontalSpeed(203) |
| | | // .voltage(48) |
| | | // .status(1) |
| | | // .operateMethod(1) |
| | | // .build(); |
| | | // DtEquipmentVo dtDetainMatVo2 = DtEquipmentVo.builder() |
| | | // .equipmentId("eq1002") |
| | | // .equipmentName("堆垛机2") |
| | | // .equipmentType(1) |
| | | // .belongAreaId("A1") |
| | | // .belongAreaName("刀具库") |
| | | // .verticalSpeed(208) |
| | | // .horizontalSpeed(253) |
| | | // .voltage(48) |
| | | // .status(1) |
| | | // .operateMethod(1) |
| | | // .build(); |
| | | // List<DtEquipmentVo> dtEquipmentVoList = new ArrayList<>(); |
| | | // dtEquipmentVoList.add(dtDetainMatVo); |
| | | // dtEquipmentVoList.add(dtDetainMatVo2); |
| | | // |
| | | // return R.ok().add(dtEquipmentVoList); |
| | | } |
| | | |
| | | return R.ok().add(dtEquipmentVoList); |
| | | /** |
| | | * 库位和库存详情,数字孪生用 |
| | | * |
| | | * @param areaId |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/warehouseDetail2") |
| | | // @ManagerAuth |
| | | public R warehouseDetail2(@RequestParam(required = false) String areaId) { |
| | | |
| | | return R.ok(digitalTwinService.warehouseDetail2(areaId)); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | // 下发运输任务,mes调用下刀06(呼叫agv搬运) |
| | | @PostMapping("/api/mes/submitTask") |
| | | public JSONObject submitTask(@RequestBody TransTask param){ |
| | | @AppAuth(memo = "下刀(退刀)") |
| | | public JSONObject submitTask(@RequestHeader(required = false) String appkey,@RequestBody TransTask param,HttpServletRequest request){ |
| | | auth(appkey, param, request); |
| | | log.info("下刀(退刀):{}",JSONObject.toJSONString(param)); |
| | | // 终点为空,计算接驳位 |
| | | BasStation basStation = null; |
| | |
| | | @RequestMapping("/pda/WarehouseOutPickMerge/v1") |
| | | @ManagerAuth(memo = "拣料途中并板") |
| | | public R WarehouseOutPickMergeV1(@RequestBody WarehouseOutPickMergeParam param) { |
| | | if (Cools.isEmpty(param,param.getLocNo(),param.getBarcode(),param.getCombMats())) { |
| | | if (Cools.isEmpty(param,param.getBarcode(),param.getCombMats())) { |
| | | return R.parse("参数不能为空!"); |
| | | } |
| | | return mobileService.WarehouseOutPickMergeV1(param, getHostId(), getUserId()); |
| | | return mobileService.WarehouseOutPickMergeV1(param, getUserId()); |
| | | } |
| | | |
| | | @RequestMapping("/pick/in") |
| | |
| | | return R.ok("工作档已取消"); |
| | | } else if (type == 3) { |
| | | taskService.pickWrkMast(workNo, getUserId()); |
| | | return R.ok("工作档已拣料"); |
| | | return R.ok("工作档已转换"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(TaskLog.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} else { |
| | | wrapper.orderBy("modi_time", false); |
| | | } |
| | | return R.ok(taskLogService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @RequestMapping("/full/store/put/start") |
| | | @ManagerAuth(memo = "全板入库") |
| | | @ManagerAuth(memo = "WEB组托") |
| | | public R fullStorePutStart(@RequestBody FullStoreParam fullStoreParam) { |
| | | try { |
| | | String locNo = workService.startupFullPutStore(fullStoreParam, getUserId()); |
| | | return R.ok("入库启动成功").add(locNo); |
| | | } catch (Exception e){ |
| | | return R.error("入库启动失败==>"+e.getMessage()); |
| | | } |
| | | workService.webComb(fullStoreParam,getUserId()); |
| | | return R.ok("组托成功"); |
| | | // try { |
| | | // String locNo = workService.startupFullPutStore(fullStoreParam, getUserId()); |
| | | // return R.ok("入库启动成功").add(locNo); |
| | | // } catch (Exception e){ |
| | | // return R.error("入库启动失败==>"+e.getMessage()); |
| | | // } |
| | | } |
| | | |
| | | @RequestMapping("/plate/out/start") |
| | |
| | | @TableField("take_none") |
| | | private String takeNone; |
| | | |
| | | /** |
| | | * 外部任务编号 |
| | | */ |
| | | @ApiModelProperty(value= "外部任务编号") |
| | | @TableField("task_no") |
| | | private String taskNo; |
| | | |
| | | |
| | | public WrkMastLog() { |
| | | } |
| | | |
| | |
| | | |
| | | // 数字孪生:呆滞品信息 |
| | | @Data |
| | | @Builder |
| | | public class DtDetainMatVo { |
| | | |
| | | // 归属库区ID |
| | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @Builder |
| | | |
| | | public class DtEquipmentVo { |
| | | |
| | | // 设备ID |
| | |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | // 数字孪生:按天出入库数量 |
| | | @Data |
| | | @Builder |
| | | //@Builder |
| | | public class DtInAndOutBoundVo { |
| | | |
| | | // 日期 |
| | | private String boundDate; |
| | | // 入库数量 |
| | | private Integer inBoundNum; |
| | | private BigDecimal inBoundNum; |
| | | // 出库数量 |
| | | private Integer outBoundNum; |
| | | } |
| | | private BigDecimal outBoundNum; |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.entity.digitaltwin; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class DtLocDetailDto { |
| | | // 库位号 |
| | | private String locNo; |
| | | // 库位状态,O空库位(英文不是数字);F 在库;D 空板;P 出库中;R 出库预约;S 入库预约;其他 其他; |
| | | private String locSts; |
| | | } |
| | |
| | | // 层 |
| | | private Integer lev1; |
| | | |
| | | // 库位信息 |
| | | private LocMast locMast; |
| | | // 库存信息 |
| | | private List<StockDetl> locDetl; |
| | | private LocDetl locDetl; |
| | | |
| | | // 库存信息 |
| | | private List<StockDetl> locDetls; |
| | | |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | |
| | | |
| | | List<Double> overview(@Param("areaId")String areaId); |
| | | |
| | | List<DtOrderVo> recentOrder(@Param("startTime")String startTime, @Param("endTime")String endTime); |
| | | List<DtOrderVo> recentOrder(@Param("startTime") Date startTime, @Param("endTime")Date endTime); |
| | | |
| | | List<DtInAndOutBoundVo> recentInBound(@Param("areaId")String areaId, @Param("startTime")String startTime, @Param("endTime")String endTime); |
| | | List<DtInAndOutBoundVo> recentInBound(@Param("areaId")String areaId, @Param("startTime")Date startTime, @Param("endTime")Date endTime); |
| | | |
| | | List<DtInAndOutBoundVo> recentOutBound(@Param("areaId")String areaId, @Param("startTime")String startTime, @Param("endTime")String endTime); |
| | | List<DtInAndOutBoundVo> recentOutBound(@Param("areaId")String areaId, @Param("startTime")Date startTime, @Param("endTime")Date endTime); |
| | | |
| | | List<DtDetainMatVo> recentDetainMat(@Param("areaId")String areaId, @Param("startTime")String startTime, |
| | | List<DtDetainMatVo> recentDetainMat(@Param("areaId")String areaId, @Param("startTime")Date startTime, |
| | | @Param("pageIndex")Integer pageIndex, @Param("pageSize")Integer pageSize); |
| | | } |
| | |
| | | * @param areaId |
| | | * @return |
| | | */ |
| | | List<DtLocDetailVo> warehouseDetail2(String areaId); |
| | | |
| | | R warehouseDetail(String areaId); |
| | | |
| | | /** |
| | |
| | | * |
| | | */ |
| | | void locNumCount(); |
| | | |
| | | DtEquipmentVo equipment(String areaId); |
| | | } |
| | |
| | | /** |
| | | * 拣料途中并板 |
| | | */ |
| | | R WarehouseOutPickMergeV1(WarehouseOutPickMergeParam param, Long hostId, Long userId); |
| | | R WarehouseOutPickMergeV1(WarehouseOutPickMergeParam param, Long userId); |
| | | |
| | | /** |
| | | * 并板入库 |
| | |
| | | void startupFullTakeStore(StockOutParam param, Long userId); |
| | | |
| | | /** |
| | | * web端组托 |
| | | * @param fullStoreParam |
| | | * @param userId |
| | | */ |
| | | void webComb(FullStoreParam fullStoreParam, Long userId); |
| | | |
| | | /** |
| | | * 客户转换 |
| | | */ |
| | | void turnOverOut(EmptyPlateOutParam param, Long userId); |
| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.BasCrnp; |
| | | import com.zy.asrs.entity.LocCount; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.LocMast; |
| | |
| | | import com.zy.asrs.entity.mes.StockDetl; |
| | | import com.zy.asrs.mapper.DigitalTwinMapper; |
| | | import com.zy.asrs.mapper.LocCountMapper; |
| | | import com.zy.asrs.service.BasCrnpService; |
| | | import com.zy.asrs.service.DigitalTwinService; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Calendar; |
| | |
| | | */ |
| | | public List<DtOrderVo> order(String startDate, String endDate) { |
| | | |
| | | String startTime; |
| | | String endTime; |
| | | Date startTime = new Date(); |
| | | Date endTime = new Date(); |
| | | if (startDate == null || endDate == null || startDate.isEmpty() || endDate.isEmpty()){ |
| | | Date now = new Date(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(now); |
| | | calendar.add(Calendar.DAY_OF_MONTH, -7); |
| | | Date start = calendar.getTime(); |
| | | startTime = calendar.getTime(); |
| | | endTime = now; |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); |
| | | endDate = sdf.format(now); |
| | | startDate = sdf.format(start); |
| | | } else { |
| | | SimpleDateFormat sdf = |
| | | new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); |
| | | |
| | | try { |
| | | startTime = sdf.parse(startDate); |
| | | endTime = sdf.parse(endDate); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | startTime = startDate.substring(0, 4) + "-" + startDate.substring(4, 6) + "-" + startDate.substring(6, 8) + "00:00:00"; |
| | | endTime = endDate.substring(0, 4) + "-" + endDate.substring(4, 6) + "-" + endDate.substring(6, 8) + "00:00:00"; |
| | | List<DtOrderVo> dbOrder = digitalTwinMapper.recentOrder(startTime, endTime); |
| | | // 空日期补全 |
| | | |
| | | for (DtOrderVo dtOrderVo : dbOrder) { |
| | | dtOrderVo.setOrderDate(dtOrderVo.getOrderDate()); |
| | | } |
| | | |
| | | return dbOrder; |
| | | } |
| | |
| | | */ |
| | | public List<DtInAndOutBoundVo> inAndOutBound(String areaId, String startDate, String endDate) { |
| | | |
| | | List<DtInAndOutBoundVo> dtInAndOutBoundVos = new ArrayList<>(); |
| | | |
| | | String startTime; |
| | | String endTime; |
| | | Date startTime = new Date(); |
| | | Date endTime = new Date(); |
| | | if (startDate == null || endDate == null || startDate.isEmpty() || endDate.isEmpty()){ |
| | | Date now = new Date(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(now); |
| | | calendar.add(Calendar.DAY_OF_MONTH, -7); |
| | | Date start = calendar.getTime(); |
| | | startTime = calendar.getTime(); |
| | | endTime = now; |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); |
| | | endDate = sdf.format(now); |
| | | startDate = sdf.format(start); |
| | | } else { |
| | | SimpleDateFormat sdf = |
| | | new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); |
| | | |
| | | try { |
| | | startTime = sdf.parse(startDate); |
| | | endTime = sdf.parse(endDate); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | startTime = startDate.substring(0, 4) + "-" + startDate.substring(4, 6) + "-" + startDate.substring(6, 8) + "00:00:00"; |
| | | endTime = endDate.substring(0, 4) + "-" + endDate.substring(4, 6) + "-" + endDate.substring(6, 8) + "00:00:00"; |
| | | |
| | | List<DtInAndOutBoundVo> dtInBoundVos = digitalTwinMapper.recentInBound(areaId, startTime, endTime); |
| | | List<DtInAndOutBoundVo> dtOutBoundVos = digitalTwinMapper.recentOutBound(areaId, startTime, endTime); |
| | | |
| | | // 格式整理 |
| | | List<DtInAndOutBoundVo> dtInAndOutBoundVos = new ArrayList<>(dtInBoundVos); |
| | | dtInAndOutBoundVos.addAll(dtOutBoundVos); |
| | | |
| | | return dtInAndOutBoundVos; |
| | | } |
| | |
| | | calendar.setTime(now); |
| | | calendar.add(Calendar.DAY_OF_MONTH, -overDayNum); |
| | | Date start = calendar.getTime(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String startTime = sdf.format(start); |
| | | // SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | // Date startTime = sdf.parse(start); |
| | | |
| | | List<DtDetainMatVo> dbDetainMats = digitalTwinMapper.recentDetainMat(areaId, startTime, pageIndex, pageSize); |
| | | |
| | | return dbDetainMats; |
| | | return digitalTwinMapper.recentDetainMat(areaId, start, pageIndex, pageSize); |
| | | } |
| | | |
| | | @Resource |
| | |
| | | * @param areaId |
| | | * @return |
| | | */ |
| | | public List<DtLocDetailVo> warehouseDetail2(String areaId) { |
| | | List<LocMast> locMastList = locMastService.selectList(new EntityWrapper<>()); |
| | | return locMastList.stream() |
| | | .map(loc -> { |
| | | DtLocDetailVo vo = new DtLocDetailVo(); |
| | | BeanUtils.copyProperties(loc, vo); |
| | | return vo; |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | |
| | | /** |
| | | * 查询库存和库位详细信息 |
| | | * |
| | | * @param areaId |
| | | * @return |
| | | */ |
| | | public R warehouseDetail(String areaId) { |
| | | List<LocDetl> locDetls; |
| | | locDetls = locDetlService.selectList(new EntityWrapper<>()); |
| | | List<DtLocDetailVo> locDetailVos = new ArrayList<>(); |
| | | |
| | | List<String> locNoList = locDetls.stream().map(LocDetl::getLocNo).distinct().collect(Collectors.toList()); |
| | | List<DtLocDetailVo> dtLocDetailVoList = new ArrayList<>(); |
| | | for (String locNo: locNoList) { |
| | | |
| | | LocMast locMast = locMastService.selectById(locNo); |
| | | List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("loc_sts","F")); |
| | | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<>()); |
| | | for (LocMast locMast : locMasts) { |
| | | DtLocDetailVo dtLocDetailVo = new DtLocDetailVo(); |
| | | dtLocDetailVo.setLocNo(locNo); |
| | | dtLocDetailVo.setLocMast(locMast); |
| | | dtLocDetailVo.setLocNo(locMast.getLocNo()); |
| | | dtLocDetailVo.setLocSts(locMast.getLocSts()); |
| | | dtLocDetailVo.setRow1(locMast.getRow1()); |
| | | dtLocDetailVo.setBay1(locMast.getBay1()); |
| | | dtLocDetailVo.setLev1(locMast.getLev1()); |
| | | |
| | | List<LocDetl> locDetlList2 = locDetls.parallelStream().filter(o-> o.getLocNo().equals(locNo)).collect(Collectors.toList()); |
| | | List<StockDetl> stockDetls = new ArrayList<>(); |
| | | for(LocDetl locDetl:locDetlList2) { |
| | | StockDetl stockDetl = new StockDetl(); |
| | | stockDetl.setMatnr(locDetl.getMatnr()); |
| | | stockDetl.setMaktx(locDetl.getMaktx()); |
| | | stockDetl.setAnfme(locDetl.getAnfme()); |
| | | stockDetls.add(stockDetl); |
| | | for (LocDetl locDetl : locDetls) { |
| | | List<LocDetl> locDetl1 = locDetls.parallelStream().filter(a -> a.getLocNo().equals(locDetl.getLocNo())).collect(Collectors.toList()); |
| | | if (locDetl1.size() == 1) { |
| | | dtLocDetailVo.setLocDetl(locDetl1.get(0)); |
| | | // dtLocDetailVo.setAreaId(locDetl.getAreaId()); |
| | | // dtLocDetailVo.setAreaName(locDetl.getAreaName()); |
| | | } |
| | | } |
| | | dtLocDetailVo.setLocDetl(stockDetls); |
| | | dtLocDetailVoList.add(dtLocDetailVo); |
| | | locDetailVos.add(dtLocDetailVo); |
| | | } |
| | | |
| | | return R.ok(dtLocDetailVoList); |
| | | return R.ok(locDetailVos); |
| | | // List<DtLocDetailVo> locDetailVos = new ArrayList<>(); |
| | | // |
| | | // List<LocMast> locMasts = new ArrayList<>(); |
| | | // List<LocDetl> locDetls = new ArrayList<>(); |
| | | // |
| | | // for (LocMast locMast : locMasts) { |
| | | // DtLocDetailVo dtLocDetailVo = new DtLocDetailVo(); |
| | | // dtLocDetailVo.setLocMast(locMast); |
| | | // dtLocDetailVo.setLocNo(locMast.getLocNo()); |
| | | // dtLocDetailVo.setLocSts(locMast.getLocSts()); |
| | | // dtLocDetailVo.setRow1(locMast.getRow1()); |
| | | // dtLocDetailVo.setBay1(locMast.getBay1()); |
| | | // dtLocDetailVo.setLev1(locMast.getLev1()); |
| | | // for (LocDetl locDetl : locDetls) { |
| | | // List<LocDetl> locDetl1 = locDetls.parallelStream().filter(a -> a.getLocNo().equals(locDetl.getLocNo())).collect(Collectors.toList()); |
| | | // if (locDetl1 != null && locDetl1.size() == 1) { |
| | | // dtLocDetailVo.setLocDetl(locDetl1.get(0)); |
| | | // dtLocDetailVo.setAreaId(locDetl.getAreaId()); |
| | | // dtLocDetailVo.setAreaName(locDetl.getAreaName()); |
| | | // } |
| | | // } |
| | | // locDetailVos.add(dtLocDetailVo); |
| | | // } |
| | | // |
| | | // return locDetailVos; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | List<LocCount> locCounts; |
| | | if(areaId.isEmpty()){ |
| | | // if(areaId.isEmpty()){ |
| | | locCounts = locCountMapper.getByDate(Integer.parseInt(startDate), Integer.parseInt(endDate)); |
| | | } else { |
| | | locCounts = locCountMapper.getByAreaAndDate(areaId, Integer.parseInt(startDate), Integer.parseInt(endDate)); |
| | | } |
| | | // } else { |
| | | // locCounts = locCountMapper.getByAreaAndDate(areaId, Integer.parseInt(startDate), Integer.parseInt(endDate)); |
| | | // } |
| | | |
| | | for (LocCount locCount : locCounts) { |
| | | String date = locCount.getDate().toString(); |
| | |
| | | * 定期统计剩余库存 |
| | | * |
| | | */ |
| | | @Transactional |
| | | public void locNumCount() { |
| | | |
| | | List<LocCount> result = new ArrayList<>(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); |
| | | String date = sdf.format(new Date()); |
| | | |
| | | List<LocCount> totalLoc = locCountMapper.totalLoc(); |
| | | List<LocCount> useLoc = locCountMapper.useLoc(); |
| | | for (LocCount locCount : totalLoc) { |
| | | LocCount locCount1 = new LocCount(); |
| | | locCount1.setDate(Integer.valueOf(date)); |
| | | locCount1.setAreaId(locCount.getAreaId()); |
| | | locCount1.setLocNum(locCount1.getLocNum()); |
| | | for (LocCount locCount2 : useLoc) { |
| | | if(locCount1.getAreaId().equals(locCount2.getAreaId())){ |
| | | locCount1.setRemainNum(locCount1.getLocNum() - locCount2.getLocNum()); |
| | | } |
| | | } |
| | | result.add(locCount1); |
| | | } |
| | | |
| | | for (LocCount locCount : result) { |
| | | locCountMapper.insertOrUpdate(locCount); |
| | | } |
| | | LocCount locCount1 = new LocCount(); |
| | | locCount1.setDate(Integer.valueOf(date)); |
| | | locCount1.setLocNum(totalLoc.get(0).getLocNum()); |
| | | locCount1.setRemainNum(locCount1.getLocNum() - useLoc.get(0).getLocNum()); |
| | | |
| | | locCountMapper.insertOrUpdate(locCount1); |
| | | } |
| | | |
| | | @Resource |
| | | private BasCrnpService basCrnpService; |
| | | |
| | | @Override |
| | | public DtEquipmentVo equipment(String areaId) { |
| | | return new DtEquipmentVo(); |
| | | // BasCrnp crnp = basCrnpService.selectOne(new EntityWrapper<>()); |
| | | // return DtEquipmentVo.builder() |
| | | // .equipmentId("1").equipmentName("堆垛机1").equipmentType(1) |
| | | // .belongAreaId("A").belongAreaName("加工库").verticalSpeed(Integer.valueOf(crnp.getCtlHp())) |
| | | // .horizontalSpeed(Integer.valueOf(crnp.getCtlRest())).voltage(220).status(crnp.getCrnErr() == 0 ? 1 : 3).operateMethod(crnp.getCrnSts() == 3 ? 1 : 3).build(); |
| | | } |
| | | |
| | | |
| | |
| | | // 下发给RCS |
| | | RcsTaskSubmit rcsTaskSubmit = new RcsTaskSubmit(); |
| | | // 模板名 |
| | | if(transTask.getCurStationId().startsWith("LL") || transTask.getCurStationId().startsWith("LG")) { // 起点产线 |
| | | if(transTask.getCurStationId().startsWith("LL") || transTask.getCurStationId().startsWith("LJ")|| transTask.getCurStationId().startsWith("LG") || transTask.getCurStationId().startsWith("LT")) { // 起点产线 |
| | | rcsTaskSubmit.setTaskType("DJ1"); |
| | | } else if(transTask.getNextStationId().startsWith("LL") || transTask.getNextStationId().startsWith("LG")) { // 终点产线 |
| | | } else if(transTask.getNextStationId().startsWith("LL") || transTask.getNextStationId().startsWith("LJ")|| transTask.getNextStationId().startsWith("LG") || transTask.getNextStationId().startsWith("LT")) { // 终点产线 |
| | | rcsTaskSubmit.setTaskType("DJ2"); |
| | | } |
| | | rcsTaskSubmit.setRobotTaskCode(transTask.getTaskno()); |
| | |
| | | */ |
| | | public int applyInStation(TransParent apply) { |
| | | |
| | | String url = MES_URL + (apply.getProductLineId().equals("LL") ? "AGVTransportPalletNotice" : "Aprs/AGVTransportPalletNotice"); |
| | | String url = MES_URL + (apply.getProductLineId().equals("LL") || apply.getProductLineId().equals("LJ") ? "AGVTransportPalletNotice" : "Aprs/AGVTransportPalletNotice"); |
| | | String response = RcsServiceImpl.sendPost(url, JSONObject.toJSONString(apply)); |
| | | if (!StringUtils.isEmpty(response) && response.contains("Success")){ |
| | | MesReturn mesReturn = JSONObject.parseObject(response, MesReturn.class); |
| | |
| | | */ |
| | | public int outStation(TransParent apply) { |
| | | |
| | | String url = MES_URL + (apply.getProductLineId().equals("LL") ? "AGVDepartureCompleted" : "Aprs/AGVDepartureCompleted"); |
| | | String url = MES_URL + (apply.getProductLineId().equals("LL") || apply.getProductLineId().equals("LJ") ? "AGVDepartureCompleted" : "Aprs/AGVDepartureCompleted"); |
| | | String response = RcsServiceImpl.sendPost(url, JSONObject.toJSONString(apply)); |
| | | if (!StringUtils.isEmpty(response) && response.contains("Success")){ |
| | | MesReturn mesReturn = JSONObject.parseObject(response, MesReturn.class); |
| | |
| | | stockDetl.setAnfme(locDetl.getAnfme()); |
| | | stockDetls.add(stockDetl); |
| | | } |
| | | dtLocDetailVo.setLocDetl(stockDetls); |
| | | dtLocDetailVo.setLocDetls(stockDetls); |
| | | dtLocDetailVoList.add(dtLocDetailVo); |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | @Transactional |
| | | public R WarehouseOutPickMergeV1(WarehouseOutPickMergeParam param, Long hostId, Long userId) { |
| | | public R WarehouseOutPickMergeV1(WarehouseOutPickMergeParam param, Long userId) { |
| | | WrkMast wrkMast1 = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", param.getBarcode())); |
| | | if(wrkMast1 == null) { |
| | | return R.parse("该条码不存在任务:" + param.getBarcode()); |
| | | } else if(wrkMast1.getIoType() != 103) { |
| | | return R.parse("该任务出库类型不为拣料出库:" + wrkMast1.getIoType()); |
| | | } |
| | | //判断库位状态 |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", param.getLocNo())); |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", wrkMast1.getSourceLocNo())); |
| | | if (Cools.isEmpty(locMast)) { |
| | | return R.error("该库位不存在"); |
| | | } |
| | |
| | | wrkMast.setIoType(8); // 入出库状态:8.拣料途中并板 |
| | | wrkMast.setIoPri(13D); // 优先级 |
| | | wrkMast.setCrnNo(1); |
| | | wrkMast.setSourceStaNo(1 + ""); |
| | | wrkMast.setStaNo(1 + ""); |
| | | wrkMast.setLocNo(param.getLocNo()); |
| | | wrkMast.setSourceStaNo(104 + ""); |
| | | wrkMast.setStaNo(106 + ""); |
| | | wrkMast.setLocNo(locMast.getLocNo()); |
| | | wrkMast.setBarcode(param.getBarcode()); // 托盘码 |
| | | wrkMast.setFullPlt("Y"); // 满板:Y |
| | | wrkMast.setPicking("N"); // 拣料 |
| | |
| | | } |
| | | |
| | | int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet", param.getBarcode())); |
| | | int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet", param.getBarcode())); |
| | | // int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet", param.getBarcode())); |
| | | int countWrk = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("barcode",param.getBarcode()).ne("wrk_sts",15)); |
| | | int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode())); |
| | | if (countLoc > 0 || countWrk > 0 || countwait > 0) { |
| | | throw new CoolException("组托档/工作档/库存条码数据已存在===>>" + param.getBarcode()); |
| | |
| | | mesService.outStation(apply); |
| | | // agv继续执行 |
| | | // 源站点是产线,离站完成后给rcs反馈继续执行 |
| | | if(task.getSourceStaNo().contains("TOOL")) { |
| | | TransInOutStationAllow inOutStationAllow = new TransInOutStationAllow(); |
| | | inOutStationAllow.setTaskno(robotTaskCode); |
| | | inOutStationAllow.setStatus("Y"); |
| | | inOutStationAllow.setAgvCode(singleRobotCode); |
| | | mesService.allowOutStation(inOutStationAllow); |
| | | } |
| | | // if(task.getSourceStaNo().contains("TOOL")) { |
| | | // TransInOutStationAllow inOutStationAllow = new TransInOutStationAllow(); |
| | | // inOutStationAllow.setTaskno(robotTaskCode); |
| | | // inOutStationAllow.setStatus("Y"); |
| | | // inOutStationAllow.setAgvCode(singleRobotCode); |
| | | // mesService.allowOutStation(inOutStationAllow); |
| | | // } |
| | | } |
| | | } break; |
| | | case ARRIVE_ON_STATION: { |
| | |
| | | if(transType.equals("01") && arrivalStation.getStationID().contains("XL") || arrivalStation.getStationID().contains("TOOL")) { |
| | | path = "ToolArrivalNotice"; |
| | | } |
| | | if (arrivalStation.getStationID().startsWith("LG") || arrivalStation.getStationID().startsWith("LT")) { |
| | | path = "Aprs/" + path; |
| | | } |
| | | mesService.arriveOnStation(arrivalStation,path); |
| | | } break; |
| | | default: {} break; |
| | |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.mapper.TaskMapper; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | @Autowired |
| | | private TaskDetlLogService taskDetlLogService; |
| | | |
| | | @Resource |
| | | private BasStationService basStationService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void completeWrkMast(String workNo, Long userId) { |
| | |
| | | if (Cools.isEmpty(wrkMast)) { |
| | | throw new CoolException(workNo + "工作档不存在"); |
| | | } |
| | | if (wrkMast.getWrkSts() == 304) { |
| | | throw new CoolException("当前工作档已完成"); |
| | | Date now = new Date(); |
| | | // 终点是接驳位 只能完成305 |
| | | if (wrkMast.getStaNo().startsWith("A")) { |
| | | if(wrkMast.getWrkSts() == 305) { |
| | | throw new CoolException("当前工作档已完成"); |
| | | } |
| | | wrkMast.setWrkSts(305L); |
| | | // 绑定站点 |
| | | BasStation basStation = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", wrkMast.getStaNo())); |
| | | if (basStation.getBarcode().equals(wrkMast.getBarcode())) { |
| | | basStation.setLocSts("F"); |
| | | basStation.setModiTime(now); |
| | | basStation.setModiUser(userId); |
| | | basStationService.updateById(basStation); |
| | | } |
| | | } else { |
| | | // 起点是接驳位 只能完成304 |
| | | if (wrkMast.getWrkSts() == 304) { |
| | | throw new CoolException("当前工作档已完成"); |
| | | } |
| | | wrkMast.setWrkSts(304L); |
| | | // 解绑站点 |
| | | BasStation basStation = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", wrkMast.getSourceStaNo())); |
| | | if (basStation.getBarcode().equals(wrkMast.getBarcode())) { |
| | | basStation.setLocSts("O"); |
| | | basStation.setModiTime(now); |
| | | basStation.setModiUser(userId); |
| | | basStationService.updateById(basStation); |
| | | } |
| | | } |
| | | |
| | | wrkMast.setWrkSts(304L); |
| | | |
| | | Date now = new Date(); |
| | | wrkMast.setCrnStrTime(DateUtils.calculate(now, 1L, TimeUnit.SECONDS, true)); |
| | | wrkMast.setCrnEndTime(now); |
| | | wrkMast.setModiTime(now); |
| | |
| | | } |
| | | } |
| | | |
| | | @Resource |
| | | private MobileService mobileService; |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void pickWrkMast(String workNo, Long userId) { |
| | | Task wrkMast = this.selectById(workNo); |
| | | Task wrkMast = this.selectOne(new EntityWrapper<Task>().eq("wrk_no", workNo)); |
| | | if (Cools.isEmpty(wrkMast)) { |
| | | throw new CoolException(workNo + "工作档不存在"); |
| | | } |
| | | // 入出库类型判断 |
| | | if (wrkMast.getIoType() != 103 && wrkMast.getIoType() != 104 && wrkMast.getIoType() != 107) { |
| | | throw new CoolException("当前入出库类型无法进行操作"); |
| | | R r = mobileService.djReturn(wrkMast.getBarcode()); |
| | | if(!r.get("code").equals(200)) { |
| | | throw new CoolException(""+r.get("msg")); |
| | | } |
| | | // 工作状态判断 |
| | | if (wrkMast.getWrkSts() < 11 || wrkMast.getWrkSts() == 15) { |
| | | throw new CoolException("当前工作状态无法进行操作"); |
| | | } |
| | | // 保存工作明细档历史档 |
| | | // if (!wrkDetlLogService.save(wrkMast.getWrkNo())) { |
| | | // throw new CoolException("保存工作明细档历史档失败"); |
| | | // // 入出库类型判断 |
| | | // if (wrkMast.getIoType() != 103 && wrkMast.getIoType() != 104 && wrkMast.getIoType() != 107) { |
| | | // throw new CoolException("当前入出库类型无法进行操作"); |
| | | // } |
| | | // 保存工作主档历史档 |
| | | if (!taskLogService.save(wrkMast.getWrkNo())) { |
| | | throw new CoolException("保存工作主档历史档失败"); |
| | | } |
| | | // 获取目标站 |
| | | // Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>() |
| | | // .eq("type_no", wrkMast.getIoType() - 50) |
| | | // .eq("stn_no", wrkMast.getStaNo()) // 作业站点 = 拣料出库的目标站 |
| | | // .eq("crn_no", wrkMast.getCrnNo()); // 堆垛机号 |
| | | // StaDesc staDesc = staDescService.selectOne(wrapper); |
| | | // if (Cools.isEmpty(staDesc)) { |
| | | // throw new CoolException("入库路径不存在"); |
| | | // // 工作状态判断 |
| | | // if (wrkMast.getWrkSts() < 11 || wrkMast.getWrkSts() == 15) { |
| | | // throw new CoolException("当前工作状态无法进行操作"); |
| | | // } |
| | | Date now = new Date(); |
| | | // 堆垛机站点(目标站) |
| | | // Integer staNo = staDesc.getCrnStn(); |
| | | // 更新工作档数据状态 |
| | | wrkMast.setIoType(wrkMast.getIoType() - 50); // 入出库类型: 103->53,104->54,107->57 |
| | | wrkMast.setWrkSts(2L); // 工作状态: 2.设备上走 |
| | | wrkMast.setSourceStaNo(wrkMast.getStaNo()); // 源站 |
| | | // wrkMast.setStaNo(staNo + ""); // 目标站 |
| | | wrkMast.setLocNo(wrkMast.getSourceLocNo()); // 目标库位 = 出库时的源库位 |
| | | wrkMast.setSourceLocNo(""); // 源库位清空 |
| | | wrkMast.setModiTime(now); |
| | | wrkMast.setModiUser(userId); |
| | | if (!this.updateById(wrkMast)) { |
| | | throw new CoolException("更新工作档数据状态失败"); |
| | | } |
| | | // 修改库位状态 Q.拣料/盘点/并板再入库 |
| | | LocCache locMast = locCacheService.selectOne(new EntityWrapper<LocCache>().eq("loc_no", wrkMast.getLocNo())); |
| | | locMast.setLocSts("Q"); |
| | | locMast.setModiTime(now); |
| | | locMast.setModiUser(userId); |
| | | if (!locCacheService.updateById(locMast)) { |
| | | throw new CoolException("修改库位状态失败"); |
| | | } |
| | | // // 保存工作明细档历史档 |
| | | //// if (!wrkDetlLogService.save(wrkMast.getWrkNo())) { |
| | | //// throw new CoolException("保存工作明细档历史档失败"); |
| | | //// } |
| | | // // 保存工作主档历史档 |
| | | // if (!taskLogService.save(wrkMast.getWrkNo())) { |
| | | // throw new CoolException("保存工作主档历史档失败"); |
| | | // } |
| | | // // 获取目标站 |
| | | //// Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>() |
| | | //// .eq("type_no", wrkMast.getIoType() - 50) |
| | | //// .eq("stn_no", wrkMast.getStaNo()) // 作业站点 = 拣料出库的目标站 |
| | | //// .eq("crn_no", wrkMast.getCrnNo()); // 堆垛机号 |
| | | //// StaDesc staDesc = staDescService.selectOne(wrapper); |
| | | //// if (Cools.isEmpty(staDesc)) { |
| | | //// throw new CoolException("入库路径不存在"); |
| | | //// } |
| | | // Date now = new Date(); |
| | | // // 堆垛机站点(目标站) |
| | | //// Integer staNo = staDesc.getCrnStn(); |
| | | // // 更新工作档数据状态 |
| | | // wrkMast.setIoType(wrkMast.getIoType() - 50); // 入出库类型: 103->53,104->54,107->57 |
| | | // wrkMast.setWrkSts(2L); // 工作状态: 2.设备上走 |
| | | // wrkMast.setSourceStaNo(wrkMast.getStaNo()); // 源站 |
| | | //// wrkMast.setStaNo(staNo + ""); // 目标站 |
| | | // wrkMast.setLocNo(wrkMast.getSourceLocNo()); // 目标库位 = 出库时的源库位 |
| | | // wrkMast.setSourceLocNo(""); // 源库位清空 |
| | | // wrkMast.setModiTime(now); |
| | | // wrkMast.setModiUser(userId); |
| | | // if (!this.updateById(wrkMast)) { |
| | | // throw new CoolException("更新工作档数据状态失败"); |
| | | // } |
| | | // // 修改库位状态 Q.拣料/盘点/并板再入库 |
| | | // LocCache locMast = locCacheService.selectOne(new EntityWrapper<LocCache>().eq("loc_no", wrkMast.getLocNo())); |
| | | // locMast.setLocSts("Q"); |
| | | // locMast.setModiTime(now); |
| | | // locMast.setModiUser(userId); |
| | | // if (!locCacheService.updateById(locMast)) { |
| | | // throw new CoolException("修改库位状态失败"); |
| | | // } |
| | | } |
| | | |
| | | @Override |
| | |
| | | if (Cools.isEmpty(wrkMast)) { |
| | | throw new CoolException(workNo + "工作档不存在"); |
| | | } |
| | | if(wrkMast.getWrkSts() >= 304) { |
| | | throw new CoolException("工作状态已经完成:" + wrkMast.getWrkSts()); |
| | | // 终点是接驳位 |
| | | if (wrkMast.getStaNo().startsWith("A")) { |
| | | // if(wrkMast.getWrkSts() == 305) { |
| | | // throw new CoolException("当前工作档已完成"); |
| | | // } |
| | | // 解绑站点 |
| | | BasStation basStation = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", wrkMast.getStaNo())); |
| | | if (basStation.getBarcode().equals(wrkMast.getBarcode())) { |
| | | basStation.setLocSts("O"); |
| | | basStation.setBarcode(""); |
| | | basStation.setModiTime(now); |
| | | basStation.setModiUser(userId); |
| | | basStationService.updateById(basStation); |
| | | } |
| | | |
| | | } else { |
| | | // 起点是接驳位 只能完成304 |
| | | if (wrkMast.getWrkSts() == 304) { |
| | | throw new CoolException("当前工作档已完成"); |
| | | } |
| | | // 解绑站点 |
| | | BasStation basStation = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", wrkMast.getSourceStaNo())); |
| | | if (basStation.getBarcode().equals(wrkMast.getBarcode())) { |
| | | basStation.setLocSts("O"); |
| | | basStation.setBarcode(""); |
| | | basStation.setModiTime(now); |
| | | basStation.setModiUser(userId); |
| | | basStationService.updateById(basStation); |
| | | } |
| | | } |
| | | |
| | | // 取消操作人员记录 |
| | |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.common.web.WcsController; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void webComb(FullStoreParam param, Long userId) { |
| | | if (Cools.isEmpty(param.getBarcode(), param.getList())) { |
| | | throw new CoolException(BaseRes.PARAM); |
| | | } |
| | | if (param.getList().size() < 1) { |
| | | throw new CoolException("请提取一个商品,或者刷新重新组托!"); |
| | | } |
| | | // 判断是否有相同条码的数据 |
| | | if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>(). |
| | | eq("zpallet", param.getBarcode()) |
| | | .eq("io_status", "N")) > 0) { |
| | | throw new CoolException(param.getBarcode() + "数据正在进行入库"); |
| | | } |
| | | |
| | | if (param.getBarcode().length() != 8) { |
| | | throw new CoolException("条码长度不是8位===>>" + param.getBarcode()); |
| | | } |
| | | |
| | | int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet", param.getBarcode())); |
| | | int countWrk = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("barcode",param.getBarcode()).ne("wrk_sts",15)); |
| | | int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode())); |
| | | if (countLoc > 0 || countWrk > 0 || countwait > 0) { |
| | | throw new CoolException("组托档/工作档/库存条码数据已存在===>>" + param.getBarcode()); |
| | | } |
| | | |
| | | Date now = new Date(); |
| | | |
| | | List<DetlDto> detlDtos = new ArrayList<>(); |
| | | param.getList().forEach(elem -> { |
| | | DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(), |
| | | elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme()); |
| | | if (DetlDto.has(detlDtos, detlDto)) { |
| | | DetlDto one = DetlDto.findDto(detlDtos, detlDto); |
| | | assert one != null; |
| | | one.setAnfme(one.getAnfme() + detlDto.getAnfme()); |
| | | } else { |
| | | detlDtos.add(detlDto); |
| | | } |
| | | }); |
| | | |
| | | for (DetlDto detlDto : detlDtos) { |
| | | Mat mat = matService.selectByMatnr(detlDto.getMatnr()); |
| | | if (Cools.isEmpty(mat)) { |
| | | throw new CoolException(detlDto.getMatnr() + "商品档案不存在"); |
| | | } |
| | | WaitPakin waitPakin = new WaitPakin(); |
| | | BeanUtils.copyProperties(mat, waitPakin); |
| | | waitPakin.setMemo(""); |
| | | waitPakin.setBatch(detlDto.getBatch()); |
| | | waitPakin.setZpallet(param.getBarcode()); |
| | | waitPakin.setIoStatus("N"); |
| | | waitPakin.setAnfme(detlDto.getAnfme()); |
| | | waitPakin.setStatus("Y"); |
| | | waitPakin.setAppeUser(userId); |
| | | waitPakin.setAppeTime(now); |
| | | waitPakin.setModiUser(userId); |
| | | waitPakin.setModiTime(now); |
| | | if (!waitPakinService.insert(waitPakin)) { |
| | | throw new CoolException("保存入库通知档失败"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void turnOverOut(EmptyPlateOutParam param, Long userId) { |
| | | try { |
| | |
| | | WrkMastLog mastLog = new WrkMastLog(); |
| | | BeanUtils.copyProperties(mast, mastLog); |
| | | // mastLog.setLogId(mast.getId()); |
| | | |
| | | mastLog.setWrkSts(mast.getWrkSts().intValue()); |
| | | mastLog.setSourceStaNo(Integer.valueOf(mast.getSourceStaNo())); |
| | | mastLog.setStaNo(Integer.valueOf(mast.getStaNo())); |
| | | if (!wrkMastLogService.insert(mastLog)) { |
| | | throw new CoolException("任务日志保存失败!!"); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.zy.asrs.entity.OrderPakout; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.service.DigitalTwinService; |
| | | import com.zy.asrs.service.OrderPakoutService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.asrs.task.handler.JlerHandler; |
| | |
| | | } |
| | | } |
| | | |
| | | @Resource |
| | | private DigitalTwinService digitalTwinService; |
| | | |
| | | /** |
| | | * 定时统计每天剩余库存 |
| | | */ |
| | | @Scheduled(cron = "0 50 23 * * ?") |
| | | private void locNumCount() { |
| | | digitalTwinService.locNumCount(); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | User user = userService.selectById(userLogin.getUserId()); |
| | | // String deToken = Cools.deTokn(token, user.getPassword()); |
| | | // long timestamp = Long.parseLong(deToken.substring(0, 13)); |
| | | // 15分钟后过期 |
| | | if (System.currentTimeMillis() - userLogin.getCreateTime().getTime() > 900000){ |
| | | // 45分钟后过期 |
| | | if (System.currentTimeMillis() - userLogin.getCreateTime().getTime() > 2700000){ |
| | | Http.response(response, BaseRes.DENIED); |
| | | return false; |
| | | } |
| | |
| | | package com.zy.common.config; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.mes.MesReturn; |
| | |
| | | String.valueOf(mesReturn.getSuccess()).equalsIgnoreCase("1") |
| | | ); |
| | | } |
| | | if (o instanceof JSONObject) { |
| | | String appkey = request.getHeader("appkey"); |
| | | Object reqCache = request.getAttribute("cache"); |
| | | // 保存接口日志 |
| | | apiLogService.save( |
| | | String.valueOf(appAuth), |
| | | request.getRequestURI(), |
| | | appkey, |
| | | IpTools.gainRealIp(request), |
| | | reqCache==null?"": JSON.toJSONString(reqCache), |
| | | JSON.toJSONString(o), |
| | | String.valueOf(((JSONObject) o).get("Success")).equalsIgnoreCase("1") |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | return o; |
| | |
| | | if (user.getMobile()!=null) { |
| | | entity.setMobile(user.getMobile()); |
| | | } |
| | | if (user.getRoleId()!=null) { |
| | | entity.setRoleId(user.getRoleId()); |
| | | } |
| | | userService.updateById(entity); |
| | | return R.ok(); |
| | | } |
| | |
| | | |
| | | #mes对接 |
| | | mes: |
| | | url: http://172.26.11.250/dev-api/basicmodel/Api/WMS/ |
| | | url: http://192.9.100.173:8088/prod-api/basicmodel/Api/WMS/ |
| | | # url: http://172.26.11.250/dev-api/basicmodel/Api/WMS/ |
| | | #默认接口操作人员id |
| | | defaultUserId: 30 |
| | | |
| | |
| | | |
| | | #刀具管理系统对接 |
| | | dj: |
| | | url: http://172.26.11.2/ |
| | | url: http://172.26.11.2:8080/ |
| | | |
| | |
| | | </select> |
| | | |
| | | <insert id="insertOrUpdate" parameterType="com.zy.asrs.entity.LocCount"> |
| | | IF EXISTS (SELECT date FROM asr_loc_count WHERE date = #{model.date} AND area_id = #{model.areaId}) |
| | | INSERT INTO asr_loc_count(date, area_id, loc_num, remain_num) |
| | | VALUES (#{model.date}, #{model.areaId}, #{model.locNum}, #{model.remainNum}) |
| | | IF EXISTS (SELECT 1 FROM asr_loc_count WHERE date = #{model.date}) |
| | | BEGIN |
| | | UPDATE asr_loc_count |
| | | SET loc_num = #{model.locNum}, |
| | | remain_num = #{model.remainNum} |
| | | WHERE date = #{model.date} |
| | | END |
| | | ELSE |
| | | UPDATE asr_loc_count SET loc_num = #{model.locNum}, remain_num = #{model.remainNum} |
| | | BEGIN |
| | | INSERT INTO asr_loc_count(date, area_id, loc_num, remain_num) |
| | | VALUES (#{model.date}, #{model.areaId}, #{model.locNum}, #{model.remainNum}) |
| | | END |
| | | </insert> |
| | | |
| | | <select id="totalLoc" resultType="com.zy.asrs.entity.LocCount"> |
| | |
| | | <!--总览:总库位、已用库位、今日库存、今日出库、今日入库--> |
| | | <select id="overview" resultType="Double"> |
| | | SELECT COUNT(*) FROM asr_loc_mast WHERE loc_sts != 'Z' |
| | | <if test="areaId != null"> |
| | | and area_id = #{areaId} |
| | | </if> |
| | | <!-- <if test="areaId != null">--> |
| | | <!-- and area_id = #{areaId}--> |
| | | <!-- </if>--> |
| | | UNION ALL |
| | | SELECT COUNT(*) FROM asr_loc_mast WHERE loc_sts = 'F' or loc_sts = 'P' or loc_sts = 'Q' or loc_sts = 'R' or loc_sts = 'S' or loc_sts = 'X' |
| | | <if test="areaId != null"> |
| | | and area_id = #{areaId} |
| | | </if> |
| | | <!-- <if test="areaId != null">--> |
| | | <!-- and area_id = #{areaId}--> |
| | | <!-- </if>--> |
| | | UNION ALL |
| | | SELECT ISNULL(SUM(anfme), 0) FROM asr_loc_detl |
| | | <if test="areaId != null"> |
| | | WHERE area_id = #{areaId} |
| | | </if> |
| | | <!-- <if test="areaId != null">--> |
| | | <!-- WHERE area_id = #{areaId}--> |
| | | <!-- </if>--> |
| | | UNION ALL |
| | | SELECT ISNULL(SUM(anfme), 0) FROM asr_wrkin_view WHERE CONVERT(VARCHAR, io_time, 23) = CONVERT(VARCHAR, GETDATE(), 23) |
| | | <if test="areaId != null"> |
| | | and area_id = #{areaId} |
| | | </if> |
| | | <!-- <if test="areaId != null">--> |
| | | <!-- and area_id = #{areaId}--> |
| | | <!-- </if>--> |
| | | UNION ALL |
| | | SELECT ISNULL(SUM(anfme), 0) FROM asr_wrkout_view WHERE CONVERT(VARCHAR, io_time, 23) = CONVERT(VARCHAR, GETDATE(), 23) |
| | | <if test="areaId != null"> |
| | | and area_id = #{areaId} |
| | | </if> |
| | | <!-- <if test="areaId != null">--> |
| | | <!-- and area_id = #{areaId}--> |
| | | <!-- </if>--> |
| | | </select> |
| | | |
| | | <select id="recentOrder" resultType="com.zy.asrs.entity.digitaltwin.DtOrderVo"> |
| | | SELECT CONVERT(VARCHAR, order_time, 23) as orderDate, COUNT(*) AS orderNum |
| | | FROM man_order |
| | | |
| | | SELECT |
| | | FORMAT(orderDate, 'yyyyMMdd') as orderDate, |
| | | COUNT(*) as orderNum |
| | | FROM ( |
| | | SELECT |
| | | CAST(order_time AS DATE) as orderDate |
| | | FROM man_order_pakin |
| | | WHERE order_time BETWEEN #{startTime} AND #{endTime} |
| | | GROUP BY CONVERT(VARCHAR, order_time, 23) |
| | | |
| | | UNION ALL |
| | | |
| | | SELECT |
| | | CAST(order_time AS DATE) as orderDate |
| | | FROM man_order_pakout |
| | | WHERE order_time BETWEEN #{startTime} AND #{endTime} |
| | | ) combined |
| | | GROUP BY orderDate |
| | | ORDER BY orderDate |
| | | |
| | | </select> |
| | | |
| | | <select id="recentInBound" resultType="com.zy.asrs.entity.digitaltwin.DtInAndOutBoundVo"> |
| | | SELECT CONVERT(VARCHAR, io_time, 23) AS boundDate, SUM(anfme) AS inBoundNum |
| | | FROM asr_wrkin_view |
| | | WHERE io_time BETWEEN #{startTime} AND #{endTime} |
| | | <if test="areaId != null"> |
| | | and area_id = #{areaId} |
| | | </if> |
| | | <!-- <if test="areaId != null">--> |
| | | <!-- and area_id = #{areaId}--> |
| | | <!-- </if>--> |
| | | GROUP BY CONVERT(VARCHAR, io_time, 23) |
| | | </select> |
| | | |
| | |
| | | SELECT CONVERT(VARCHAR, io_time, 23) AS boundDate, SUM(anfme) AS outBoundNum |
| | | FROM asr_wrkout_view |
| | | WHERE io_time BETWEEN #{startTime} AND #{endTime} |
| | | <if test="areaId != null"> |
| | | and area_id = #{areaId} |
| | | </if> |
| | | <!-- <if test="areaId != null">--> |
| | | <!-- and area_id = #{areaId}--> |
| | | <!-- </if>--> |
| | | GROUP BY CONVERT(VARCHAR, io_time, 23) |
| | | </select> |
| | | |
| | | <select id="recentDetainMat" resultType="com.zy.asrs.entity.digitaltwin.DtDetainMatVo"> |
| | | select |
| | | * |
| | | from ( |
| | | select |
| | | ROW_NUMBER() OVER(Order by t.io_time desc) as row , * |
| | | from ( |
| | | SELECT area_id AS belongAreaId, area_name AS belongAreaName, matnr AS matId, maktx AS matName, |
| | | loc_no AS lokId, '' AS lokName, |
| | | DATEDIFF(MINUTE, appe_time, GETDATE()) AS detainTime, appe_time AS inBoundTime |
| | | FROM asr_loc_detl WHERE appe_time < #{startTime} |
| | | <if test="areaId != null"> |
| | | and area_id = #{areaId} |
| | | </if> |
| | | ) t |
| | | ) a where 1=1 and a.row between ((#{pageIndex}-1)*#{pageSize}+1) and (#{pageIndex}*#{pageSize}) |
| | | SELECT * |
| | | FROM ( |
| | | SELECT |
| | | ROW_NUMBER() OVER(ORDER BY t.inBoundTime DESC) AS rownum, |
| | | t.* |
| | | FROM ( |
| | | SELECT |
| | | matnr AS matId, |
| | | maktx AS matName, |
| | | loc_no AS lokId, |
| | | '' AS lokName, |
| | | DATEDIFF(MINUTE, appe_time, GETDATE()) AS detainTime, |
| | | appe_time AS inBoundTime |
| | | FROM asr_loc_detl |
| | | WHERE appe_time <= #{startTime} |
| | | ) t |
| | | ) a |
| | | WHERE a.rownum BETWEEN ((#{pageIndex}-1)*#{pageSize}+1) AND (#{pageIndex}*#{pageSize}) |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | ]]> |
| | | </if> |
| | | </sql> |
| | | <resultMap id="ViewInOutMap" type="com.zy.asrs.entity.ViewInOutBean"> |
| | | |
| | | <result column="ymd" property="ymd"/> |
| | | <result column="source_sta_no" property="source_sta_no"/> |
| | | |
| | | <result column="sto_qty" property="sto_qty"/> |
| | | <result column="ret_qty" property="ret_qty"/> |
| | | <result column="total_qty" property="total_qty"/> |
| | | |
| | | <!-- 查询条件字段(一般不从 SQL 返回,也写上不影响) --> |
| | | <result column="begin_date" property="begin_date"/> |
| | | <result column="end_date" property="end_date"/> |
| | | |
| | | </resultMap> |
| | | <!-- 分页查询所有信息 --> |
| | | <select id="queryViewInOutList" parameterType="com.zy.asrs.entity.ViewInOutBean" resultType="com.zy.asrs.entity.ViewInOutBean"> |
| | | <select id="queryViewInOutList" parameterType="com.zy.asrs.entity.ViewInOutBean" resultMap="ViewInOutMap"> |
| | | select * from ( |
| | | select *,ROW_NUMBER() OVER(Order by ymd desc) as rowid |
| | | from asr_sta_inout_view |
| | |
| | | ]]> |
| | | </if> |
| | | </sql> |
| | | <resultMap id="ViewStayTimeMap" type="com.zy.asrs.entity.ViewStayTimeBean"> |
| | | |
| | | <!-- 分页 / 行号 --> |
| | | <result column="row" property="row"/> |
| | | <result column="stay_time" property="stay_time"/> |
| | | |
| | | <!-- 时间条件 --> |
| | | <result column="begin_date" property="begin_date"/> |
| | | <result column="end_date" property="end_date"/> |
| | | |
| | | <!-- 基础信息 --> |
| | | <result column="loc_no" property="loc_no"/> |
| | | <result column="zpallet" property="zpallet"/> |
| | | <result column="anfme" property="anfme"/> |
| | | <result column="matnr" property="matnr"/> |
| | | <result column="maktx" property="maktx"/> |
| | | <result column="batch" property="batch"/> |
| | | |
| | | <!-- ⚠️ 特别注意这个 --> |
| | | <result column="order_no" property="orderNo"/> |
| | | |
| | | <result column="specs" property="specs"/> |
| | | <result column="model" property="model"/> |
| | | <result column="color" property="color"/> |
| | | <result column="brand" property="brand"/> |
| | | <result column="unit" property="unit"/> |
| | | <result column="price" property="price"/> |
| | | <result column="sku" property="sku"/> |
| | | <result column="units" property="units"/> |
| | | <result column="barcode" property="barcode"/> |
| | | <result column="origin" property="origin"/> |
| | | <result column="manu" property="manu"/> |
| | | <result column="manu_date" property="manu_date"/> |
| | | <result column="item_num" property="item_num"/> |
| | | <result column="safe_qty" property="safe_qty"/> |
| | | <result column="weight" property="weight"/> |
| | | <result column="man_length" property="man_length"/> |
| | | <result column="volume" property="volume"/> |
| | | <result column="three_code" property="three_code"/> |
| | | <result column="supp" property="supp"/> |
| | | <result column="supp_code" property="supp_code"/> |
| | | |
| | | <!-- 标志位 --> |
| | | <result column="be_batch" property="be_batch"/> |
| | | <result column="dead_time" property="dead_time"/> |
| | | <result column="dead_warn" property="dead_warn"/> |
| | | <result column="source" property="source"/> |
| | | <result column="inspect" property="inspect"/> |
| | | <result column="danger" property="danger"/> |
| | | |
| | | <!-- 审计字段 --> |
| | | <result column="modi_user" property="modi_user"/> |
| | | <result column="modi_time" property="modi_time"/> |
| | | <result column="appe_user" property="appe_user"/> |
| | | <result column="appe_time" property="appe_time"/> |
| | | <result column="memo" property="memo"/> |
| | | |
| | | </resultMap> |
| | | <!-- 分页查询所有信息 --> |
| | | <select id="queryViewStayTimeList" parameterType="com.zy.asrs.entity.ViewStayTimeBean" resultType="com.zy.asrs.entity.ViewStayTimeBean"> |
| | | <select id="queryViewStayTimeList" parameterType="com.zy.asrs.entity.ViewStayTimeBean" resultMap="ViewStayTimeMap"> |
| | | select |
| | | * |
| | | from ( |
| | |
| | | and row1 like '%' + #{row1} + '%' |
| | | </if> |
| | | </sql> |
| | | <resultMap id="ViewStockUseMap" type="com.zy.asrs.entity.ViewStockUseBean"> |
| | | <id column="row1" property="row1"/> |
| | | |
| | | <result column="total_qty" property="total_qty"/> |
| | | <result column="full_qty" property="full_qty"/> |
| | | <result column="null_qty" property="null_qty"/> |
| | | <result column="forbid_qty" property="forbid_qty"/> |
| | | <result column="empty_qty" property="empty_qty"/> |
| | | <!-- <result column="use_qty" property="use_qty"/>--> |
| | | <result column="full_rate" property="full_rate"/> |
| | | <result column="occ_rate" property="occ_rate"/> |
| | | </resultMap> |
| | | <!-- 分页查询所有信息 --> |
| | | <select id="queryViewStockUseList" parameterType="com.zy.asrs.entity.ViewStockUseBean" resultType="com.zy.asrs.entity.ViewStockUseBean"> |
| | | <select id="queryViewStockUseList" parameterType="com.zy.asrs.entity.ViewStockUseBean" resultMap="ViewStockUseMap"> |
| | | select top (#{pageSize}) * from asr_stk_use_view |
| | | <where> |
| | | row1 not in (select top ((#{pageNumber}-1)*#{pageSize}) row1 from asr_stk_use_view |
| | |
| | | ]]> |
| | | </if> |
| | | </sql> |
| | | <resultMap id="ViewWorkInMap" type="com.zy.asrs.entity.ViewWorkInBean"> |
| | | |
| | | <!-- 分页 / 行号 / 停留时长 --> |
| | | <result column="row" property="row"/> |
| | | <result column="stay_time" property="stay_time"/> |
| | | |
| | | <!-- 查询条件 --> |
| | | <result column="begin_date" property="begin_date"/> |
| | | <result column="end_date" property="end_date"/> |
| | | <result column="query_date" property="query_date"/> |
| | | |
| | | <!-- 堆垛机 / 时间 --> |
| | | <result column="crn_str_time" property="crn_str_time"/> |
| | | <result column="crn_end_time" property="crn_end_time"/> |
| | | |
| | | <!-- 作业信息 --> |
| | | <result column="wrk_no" property="wrk_no"/> |
| | | <result column="io_time" property="io_time"/> |
| | | |
| | | <!-- 库存信息 --> |
| | | <result column="loc_no" property="loc_no"/> |
| | | <result column="zpallet" property="zpallet"/> |
| | | <result column="anfme" property="anfme"/> |
| | | <result column="matnr" property="matnr"/> |
| | | <result column="maktx" property="maktx"/> |
| | | <result column="batch" property="batch"/> |
| | | |
| | | <!-- ⚠️ 注解在 XML 中无效,必须手动 --> |
| | | <result column="order_no" property="orderNo"/> |
| | | |
| | | <result column="specs" property="specs"/> |
| | | <result column="model" property="model"/> |
| | | <result column="color" property="color"/> |
| | | <result column="brand" property="brand"/> |
| | | <result column="unit" property="unit"/> |
| | | <result column="price" property="price"/> |
| | | <result column="sku" property="sku"/> |
| | | <result column="units" property="units"/> |
| | | <result column="barcode" property="barcode"/> |
| | | <result column="origin" property="origin"/> |
| | | <result column="manu" property="manu"/> |
| | | <result column="manu_date" property="manu_date"/> |
| | | <result column="item_num" property="item_num"/> |
| | | <result column="safe_qty" property="safe_qty"/> |
| | | <result column="weight" property="weight"/> |
| | | <result column="man_length" property="man_length"/> |
| | | <result column="volume" property="volume"/> |
| | | <result column="three_code" property="three_code"/> |
| | | <result column="supp" property="supp"/> |
| | | <result column="supp_code" property="supp_code"/> |
| | | |
| | | <!-- 标志 / 策略 --> |
| | | <result column="be_batch" property="be_batch"/> |
| | | <result column="dead_time" property="dead_time"/> |
| | | <result column="dead_warn" property="dead_warn"/> |
| | | <result column="source" property="source"/> |
| | | <result column="inspect" property="inspect"/> |
| | | <result column="danger" property="danger"/> |
| | | |
| | | <!-- 审计字段 --> |
| | | <result column="modi_user" property="modi_user"/> |
| | | <result column="modi_time" property="modi_time"/> |
| | | <result column="appe_user" property="appe_user"/> |
| | | <result column="appe_time" property="appe_time"/> |
| | | <result column="memo" property="memo"/> |
| | | |
| | | </resultMap> |
| | | <!-- 入库统计 --> |
| | | <!-- 分页查询所有信息 --> |
| | | <select id="queryViewWorkInList" parameterType="com.zy.asrs.entity.ViewWorkInBean" resultType="com.zy.asrs.entity.ViewWorkInBean"> |
| | | <select id="queryViewWorkInList" parameterType="com.zy.asrs.entity.ViewWorkInBean" resultMap="ViewWorkInMap"> |
| | | select |
| | | * |
| | | from ( |
| | |
| | | |
| | | <!-- 出库统计 --> |
| | | <!-- 分页查询所有信息 --> |
| | | <select id="queryViewWorkOutList" parameterType="com.zy.asrs.entity.ViewWorkInBean" resultType="com.zy.asrs.entity.ViewWorkInBean"> |
| | | <select id="queryViewWorkOutList" parameterType="com.zy.asrs.entity.ViewWorkInBean" resultMap="ViewWorkInMap"> |
| | | |
| | | |
| | | select |
| | |
| | | <result column="full_plt" property="fullPlt" /> |
| | | <result column="pre_have" property="preHave" /> |
| | | <result column="take_none" property="takeNone" /> |
| | | <result column="task_no" property="taskNo" /> |
| | | </resultMap> |
| | | <sql id="queryWhere"> |
| | | <where> |
| | |
| | | <result column="full_plt" property="fullPlt" /> |
| | | <result column="pre_have" property="preHave" /> |
| | | <result column="take_none" property="takeNone" /> |
| | | <result column="task_no" property="taskNo" /> |
| | | </resultMap> |
| | | |
| | | <select id="selectToBeCompleteData" resultMap="BaseResultMap"> |
| | |
| | | ,{field: 'row1', align: 'center',title: '排'} |
| | | ,{field: 'bay1', align: 'center',title: '列'} |
| | | ,{field: 'lev1', align: 'center',title: '层'} |
| | | ,{field: 'barcode', align: 'center',title: '料箱码'} |
| | | ,{field: 'fullPlt', align: 'center',title: '满板', templet:function(row){ |
| | | var html = "<input value='fullPlt' type='checkbox' disabled=‘disabled’ lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'"; |
| | | if(row.fullPlt === 'Y'){html += " checked ";} |
| | |
| | | return; |
| | | } |
| | | } |
| | | let devpNo = $('#putSiteSelect').val(); |
| | | let devpNo = $('#barcode').val(); |
| | | if (isEmpty(devpNo)) { |
| | | layer.msg("请选择入库站", {icon: 2}); |
| | | layer.msg("请输入料箱码", {icon: 2}); |
| | | return; |
| | | } |
| | | // 8 位纯数字校验 |
| | | if (!/^\d{8}$/.test(devpNo)) { |
| | | layer.msg("料箱码必须是 8 位纯数字", { icon: 2 }); |
| | | return; |
| | | } |
| | | console.log(matCodeData) |
| | |
| | | url: baseUrl+"/full/store/put/start", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify({ |
| | | devpNo: Number(devpNo), |
| | | barcode: devpNo, |
| | | list: matCodeData |
| | | }), |
| | | contentType:'application/json;charset=UTF-8', |
| | |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.msg("入库启动成功,目标库位:" + res.data, {icon: 1}); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | matCodeData = []; |
| | | $('#barcode').val(""); |
| | | $('#focusMatByMat').val(""); |
| | | tableIns.reload({data: matCodeData,done:function (res) { limit(); getInBound();}}); |
| | | } else if (res.code === 403){ |
| | |
| | | ,{field: 'staNo$', align: 'center',title: '目标站'} |
| | | ,{field: 'sourceLocNo$', align: 'center',title: '源库位'} |
| | | ,{field: 'locNo$', align: 'center',title: '目标库位'} |
| | | ,{field: 'taskNo', align: 'center',title: 'CTU任务号', width:140} |
| | | // ,{field: 'picking', align: 'center',title: '拣料', templet:function(row){ |
| | | // var html = "<input value='picking' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'"; |
| | | // if(row.picking === 'Y'){html += " checked ";} |
| | |
| | | <div class="layui-form"> |
| | | <div class="layui-btn-container"> |
| | | <!-- 1.选择入库口 --> |
| | | <span id="staNoSpan">入库口:</span> |
| | | <select id="putSiteSelect" lay-verify="required"> |
| | | <option value="">请选择站点</option> |
| | | </select> |
| | | <span id="staNoSpan">料箱码: |
| | | <input id="barcode" class="layui-input" type="text" autocomplete="off" style="width: 120px"> |
| | | </span> |
| | | <!-- <select id="putSiteSelect" lay-verify="required">--> |
| | | <!-- <option value="">请选择站点</option>--> |
| | | <!-- </select>--> |
| | | <!-- 2.启动入库 --> |
| | | <button class="layui-btn layui-btn-normal layui-btn-lg" id="btn-comb" lay-event="comb" style="">启动入库</button> |
| | | <button class="layui-btn layui-btn-normal layui-btn-lg" id="btn-comb" lay-event="comb">组托</button> |
| | | </div> |
| | | </div> |
| | | </script> |
| | |
| | | <a class="layui-btn layui-btn-xs btn-detlShow" lay-event="detlShow">明细</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-complete" lay-event="complete">完成</a> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs btn-cancel" lay-event="cancel">取消</a> |
| | | {{#if (d.ioType === 103) { }} |
| | | <a class="layui-btn layui-btn-warm layui-btn-xs btn-pick" lay-event="pick">拣</a> |
| | | {{#if (d.wrkSts === 305) { }} |
| | | <a class="layui-btn layui-btn-warm layui-btn-xs btn-pick" lay-event="pick">回</a> |
| | | {{# } }} |
| | | {{#if (d.ioType === 107) { }} |
| | | <a class="layui-btn layui-btn-warm layui-btn-xs btn-pick" lay-event="pick">盘</a> |