| | |
| | | throw new CoolException("任务档不存在!!"); |
| | | } |
| | | log.info("任务执行参数回写:{}", JSON.toJSONString(params)); |
| | | if (params.getNotifyType().equals("task")) { |
| | | //任务 |
| | | if (params.getMsgType().equals("task_complete") || params.getMsgType().equals("station_out_task_run")) { |
| | | if (mast.getIoType() == 1 || mast.getIoType() == 11 || mast.getIoType() == 10 || mast.getIoType() == 53 || mast.getIoType() == 54 || mast.getIoType() == 57) { |
| | | |
| | | mast.setWrkSts(4L); |
| | | } else if (mast.getIoType() == 101 || mast.getIoType() == 110 || mast.getIoType() == 103 || mast.getIoType() == 104 || mast.getIoType() == 107) { |
| | | //TODO 恢复正常后,这里代码要注释掉 |
| | | if (mast.getIoType() == 103 || mast.getIoType() == 107) { |
| | | List<WrkDetl> wrkDetls103 = wrkDetlService |
| | | .selectList(new EntityWrapper<WrkDetl>().eq("wrk_no", mast.getWrkNo())); |
| | | if (wrkDetls103.isEmpty()) { |
| | | throw new CoolException("拣料出库 ===>> 更新订单完成数量失败; [workNo=" + mast.getWrkNo()); |
| | | } |
| | | for (WrkDetl wrkDetl : wrkDetls103) { |
| | | // 更新订单完成数量 |
| | | OrderDetlPakout orderDetlPakout = orderDetlPakoutService.selectItem(wrkDetl.getOrderNo(), |
| | | if (params.getMsgType().equals("task_complete") || params.getMsgType().equals("station_out_task_run_complete") || params.getMsgType().equals("station_out_task_run")) { |
| | | if (mast.getIoType() == 1 || mast.getIoType() == 11 || mast.getIoType() == 10 || mast.getIoType() == 53 || mast.getIoType() == 54 || mast.getIoType() == 57) { |
| | | mast.setWrkSts(4L); |
| | | } else if (mast.getIoType() == 101 || mast.getIoType() == 110 || mast.getIoType() == 103 || mast.getIoType() == 104 || mast.getIoType() == 107) { |
| | | //TODO 恢复正常后,这里代码要注释掉 |
| | | if (mast.getIoType() == 103 || mast.getIoType() == 107) { |
| | | List<WrkDetl> wrkDetls103 = wrkDetlService |
| | | .selectList(new EntityWrapper<WrkDetl>().eq("wrk_no", mast.getWrkNo())); |
| | | if (wrkDetls103.isEmpty()) { |
| | | throw new CoolException("拣料出库 ===>> 更新订单完成数量失败; [workNo=" + mast.getWrkNo()); |
| | | } |
| | | for (WrkDetl wrkDetl : wrkDetls103) { |
| | | // 更新订单完成数量 |
| | | OrderDetlPakout orderDetlPakout = orderDetlPakoutService.selectItem(wrkDetl.getOrderNo(), |
| | | wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), |
| | | wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3()); |
| | | if (orderDetlPakout == null) { |
| | | orderDetlPakout = orderDetlPakoutService.selectItem(wrkDetl.getOrderNo(), |
| | | wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), |
| | | wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3()); |
| | | if (orderDetlPakout == null) { |
| | | orderDetlPakout = orderDetlPakoutService.selectItem(wrkDetl.getOrderNo(), |
| | | wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), |
| | | wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3()); |
| | | } |
| | | if (!Cools.isEmpty(orderDetlPakout)) { |
| | | if (!orderDetlPakoutService.increaseQtyByOrderNo(wrkDetl.getOrderNo(), |
| | | wrkDetl.getMatnr(), |
| | | orderDetlPakout.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), |
| | | wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3(), |
| | | wrkDetl.getAnfme())) { |
| | | throw new CoolException("全板出库 ===>> 更新订单完成数量失败; [workNo=" + mast.getWrkNo()); |
| | | } |
| | | } |
| | | if (!Cools.isEmpty(orderDetlPakout)) { |
| | | if (!orderDetlPakoutService.increaseQtyByOrderNo(wrkDetl.getOrderNo(), |
| | | wrkDetl.getMatnr(), |
| | | orderDetlPakout.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), |
| | | wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3(), |
| | | wrkDetl.getAnfme())) { |
| | | throw new CoolException("全板出库 ===>> 更新订单完成数量失败; [workNo=" + mast.getWrkNo()); |
| | | } |
| | | } |
| | | } |
| | | mast.setWrkSts(14L); |
| | | } |
| | | if (!wrkMastService.updateById(mast)) { |
| | | throw new CoolException("任务状态修改失败!!"); |
| | | } |
| | | } else if (params.getMsgType().equals("task_cancel")) { |
| | | //todo 取消任务 |
| | | mast.setWrkSts(14L); |
| | | } |
| | | if (!wrkMastService.updateById(mast)) { |
| | | throw new CoolException("任务状态修改失败!!"); |
| | | } |
| | | } else if (params.getMsgType().equals("task_cancel")) { |
| | | //todo 取消任务 |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.annotations.AppAuth; |
| | | import com.core.common.*; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.Task; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.domain.dto.AxisBean; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.*; |
| | | import com.zy.asrs.service.OpenService; |
| | | import com.zy.asrs.service.TaskService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.asrs.mapper.ReportQueryMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.model.DetlDto; |
| | | import com.zy.common.web.BaseController; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * Created by vincent on 2022/4/8 |
| | |
| | | |
| | | @Autowired |
| | | private OpenService openService; |
| | | |
| | | @Autowired |
| | | private TaskService taskService; |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | | private WorkService workService; |
| | | @Autowired |
| | | private WrkDetlService wrkDetlService; |
| | | @Autowired |
| | | private ReportQueryMapper reportQueryMapper; |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | @Autowired |
| | | private MatService matService; |
| | | @Autowired |
| | | private WaitPakinService waitPakinService; |
| | | |
| | | |
| | | |
| | | @PostMapping("/agvPickupComplete/agvCallback") |
| | | @AppAuth(memo = "AGV取货完成接口") |
| | | public Map<String, Object> agvPickupComplete(@RequestBody AgvTaskParam agvTaskParam, HttpServletRequest request) { |
| | | // DecimalFormat df = new DecimalFormat("0000"); |
| | | // String wrkNo = "Ctu"+df.format(param.getWrkNo())+date.getTime()/1000; |
| | | // String wrkNo = agvTaskParam.getTaskCode().substring(3,7); |
| | | // Task task = taskService.selectOne(new EntityWrapper<Task>().eq("wrk_no", Integer.parseInt(wrkNo))); |
| | | Task task = taskService.selectOne(new EntityWrapper<Task>().eq("wrk_no", agvTaskParam.getTaskCode())); |
| | | if (Cools.isEmpty(task)) { |
| | | log.error("未查询到任务号对应的数据"); |
| | | /** |
| | | * 组托查询接口 |
| | | */ |
| | | @PostMapping("/queryComb") |
| | | public synchronized R queryComb(@RequestBody QueryCombParam param) { |
| | | if (Cools.isEmpty(param)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | task.setWrkSts(0L); |
| | | taskService.updateById(task); |
| | | if (Cools.isEmpty(param.getBarcode())) { |
| | | return R.error("托盘码[barcode]不能为空"); |
| | | } |
| | | |
| | | List<WaitPakin> waitPakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode())); |
| | | |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("code","0"); |
| | | map.put("message","成功"); |
| | | map.put("reqCode", ""); |
| | | log.info("agv请求取货完成,wms任务号:"+ JSON.toJSONString(agvTaskParam)); |
| | | return map; |
| | | |
| | | map.put("barcode", param.getBarcode()); |
| | | map.put("combDetls", waitPakins); |
| | | return R.ok().add(map); |
| | | } |
| | | |
| | | @PostMapping("/agvTaskComplete/agvCallback") |
| | | @AppAuth(memo = "AGV放货完成接口") |
| | | public Map<String, Object> agvTaskComplete(@RequestBody AgvTaskParam agvTaskParam,HttpServletRequest request) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | // String wrkNo = agvTaskParam.getTaskCode().substring(3,7); |
| | | // Task task = taskService.selectOne(new EntityWrapper<Task>().eq("wrk_no", Integer.parseInt(wrkNo))); |
| | | Task task = taskService.selectOne(new EntityWrapper<Task>().eq("wrk_no", agvTaskParam.getTaskCode())); |
| | | if (Cools.isEmpty(task)) { |
| | | log.error("未查询到任务号对应的数据"); |
| | | } |
| | | if (task.getIoType() < 100 ){ |
| | | task.setWrkSts(4L); |
| | | }else { |
| | | task.setWrkSts(14L); |
| | | } |
| | | taskService.updateById(task); |
| | | /** |
| | | * 库存信息查询接口 |
| | | */ |
| | | @GetMapping("/queryLoc") |
| | | public synchronized R queryLoc() { |
| | | List<Map<String, Object>> pie = new ArrayList<>(); |
| | | LocChartPie locUseRate = reportQueryMapper.getLocUseRate(); |
| | | |
| | | map.put("code","0"); |
| | | map.put("message","成功"); |
| | | map.put("reqCode", ""); |
| | | return map; |
| | | if (locUseRate != null) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("name", "在库"); |
| | | map.put("value", locUseRate.getFqty()); |
| | | pie.add(map); |
| | | |
| | | Map<String, Object> map1 = new HashMap<>(); |
| | | map1.put("name", "空"); |
| | | map1.put("value", locUseRate.getOqty()); |
| | | pie.add(map1); |
| | | |
| | | Map<String, Object> map2 = new HashMap<>(); |
| | | map2.put("name", "使用"); |
| | | map2.put("value", locUseRate.getUqty()); |
| | | pie.add(map2); |
| | | |
| | | Map<String, Object> map3 = new HashMap<>(); |
| | | map3.put("name", "禁用"); |
| | | map3.put("value", locUseRate.getXqty()); |
| | | pie.add(map3); |
| | | } |
| | | |
| | | // 总库位数 |
| | | Integer total = (int) Arith.add(0, locUseRate.getFqty(), locUseRate.getOqty(), locUseRate.getUqty(), locUseRate.getXqty()); |
| | | // 使用中 |
| | | Integer used = locUseRate.getFqty() + locUseRate.getUqty(); |
| | | // 库位使用率 |
| | | double usedDivides = Arith.divides(3, used, total); |
| | | double usedPr = Arith.multiplys(1, usedDivides, 100); |
| | | |
| | | return R.ok( |
| | | Cools.add("pie", pie) |
| | | .add("stockCount", locUseRate.getFqty()) |
| | | .add("emptyCount", locUseRate.getOqty()) |
| | | .add("disableCount", locUseRate.getXqty()) |
| | | .add("total", total) |
| | | .add("used", used) |
| | | .add("usedPr", usedPr) |
| | | ); |
| | | } |
| | | |
| | | @PostMapping("/order/matSync/default/v2") |
| | | // @AppAuth(memo = "商品信息同步接口") |
| | | public synchronized R syncMatInfoV2(@RequestHeader(required = false) String appkey, |
| | | @RequestBody(required = false) MatSyncParam.MatParam param, |
| | | HttpServletRequest request){ |
| | | |
| | | @PostMapping("/order/adjustment/default/v1") |
| | | public synchronized R adjustmentOrderCreate(@RequestHeader(required = false) String appkey, |
| | | @RequestBody OpenAdjustmentOrderParam param, |
| | | HttpServletRequest request) { |
| | | auth(appkey, param, request); |
| | | if (Cools.isEmpty(param)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | MatSyncParam matSyncParam = new MatSyncParam(); |
| | | List<MatSyncParam.MatParam> objects = new ArrayList<>(); |
| | | objects.add(param); |
| | | matSyncParam.matDetails = objects; |
| | | openService.syncMat(matSyncParam); |
| | | if (Cools.isEmpty(param.getOrderNo())) { |
| | | return R.error("单据编号[orderNo]不能为空"); |
| | | } |
| | | if (Cools.isEmpty(param.getOrderDetails())) { |
| | | return R.error("单据明细[orderDetails]不能为空"); |
| | | } |
| | | openService.adjustmentOrderCreate(param); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @GetMapping("/line/charts") |
| | | public R locIoLineCharts(){ |
| | | Map<String,Object> map=new HashMap<String, Object>(); |
| | | List<AxisBean> list = new ArrayList<AxisBean>(); |
| | | |
| | | List<WorkChartAxis> listChart = reportQueryMapper.getChartAxis(); |
| | | |
| | | if(listChart!=null) { |
| | | ArrayList<Integer> data1 = new ArrayList<Integer>(); |
| | | ArrayList<Integer> data2 = new ArrayList<Integer>(); |
| | | |
| | | SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.add(Calendar.DATE, -12); |
| | | for(int i=0;i<12;i++) { |
| | | boolean flag = true; |
| | | calendar.add(Calendar.DATE, 1); |
| | | String str = sf.format(calendar.getTime()); |
| | | for(WorkChartAxis workChart : listChart) { |
| | | if(str.equals(workChart.getYmd())) { |
| | | data1.add(workChart.getInqty()); |
| | | data2.add(workChart.getOutqty()); |
| | | flag = false; |
| | | break; |
| | | } |
| | | } |
| | | if(flag) { |
| | | data1.add(0); |
| | | data2.add(0); |
| | | } |
| | | } |
| | | AxisBean inqty = new AxisBean(); |
| | | inqty.setName("入库数量"); |
| | | Integer[] array1 = new Integer[data1.size()]; |
| | | inqty.setData(data1.toArray(array1)); |
| | | list.add(inqty); |
| | | AxisBean outqty = new AxisBean(); |
| | | outqty.setName("出库数量"); |
| | | Integer[] array2 = new Integer[data2.size()]; |
| | | outqty.setData(data2.toArray(array2)); |
| | | list.add(outqty); |
| | | } |
| | | map.put("rows",list); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | @GetMapping("/locDetl/statistics") |
| | | public R locDetlStatistics(){ |
| | | HashMap<String, Object> param = new HashMap<>(); |
| | | Page<LocDetl> stockStatis = locDetlService.getStockStatis(toPage(1, 100, param, LocDetl.class)); |
| | | for (LocDetl locDetl : stockStatis.getRecords()) { |
| | | Mat mat = matService.selectByMatnr(locDetl.getMatnr()); |
| | | if (mat != null) { |
| | | locDetl.sync(mat); |
| | | } |
| | | } |
| | | return R.ok(stockStatis); |
| | | } |
| | | |
| | | @PostMapping("/order/matSync/default/v1") |
| | | // @AppAuth(memo = "商品信息同步接口") |
| | | @AppAuth(memo = "商品信息同步接口") |
| | | public synchronized R syncMatInfo(@RequestHeader(required = false) String appkey, |
| | | @RequestBody(required = false) MatSyncParam param, |
| | | HttpServletRequest request){ |
| | | HttpServletRequest request) { |
| | | auth(appkey, param, request); |
| | | if (Cools.isEmpty(param)) { |
| | | return R.parse(BaseRes.PARAM); |
| | |
| | | // openService.packageUp(param); |
| | | // return R.ok(); |
| | | // } |
| | | |
| | | @PostMapping("/order/adjustment/default/v1") |
| | | public synchronized R adjustmentOrderCreate(@RequestHeader(required = false) String appkey, |
| | | @RequestBody OpenAdjustmentOrderParam param, |
| | | HttpServletRequest request) { |
| | | auth(appkey, param, request); |
| | | if (Cools.isEmpty(param)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | if (Cools.isEmpty(param.getOrderNo())) { |
| | | return R.error("单据编号[orderNo]不能为空"); |
| | | } |
| | | if (Cools.isEmpty(param.getOrderDetails())) { |
| | | return R.error("单据明细[orderDetails]不能为空"); |
| | | } |
| | | openService.adjustmentOrderCreate(param); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 添加入库单 |
| | |
| | | /** |
| | | * 入库单回写 |
| | | */ |
| | | // @PostMapping("/order/pakin/complete/default/v1") |
| | | @PostMapping("/order/pakin/complete/default/v1") |
| | | public synchronized R orderPakinComplete(@RequestHeader(required = false) String appkey, |
| | | @RequestBody(required = false) OpenOrderCompleteParam param, |
| | | HttpServletRequest request) { |
| | |
| | | if (Cools.isEmpty(param)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | if (Cools.isEmpty(param.getLgort())) { |
| | | return R.error("单据编号[lgort]不能为空"); |
| | | } |
| | | if (!param.getLgort().equals("5006")) { |
| | | return R.ok(); |
| | | } |
| | | if (Cools.isEmpty(param.getOrderNo())) { |
| | | return R.error("单据编号[orderNo]不能为空"); |
| | | } |
| | |
| | | /** |
| | | * 出库单回写 |
| | | */ |
| | | // @PostMapping("/order/pakout/complete/default/v1") |
| | | @PostMapping("/order/pakout/complete/default/v1") |
| | | public synchronized R orderPakoutComplete(@RequestHeader(required = false) String appkey, |
| | | @RequestBody(required = false) OpenOrderCompleteParam param, |
| | | HttpServletRequest request) { |
| | |
| | | System.out.println(JSON.toJSONString(param1)); |
| | | } |
| | | |
| | | /*********************************同步物料档案和订单****************************************************/ |
| | | |
| | | /*********************************wcs接口对接****************************************************/ |
| | | |
| | | /** |
| | | * 任务开始 |
| | | */ |
| | | @RequestMapping("/start/task") |
| | | public HashMap<String, Object> startTask(@RequestBody HashMap<String, Object> map) { |
| | | String taskNo = map.get("TaskNo") + ""; |
| | | HashMap<String, Object> map1 = new HashMap<>(); |
| | | if (Cools.isEmpty(taskNo)) { |
| | | map1.put("ReturnStatus", "1"); |
| | | map1.put("ErrorMessage", "任务号为空"); |
| | | } else { |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", Integer.valueOf(taskNo))); |
| | | if (wrkMast == null) { |
| | | map1.put("ReturnStatus", "1"); |
| | | map1.put("ErrorMessage", "没有找到该任务号:" + taskNo); |
| | | } else { |
| | | if (wrkMast.getIoType() == 1||wrkMast.getIoType() == 57|| wrkMast.getIoType() == 53) { |
| | | wrkMast.setWrkSts(3L);//入库开始 |
| | | } else if (wrkMast.getIoType() == 11 ||wrkMast.getIoType() == 107|| wrkMast.getIoType() == 103 ) { |
| | | wrkMast.setWrkSts(13L);//出库开始 |
| | | } |
| | | wrkMast.setModiTime(new Date()); |
| | | if (wrkMastService.updateById(wrkMast)) { |
| | | log.info("WMS任务开始更新"+wrkMast); |
| | | map1.put("ReturnStatus", "0"); |
| | | map1.put("ErrorMessage", ""); |
| | | } else { |
| | | map1.put("ReturnStatus", "1"); |
| | | map1.put("ErrorMessage", "更新任务状态失败" + wrkMast); |
| | | } |
| | | } |
| | | } |
| | | return map1; |
| | | } |
| | | |
| | | /** |
| | | * 搬运到目的地 |
| | | */ |
| | | @RequestMapping("/destination/task") |
| | | public HashMap<String, Object> destinationTask(@RequestBody HashMap<String, Object> map) { |
| | | String taskNo = map.get("TaskNo") + ""; |
| | | HashMap<String, Object> map1 = new HashMap<>(); |
| | | if (Cools.isEmpty(taskNo)) { |
| | | map1.put("ReturnStatus", "1"); |
| | | map1.put("ErrorMessage", "任务号为空"); |
| | | } else { |
| | | //任务完成 |
| | | if (map.get("Result").equals(1)) { |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", Integer.valueOf(taskNo))); |
| | | if (wrkMast == null) { |
| | | map1.put("ReturnStatus", "1"); |
| | | map1.put("ErrorMessage", "没有找到该任务号:" + taskNo); |
| | | } else { |
| | | if (wrkMast.getIoType() == 1 || wrkMast.getIoType() == 10) { |
| | | wrkMast.setWrkSts(4L);//任务结束 |
| | | } else if (wrkMast.getIoType() == 101) { |
| | | wrkMast.setWrkSts(13L);//出库到站点上 |
| | | } else if (wrkMast.getIoType() == 53 || wrkMast.getIoType() == 57) { |
| | | wrkMast.setWrkSts(4L);//4.任务结束 |
| | | } else if (wrkMast.getIoType() == 103 || wrkMast.getIoType() == 107 || wrkMast.getIoType() == 110) { |
| | | wrkMast.setWrkSts(14L); |
| | | }else if(wrkMast.getIoType() == 11) { |
| | | wrkMast.setWrkSts(4L); |
| | | } |
| | | wrkMast.setModiTime(new Date()); |
| | | if (wrkMastService.update(wrkMast,new EntityWrapper<WrkMast>().eq("wrk_no",wrkMast.getWrkNo()))) { |
| | | log.info("WMS任务完成更新"+wrkMast); |
| | | map1.put("ReturnStatus", "0"); |
| | | map1.put("ErrorMessage", ""); |
| | | } else { |
| | | map1.put("ReturnStatus", "1"); |
| | | map1.put("ErrorMessage", "更新任务状态失败" + wrkMast); |
| | | } |
| | | } |
| | | } else { |
| | | //任务取消 |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", Integer.valueOf(taskNo))); |
| | | if (wrkMast == null) { |
| | | map1.put("ReturnStatus", "1"); |
| | | map1.put("ErrorMessage", "没有找到该任务号:" + taskNo); |
| | | return map1; |
| | | } |
| | | workService.cancelWrkMast(String.valueOf(wrkMast.getWrkNo()),9999L); |
| | | map1.put("ReturnStatus", "0"); |
| | | map1.put("ErrorMessage", ""); |
| | | } |
| | | } |
| | | return map1; |
| | | } |
| | | |
| | | /** |
| | | * 出库---目的地搬离 |
| | | */ |
| | | @RequestMapping("/leave/task") |
| | | public R leaveTask(@RequestBody HashMap<String, Object> map) { |
| | | String taskNo = String.valueOf(map.get("taskNo")); |
| | | String status = String.valueOf(map.get("status")); |
| | | HashMap<String, Object> map1 = new HashMap<>(); |
| | | if (Cools.isEmpty(taskNo)) { |
| | | return R.error("任务号为空"); |
| | | } else { |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", Integer.valueOf(taskNo))); |
| | | if (wrkMast == null) { |
| | | return R.error("没有找到该任务号:" + taskNo); |
| | | } |
| | | |
| | | if (status.equals("complete")) { |
| | | // 入库 + 库位转移 |
| | | if (wrkMast.getWrkSts() < 4 || (wrkMast.getWrkSts() > 10 && wrkMast.getIoType()==11)) { |
| | | wrkMast.setWrkSts(4L); |
| | | // 出库 |
| | | } else if (wrkMast.getWrkSts() > 10) { |
| | | wrkMast.setWrkSts(14L); |
| | | } |
| | | Date now = new Date(); |
| | | wrkMast.setWrkSts(14L);//出库到站点上 |
| | | wrkMast.setCrnStrTime(DateUtils.calculate(now, 1L, TimeUnit.SECONDS, true)); |
| | | wrkMast.setCrnEndTime(now); |
| | | wrkMast.setModiTime(now); |
| | | wrkMastService.updateById(wrkMast); |
| | | |
| | | return R.ok(); |
| | | } else if (status.equals("cancel")) { |
| | | workService.cancelWrkMast(taskNo, 9527L); |
| | | return R.ok(); |
| | | } |
| | | } |
| | | return R.error(); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.domain.dto; |
| | | |
| | | /** |
| | | * 曲线图表json键 |
| | | * @author admin |
| | | * |
| | | */ |
| | | public class AxisBean { |
| | | private String name; |
| | | private Integer[] data; |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | public Integer[] getData() { |
| | | return data; |
| | | } |
| | | public void setData(Integer[] data) { |
| | | this.data = data; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.domain.dto; |
| | | |
| | | /** |
| | | * 入出库统计曲线图 |
| | | * @author admin |
| | | * @date 2018年12月12日 |
| | | */ |
| | | public class WorkChartAxis { |
| | | private String ymd; |
| | | private int inqty; |
| | | private int outqty; |
| | | |
| | | public String getYmd() { |
| | | return ymd; |
| | | } |
| | | public void setYmd(String ymd) { |
| | | this.ymd = ymd; |
| | | } |
| | | public int getInqty() { |
| | | return inqty; |
| | | } |
| | | public void setInqty(int inqty) { |
| | | this.inqty = inqty; |
| | | } |
| | | public int getOutqty() { |
| | | return outqty; |
| | | } |
| | | public void setOutqty(int outqty) { |
| | | this.outqty = outqty; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.domain.enums; |
| | | |
| | | /** |
| | | * 堆垛机状态枚举 |
| | | */ |
| | | public enum CrnStatusType { |
| | | |
| | | // 入库 |
| | | MACHINE_PAKIN("入库"), |
| | | // 出库 |
| | | MACHINE_PAKOUT("出库"), |
| | | // 库到库 |
| | | MACHINE_STOCK_MOVE("库到库"), |
| | | // 站到站 |
| | | MACHINE_SITE_MOVE("站到站"), |
| | | // p to p |
| | | MACHINE_P_MOVE("PToP"), |
| | | // 异常 |
| | | MACHINE_ERROR("异常"), |
| | | // 自动 |
| | | MACHINE_AUTO("自动"), |
| | | // 非自动/手动 |
| | | MACHINE_UN_AUTO("非自动"), |
| | | ; |
| | | |
| | | private String desc; |
| | | CrnStatusType(String desc){ |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public String getDesc() { |
| | | return desc; |
| | | } |
| | | |
| | | public void setDesc(String desc) { |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public static CrnStatusType process(Integer ioType){ |
| | | if (ioType>100) { |
| | | return MACHINE_PAKOUT; |
| | | } else if (ioType < 100 && ioType!=3 && ioType!=6 && ioType!=11) { |
| | | return MACHINE_PAKIN; |
| | | } else if (ioType == 3) { |
| | | return MACHINE_SITE_MOVE; |
| | | } else if (ioType == 11) { |
| | | return MACHINE_STOCK_MOVE; |
| | | } else { |
| | | return MACHINE_ERROR; |
| | | } |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.domain.enums; |
| | | |
| | | /** |
| | | * 站点状态枚举 |
| | | */ |
| | | public enum SiteStatusType { |
| | | |
| | | // 自动 |
| | | SITE_AUTO, |
| | | // 非自动 |
| | | SITE_UNAUTO, |
| | | // 自动+有物+ID |
| | | SITE_AUTO_RUN_ID, |
| | | // 自动+有物 |
| | | SITE_AUTO_RUN, |
| | | // 自动+ID |
| | | SITE_AUTO_ID, |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.domain.enums; |
| | | |
| | | import com.core.exception.CoolException; |
| | | |
| | | /** |
| | | * 工作号排序规则 |
| | | */ |
| | | public enum WorkNoType { |
| | | |
| | | PAKIN(0), |
| | | PICK(1), |
| | | PAKOUT(2), |
| | | OTHER(3), |
| | | ; |
| | | |
| | | public Integer type; |
| | | |
| | | WorkNoType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public static Integer getWorkNoType(Integer ioType) { |
| | | switch (ioType) { |
| | | case 1: |
| | | return PAKIN.type; |
| | | case 10: |
| | | return PAKIN.type; |
| | | case 11: |
| | | return PICK.type; |
| | | case 53: |
| | | case 54: |
| | | case 57: |
| | | return PICK.type; |
| | | case 101: |
| | | return PAKOUT.type; |
| | | case 103: |
| | | case 104: |
| | | case 107: |
| | | return PICK.type; |
| | | case 110: |
| | | return PAKOUT.type; |
| | | default: |
| | | break; |
| | | } |
| | | throw new CoolException(ioType + "的任务类型无法生成工作号"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.domain.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 堆垛机演示操作入参 |
| | | * Created by vincent on 2020-06-03 |
| | | */ |
| | | @Data |
| | | public class CrnDemoParam { |
| | | |
| | | // 操作类型 1: 打开; 0: 关闭 |
| | | private Integer crnId; |
| | | |
| | | // 密码口令 |
| | | private String password; |
| | | |
| | | private Boolean opt; |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.domain.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * Created by vincent on 2020-06-02 |
| | | */ |
| | | @Data |
| | | public class CrnOperatorParam { |
| | | |
| | | // 堆垛机号 |
| | | private Integer crnNo; |
| | | |
| | | // 源站 |
| | | private Short sourceStaNo; |
| | | |
| | | // 源库位-排 |
| | | private Short sourceRow; |
| | | |
| | | // 源库位-列 |
| | | private Short sourceBay; |
| | | |
| | | // 源库位-层 |
| | | private Short sourceLev; |
| | | |
| | | // 目标站 |
| | | private Short staNo; |
| | | |
| | | // 目标库位-排 |
| | | private Short row; |
| | | |
| | | // 目标库位-列 |
| | | private Short bay; |
| | | |
| | | // 目标库位-层 |
| | | private Short lev; |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.domain.param; |
| | | |
| | | /** |
| | | * 系统运行状态操作入参 |
| | | * Created by vincent on 2020-06-03 |
| | | */ |
| | | public class SystemSwitchParam { |
| | | |
| | | // 操作类型 1: 打开; 0: 关闭 |
| | | private Integer operatorType; |
| | | |
| | | // 密码口令 |
| | | private String password; |
| | | |
| | | public Integer getOperatorType() { |
| | | return operatorType; |
| | | } |
| | | |
| | | public void setOperatorType(Integer operatorType) { |
| | | this.operatorType = operatorType; |
| | | } |
| | | |
| | | public String getPassword() { |
| | | return password; |
| | | } |
| | | |
| | | public void setPassword(String password) { |
| | | this.password = password; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.domain.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 扫码器实时数据视图对象 |
| | | * Created by vincent on 2020-06-03 |
| | | */ |
| | | @Data |
| | | public class BarcodeDataVo { |
| | | |
| | | // 扫码器编号 |
| | | private Integer barcodeId; |
| | | |
| | | // 扫码器内容 |
| | | private String codeValue; |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.domain.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * Created by vincent on 2020-06-02 |
| | | */ |
| | | @Data |
| | | public class CommandLogVo { |
| | | |
| | | // 堆垛机编号 |
| | | private Integer crnNo; |
| | | |
| | | // 状态 |
| | | private Integer status; |
| | | |
| | | // 命令报文 |
| | | private String command; |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.domain.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 堆垛机详情视图对象 |
| | | * Created by vincent on 2020-06-03 |
| | | */ |
| | | @Data |
| | | public class CrnDetailVo { |
| | | |
| | | // 堆垛机号 |
| | | private Integer crnNo; |
| | | |
| | | // 工作号 |
| | | private Short workNo; |
| | | |
| | | // 源站 |
| | | private String sourceStaNo = ""; |
| | | |
| | | // 目标站 |
| | | private String staNo = ""; |
| | | |
| | | // 工作状态 |
| | | private String wrkSts = ""; |
| | | |
| | | // 出入类型 |
| | | private String ioType = ""; |
| | | |
| | | // 源库位 |
| | | private String sourceLocNo = ""; |
| | | |
| | | // 目标库位 |
| | | private String locNo = ""; |
| | | |
| | | // 堆垛机状态 |
| | | private String crnStatus = ""; |
| | | |
| | | // 异常 |
| | | private String error = ""; |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.domain.vo; |
| | | |
| | | import com.zy.asrs.domain.enums.CrnStatusType; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 堆垛机最新数据视图对象 |
| | | * Created by vincent on 2020-06-01 |
| | | */ |
| | | @Data |
| | | public class CrnLatestDataVo { |
| | | |
| | | // 堆垛机编号 |
| | | private Integer crnId; |
| | | |
| | | // 偏移量 |
| | | private Double offset; |
| | | |
| | | // 当前列 |
| | | private Short bay; |
| | | |
| | | private CrnStatusType crnStatus; |
| | | |
| | | public String getCrnStatus(){ |
| | | return crnStatus.toString().toLowerCase().replaceAll("_", "-"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.domain.vo; |
| | | |
| | | import com.zy.asrs.utils.Utils; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * Created by vincent on 2020-06-02 |
| | | */ |
| | | @Data |
| | | public class CrnMsgTableVo { |
| | | |
| | | // 堆垛机号 |
| | | private Integer crnNo; |
| | | |
| | | // 工作号 |
| | | private Short workNo = 0; |
| | | |
| | | // 状态 |
| | | private String status = "-"; |
| | | |
| | | // 源站 |
| | | private String sourceStaNo = "-"; |
| | | |
| | | // 目标站 |
| | | private String staNo = "-"; |
| | | |
| | | // 源库位 |
| | | private String sourceLocNo = "-"; |
| | | |
| | | // 目标库位 |
| | | private String locNo = "-"; |
| | | |
| | | // 异常 |
| | | private String error = ""; |
| | | |
| | | // 原点 |
| | | private String origin = ""; |
| | | |
| | | // 命令 |
| | | private String command = ""; |
| | | |
| | | // 走行速度(m/min) |
| | | private Float xspeed = 0.0F; |
| | | |
| | | // 升降速度(m/min) |
| | | private Float yspeed = 0.0F; |
| | | |
| | | // 叉牙速度(m/min) |
| | | private Float zspeed = 0.0F; |
| | | |
| | | // 走行距离(Km) |
| | | private Float xdistance = 0.0F; |
| | | |
| | | // 升降距离(Km) |
| | | private Float ydistance = 0.0F; |
| | | |
| | | // 走行时长(H) |
| | | private Float xduration = 0.0F; |
| | | |
| | | // 升降时长(H) |
| | | private Float yduration = 0.0F; |
| | | |
| | | public void setXspeed(Float xspeed) { |
| | | this.xspeed = Utils.scale(xspeed); |
| | | } |
| | | |
| | | public void setYspeed(Float yspeed) { |
| | | this.yspeed = Utils.scale(yspeed); |
| | | } |
| | | |
| | | public void setZspeed(Float zspeed) { |
| | | this.zspeed = Utils.scale(zspeed); |
| | | } |
| | | |
| | | public void setXdistance(Float xdistance) { |
| | | this.xdistance = Utils.scale(xdistance); |
| | | } |
| | | |
| | | public void setYdistance(Float ydistance) { |
| | | this.ydistance = Utils.scale(ydistance); |
| | | } |
| | | |
| | | public void setXduration(Float xduration) { |
| | | this.xduration = Utils.scale(xduration); |
| | | } |
| | | |
| | | public void setYduration(Float yduration) { |
| | | this.yduration = Utils.scale(yduration); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.domain.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * Created by vincent on 2020-06-02 |
| | | */ |
| | | @Data |
| | | public class CrnStateTableVo { |
| | | |
| | | // 堆垛机号 |
| | | private Integer crnNo; |
| | | |
| | | // 模式 |
| | | private String statusType = "-"; |
| | | |
| | | // 有物 |
| | | private String loading = "-"; |
| | | |
| | | // 列 |
| | | private Short bay; |
| | | |
| | | // 层 |
| | | private Short lev; |
| | | |
| | | // 走行原点 |
| | | private String xOrigin = "-"; |
| | | |
| | | // 升降原点 |
| | | private String yOrigin = "-"; |
| | | |
| | | // 货叉位置 |
| | | private String forkOffset = "-"; |
| | | |
| | | // 载货台位置 |
| | | private String liftPos = "-"; |
| | | |
| | | // 走行定位 |
| | | private String walkPos = "-"; |
| | | |
| | | // 急停 |
| | | private String stop = "-"; |
| | | |
| | | // 列坐标 |
| | | private String bayCoor = "-"; |
| | | |
| | | // 层坐标 |
| | | private String levCoor = "-"; |
| | | |
| | | // 完成 |
| | | private String complete = "-"; |
| | | |
| | | // 任务号 |
| | | private Short workNo = 0; |
| | | |
| | | // 状态 |
| | | private String status = "-"; |
| | | |
| | | // 异常码 |
| | | private String warnCode = "-"; |
| | | |
| | | // 垂直故障码 |
| | | private String alarm = "-"; |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.domain.vo; |
| | | |
| | | /** |
| | | * 库位占用百分比 |
| | | * @author admin |
| | | * @date 2018年12月12日 |
| | | */ |
| | | public class LocChartPie { |
| | | private int fqty; |
| | | private int oqty; |
| | | private int uqty; |
| | | private int xqty; |
| | | public int getFqty() { |
| | | return fqty; |
| | | } |
| | | public void setFqty(int fqty) { |
| | | this.fqty = fqty; |
| | | } |
| | | public int getOqty() { |
| | | return oqty; |
| | | } |
| | | public void setOqty(int oqty) { |
| | | this.oqty = oqty; |
| | | } |
| | | public int getUqty() { |
| | | return uqty; |
| | | } |
| | | public void setUqty(int uqty) { |
| | | this.uqty = uqty; |
| | | } |
| | | public int getXqty() { |
| | | return xqty; |
| | | } |
| | | public void setXqty(int xqty) { |
| | | this.xqty = xqty; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.domain.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * Created by vincent on 2020-06-02 |
| | | */ |
| | | @Data |
| | | public class PlcErrorTableVo { |
| | | |
| | | // 序号 |
| | | private Integer no; |
| | | |
| | | // plc异常描述 |
| | | private String plcDesc; |
| | | |
| | | // 异常 |
| | | private String error; |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.domain.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 磅秤实时数据视图对象 |
| | | * Created by vincent on 2020-06-03 |
| | | */ |
| | | @Data |
| | | public class ScaleDataVo { |
| | | |
| | | // 磅秤编号 |
| | | private Integer scaleId; |
| | | |
| | | // 磅秤内容 |
| | | private String value; |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.domain.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 输送设备详情视图对象 |
| | | * Created by vincent on 2020-06-03 |
| | | */ |
| | | @Data |
| | | public class SiteDetailVo { |
| | | |
| | | // 站点编号 |
| | | private Integer siteId; |
| | | |
| | | // 工作号 |
| | | private Short workNo; |
| | | |
| | | // 工作状态 |
| | | private String wrkSts = ""; |
| | | |
| | | // 自动 |
| | | private String autoing; |
| | | |
| | | // 有物 |
| | | private String loading; |
| | | |
| | | // 能入 |
| | | private String canining; |
| | | |
| | | // 能出 |
| | | private String canouting; |
| | | |
| | | // 出入类型 |
| | | private String ioType = ""; |
| | | |
| | | // 源站 |
| | | private String sourceStaNo = ""; |
| | | |
| | | // 目标站 |
| | | private String staNo = ""; |
| | | |
| | | // 源库位 |
| | | private String sourceLocNo = ""; |
| | | |
| | | // 目标库位 |
| | | private String locNo = ""; |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.domain.vo; |
| | | |
| | | import com.zy.asrs.domain.enums.SiteStatusType; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 站点最新数据视图对象 |
| | | * Created by vincent on 2020-06-01 |
| | | */ |
| | | @Data |
| | | public class SiteLatestDataVo { |
| | | |
| | | // 站点编号 |
| | | private String siteId; |
| | | |
| | | // 工作号 |
| | | private Short workNo; |
| | | |
| | | // 站点状态 |
| | | private SiteStatusType siteStatus; |
| | | |
| | | // 隔壁站点(台车特性) |
| | | private String nearbySta; |
| | | |
| | | public String getSiteStatus() { |
| | | return siteStatus.toString().toLowerCase().replaceAll("_", "-"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.domain.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * Created by vincent on 2020-06-02 |
| | | */ |
| | | @Data |
| | | public class SiteTableVo { |
| | | |
| | | // 站号 |
| | | private Integer devNo; |
| | | |
| | | // 工作号 |
| | | private Short workNo = 0; |
| | | |
| | | // 自动 |
| | | private String autoing = "-"; |
| | | |
| | | // 有物 |
| | | private String loading = "-"; |
| | | |
| | | // 可入 |
| | | private String inEnable = "-"; |
| | | |
| | | // 可出 |
| | | private String outEnable = "-"; |
| | | |
| | | // 需求1 |
| | | private String pakMk = "-"; |
| | | |
| | | // 空板信号 |
| | | private String emptyMk = "-"; |
| | | |
| | | // 目标站 |
| | | private Short staNo = 0; |
| | | |
| | | //高低库位 |
| | | private String locType1 = "-"; |
| | | } |
| | |
| | | // 托盘条码 |
| | | private String barcode; |
| | | |
| | | private String boxType1; |
| | | |
| | | //站点 |
| | | private String station; |
| | | |
| | |
| | | private String standby1 = ""; |
| | | private String standby2 = ""; |
| | | private String standby3 = ""; |
| | | private String suppCode = ""; |
| | | |
| | | private String boxType1 = "1"; |
| | | private String boxType2 = "1"; |
| New file |
| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class QueryCombParam { |
| | | |
| | | private String barcode; |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class QueryTaskParam { |
| | | |
| | | private String taskNo; |
| | | |
| | | } |
| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | |
| | | |
| | | // 数量 |
| | | private Double count; |
| | | |
| | | private String brand; |
| | | |
| | | /** |
| | | * 备用1 |
| | | */ |
| | | @ApiModelProperty(value= "备用1") |
| | | private String standby1 = ""; |
| | | |
| | | /** |
| | | * 备用2 |
| | | */ |
| | | @ApiModelProperty(value= "备用2") |
| | | private String standby2 = ""; |
| | | |
| | | /** |
| | | * 备用3 |
| | | */ |
| | | @ApiModelProperty(value= "备用3") |
| | | private String standby3 = ""; |
| | | |
| | | /** |
| | | * 备用1 |
| | | */ |
| | | @ApiModelProperty(value= "备用1") |
| | | @TableField("box_type1") |
| | | private String boxType1 = "1"; |
| | | |
| | | /** |
| | | * 备用2 |
| | | */ |
| | | @ApiModelProperty(value= "备用2") |
| | | @TableField("box_type2") |
| | | private String boxType2 = "1"; |
| | | |
| | | /** |
| | | * 备用3 |
| | | */ |
| | | @ApiModelProperty(value= "备用3") |
| | | @TableField("box_type3") |
| | | private String boxType3 = "1"; |
| | | |
| | | } |
| | | |
| New file |
| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @ApiModel(value = "TvQueryParam", description = "TV查询参数") |
| | | public class TvQueryParam implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty("任务号") |
| | | private String taskNo; |
| | | |
| | | @ApiModelProperty("任务类型") |
| | | private String taskType; |
| | | |
| | | |
| | | } |
| | |
| | | //不分页查询所有信息,用于excel导出 |
| | | public List<ViewStayTimeBean> getViewStayTimeAll(ViewStayTimeBean viewStayTime); |
| | | |
| | | // // 库位Map |
| | | //// // 库位Map |
| | | // @Select("select distinct row1 from asr_loc_mast order by row1 asc") |
| | | // List<Integer> getViewLocRowTotal(); |
| | | // // 库位Map |
| | | @Select("select distinct row1 from asr_loc_mast order by row1 asc") |
| | | List<Integer> getViewLocRowTotal(); |
| | | |
| | |
| | | |
| | | int deleteItem(@Param("wrkNo")Integer wrkNo, @Param("matnr")String matnr, @Param("batch")String batch); |
| | | |
| | | int updateAnfme(@Param("anfme")Double anfme, @Param("wrkNo")Integer wrkNo, @Param("matnr")String matnr, @Param("batch")String batch); |
| | | int updateAnfme(@Param("anfme")Double anfme, @Param("wrkNo")Integer wrkNo, @Param("matnr")String matnr, @Param("suppCode")String suppCode); |
| | | |
| | | List<WrkDetl> selectAndLogByOrderNo(String orderNo); |
| | | |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | |
| | | // todo 盘点记录、保存调整记录 |
| | | // 修改明细 |
| | | if (!wrkDetlService.updateAnfme(wrkDetl1.getAnfme(), wrkMast.getWrkNo(), wrkDetl.getMatnr(), |
| | | wrkDetl.getBatch())) { |
| | | wrkDetl.getSuppCode())) { |
| | | throw new CoolException(wrkMast.getWrkNo() + "盘点任务," + wrkDetl.getMatnr() + "商品," |
| | | + wrkDetl.getBatch() + "批号修改数量失败"); |
| | | + wrkDetl.getSuppCode() + "批号修改数量失败"); |
| | | } |
| | | } |
| | | iterator.remove(); |
| | |
| | | // 删除明细 |
| | | for (WrkDetl wrkDetl : wrkDetls) { |
| | | // todo 盘点记录、保存调整记录 |
| | | if (!wrkDetlService.updateAnfme(-1.0D, wrkMast.getWrkNo(), wrkDetl.getMatnr(), wrkDetl.getBatch())) { |
| | | if (!wrkDetlService.updateAnfme(-1.0D, wrkMast.getWrkNo(), wrkDetl.getMatnr(), wrkDetl.getSuppCode())) { |
| | | throw new CoolException("删除" + wrkMast.getWrkNo() + "盘点任务," + wrkDetl.getMatnr() + "商品," |
| | | + wrkDetl.getBatch() + "批号任务明细失败"); |
| | | } |
| | |
| | | generateCacheOutTask(station, locCache, userId); |
| | | |
| | | /**生成立库出库任务*/ |
| | | // generateCRNOutTask(station, locCache, userId); |
| | | generateCRNOutTask(station, locCache, userId); |
| | | |
| | | return R.ok(); |
| | | } |
| | |
| | | if (Objects.isNull(param.getBarcode())) { |
| | | throw new CoolException("托盘码不能为空!!"); |
| | | } |
| | | |
| | | if (Objects.isNull(param.getCombMats()) || param.getCombMats().isEmpty()) { |
| | | throw new CoolException("组托明细不能为空!!"); |
| | | } |
| | | // 判断是否有相同条码的数据 |
| | | if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode()) |
| | | .eq("io_status", "N")) > 0) { |
| | | throw new CoolException(param.getBarcode() + "数据正在进行入库"); |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>() |
| | | .eq("wrk_sts", 14) |
| | | .eq("io_type", 104) |
| | | .eq("barcode", param.getBarcode())); |
| | | if (Objects.isNull(wrkMast)) { |
| | | throw new CoolException("任务档信息不存在!!"); |
| | | } |
| | | |
| | | int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet", param.getBarcode())); |
| | | int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet", param.getBarcode())); |
| | | if (countWrk > 0 || countLoc > 0) { |
| | | WrkMast wrkDetl = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", param.getBarcode())); |
| | | if (!wrkDetl.getIoType().equals(TaskIOType.MERGE_OUT.type)) { |
| | | throw new CoolException("组托档/工作档/库存条码数据已存在===>>" + param.getBarcode()); |
| | | } |
| | | } |
| | | int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode())); |
| | | if (countwait > 0) { |
| | | throw new CoolException("组托档/工作档/库存条码数据已存在===>>" + param.getBarcode()); |
| | | } |
| | | |
| | | // 生成入库通知档 |
| | | List<DetlDto> detlDtos = new ArrayList<>(); |
| | | param.getCombMats().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(), elem.getThreeCode()); |
| | | if (DetlDto.has(detlDtos, detlDto)) { |
| | | DetlDto one = DetlDto.findDto(detlDtos, detlDto); |
| | | assert one != null; |
| | | one.setAnfme(one.getAnfme() + detlDto.getAnfme()); |
| | | } else { |
| | | detlDtos.add(detlDto); |
| | | } |
| | | }); |
| | | BasContainer container = basContainerService |
| | | .selectOne(new EntityWrapper<BasContainer>().eq("barcode", param.getBarcode())); |
| | | if (Objects.isNull(container)) { |
| | | throw new CoolException("数据错误:容器码不存在!!"); |
| | | } |
| | | if (container.getMixMax() < detlDtos.size()) { |
| | | throw new CoolException("超出容器最大混装数量,当前容器最大数量为:" + container.getMixMax() + "!!"); |
| | | } |
| | | List<Mat> tempMats = new ArrayList<>(); |
| | | for (DetlDto detlDto : detlDtos) { |
| | | Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", detlDto.getMatnr()) |
| | | .eq("supp_code", detlDto.getStandby1())); |
| | | tempMats.add(mat); |
| | | } |
| | | Set<Long> tagIds = tempMats.stream().map(Mat::getTagId).collect(Collectors.toSet()); |
| | | if (tagIds.size() > 1) { |
| | | throw new CoolException("组托物料类型不一致,只有相同的物料分类才可以组托!!"); |
| | | } |
| | | // 还可以放入多少种物料 |
| | | Double suplus = container.getMixMax(); |
| | | Date now = new Date(); |
| | | for (DetlDto detlDto : detlDtos) { |
| | | Mat mat = matService.selectByMatnr(detlDto.getMatnr()); |
| | | if (Cools.isEmpty(mat)) { |
| | | throw new CoolException(detlDto.getMatnr() + "商品档案不存在"); |
| | | } |
| | | // 最多可放数量 |
| | | Double singleMax = mat.getUpQty() * suplus; |
| | | if (singleMax.compareTo(detlDto.getAnfme()) < 0) { |
| | | throw new CoolException("物料:" + detlDto.getMatnr() + "单次组托上限为:" + mat.getUpQty() + ",当前总量超出托盘装载上限!!"); |
| | | } |
| | | BigDecimal decimal = new BigDecimal(detlDto.getAnfme() / mat.getUpQty()); |
| | | // 当前物料需要占用料箱格数 |
| | | Integer curr = decimal.setScale(0, RoundingMode.CEILING).intValue(); |
| | | suplus = suplus - curr; |
| | | if (suplus < 0) { |
| | | throw new CoolException("物料:" + detlDto.getMatnr() + ", 超出当前托盘装载上限!!"); |
| | | } |
| | | |
| | | for (CombParam.CombMat combMat : param.getCombMats()) { |
| | | BasStationDetl stationDetl = basStationDetlService.selectOne(new EntityWrapper<BasStationDetl>() |
| | | .eq("zpallet", param.getCarBarcode()) |
| | | .eq("three_code", detlDto.getThreeCode())); |
| | | .eq("three_code", combMat.getThreeCode())); |
| | | if (Objects.isNull(stationDetl)) { |
| | | throw new CoolException("明细内容不存在!!"); |
| | | } |
| | | WrkDetl wrkDetl = wrkDetlService.selectOne(new EntityWrapper<WrkDetl>() |
| | | .eq("matnr", stationDetl.getMatnr()) |
| | | .eq("wrk_no", wrkMast.getWrkNo()) |
| | | .eq("suppCode", combMat.getSuppCode())); |
| | | |
| | | Double v = Math.round((stationDetl.getAnfme() - stationDetl.getWorkQty()) * 10000) / 10000.0; |
| | | if (detlDto.getAnfme().compareTo(v) > 0) { |
| | | throw new CoolException("组托上限为:" + stationDetl.getAnfme() + ", 已组托:" + stationDetl.getWorkQty() + ", 还可组托:" + v); |
| | | } |
| | | if (Objects.isNull(wrkDetl)) { |
| | | //TODO 新插入 |
| | | Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", stationDetl.getMatnr()) |
| | | .eq("supp_code", combMat.getSuppCode())); |
| | | if (Objects.isNull(mat)) { |
| | | throw new CoolException("物料基础信息已不存在!!"); |
| | | } |
| | | WrkDetl detl = new WrkDetl(); |
| | | BeanUtils.copyProperties(stationDetl, detl); |
| | | detl.setAnfme(combMat.getAnfme()); |
| | | detl.setBarcode(wrkMast.getBarcode()); |
| | | detl.setBoxType1(combMat.getBoxType1()); |
| | | detl.setStandby1(combMat.getSuppCode()); |
| | | detl.setWrkNo(wrkMast.getWrkNo()); |
| | | |
| | | WaitPakin waitPakin = new WaitPakin(); |
| | | BeanUtils.copyProperties(mat, waitPakin); |
| | | waitPakin.setBatch(detlDto.getBatch()); |
| | | waitPakin.setType(param.getType()); |
| | | waitPakin.setZpallet(param.getBarcode()); |
| | | // 设置组托类型 |
| | | waitPakin.setType(param.getType()); |
| | | waitPakin.setIoStatus("N"); |
| | | waitPakin.setAnfme(detlDto.getAnfme()); |
| | | waitPakin.setThreeCode(detlDto.getThreeCode()); |
| | | waitPakin.setStatus("Y"); |
| | | waitPakin.setSuppCode(detlDto.getStandby1()); |
| | | waitPakin.setStandby1(detlDto.getStandby1()); |
| | | waitPakin.setStandby2(detlDto.getStandby2()); |
| | | waitPakin.setStandby3(detlDto.getStandby3()); |
| | | waitPakin.setBoxType1(detlDto.getBoxType1()); |
| | | waitPakin.setBoxType2(detlDto.getBoxType2()); |
| | | waitPakin.setBoxType3(detlDto.getBoxType3()); |
| | | waitPakin.setAppeUser(userId); |
| | | waitPakin.setAppeTime(now); |
| | | waitPakin.setModiUser(userId); |
| | | waitPakin.setModiTime(now); |
| | | if (!waitPakinService.insert(waitPakin)) { |
| | | throw new CoolException("保存入库通知档失败"); |
| | | } |
| | | |
| | | Double v1 = Math.round((stationDetl.getWorkQty() + detlDto.getAnfme()) * 10000) / 10000.0; |
| | | stationDetl.setWorkQty(v1); |
| | | |
| | | if (!basStationDetlService.updateById(stationDetl)) { |
| | | throw new CoolException("站点明细修改失败"); |
| | | } |
| | | |
| | | if (v1.compareTo(stationDetl.getAnfme()) >= 0) { |
| | | if (!basStationDetlService.deleteById(stationDetl)) { |
| | | throw new CoolException("原始数据移除失败!"); |
| | | if (!wrkDetlService.insert(detl)) { |
| | | throw new CoolException("任务明细保存失败!!"); |
| | | } |
| | | } else { |
| | | double val = Math.round((combMat.getAnfme() + wrkDetl.getAnfme()) * 10000) / 10000.0; |
| | | if (!wrkDetlService.updateAnfme(val, wrkMast.getWrkNo(), wrkDetl.getMatnr(), |
| | | wrkDetl.getSuppCode())) { |
| | | throw new CoolException(wrkMast.getWrkNo() + "盘点任务," + wrkDetl.getMatnr() + "商品," |
| | | + wrkDetl.getBatch() + "批号修改数量失败"); |
| | | } |
| | | } |
| | | |
| | | List<BasStationDetl> stas = basStationDetlService.selectList(new EntityWrapper<BasStationDetl>() |
| | | .eq("dev_no", stationDetl.getDevNo())); |
| | | if (Objects.isNull(stas) || stas.isEmpty()) { |
| | | BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", stationDetl.getDevNo())); |
| | | if (Objects.isNull(station)) { |
| | | throw new CoolException("数据错误,站点不存在!!"); |
| | | } |
| | | station.setLocSts(LocStsType.LOC_STS_TYPE_O.type); |
| | | station.setBarcode(""); |
| | | if (!basStationService.updateById(station)) { |
| | | throw new CoolException("站点状态更新失败!!"); |
| | | } |
| | | } |
| | | } |
| | | // // 判断是否有相同条码的数据 |
| | | // if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode()) |
| | | // .eq("io_status", "N")) > 0) { |
| | | // throw new CoolException(param.getBarcode() + "数据正在进行入库"); |
| | | // } |
| | | // |
| | | // int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet", param.getBarcode())); |
| | | // int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet", param.getBarcode())); |
| | | // if (countWrk > 0 || countLoc > 0) { |
| | | // WrkMast wrkDetl = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", param.getBarcode())); |
| | | // if (!wrkDetl.getIoType().equals(TaskIOType.MERGE_OUT.type)) { |
| | | // throw new CoolException("组托档/工作档/库存条码数据已存在===>>" + param.getBarcode()); |
| | | // } |
| | | // } |
| | | // int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode())); |
| | | // if (countwait > 0) { |
| | | // throw new CoolException("组托档/工作档/库存条码数据已存在===>>" + param.getBarcode()); |
| | | // } |
| | | // |
| | | // // 生成入库通知档 |
| | | // List<DetlDto> detlDtos = new ArrayList<>(); |
| | | // param.getCombMats().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(), elem.getThreeCode()); |
| | | // if (DetlDto.has(detlDtos, detlDto)) { |
| | | // DetlDto one = DetlDto.findDto(detlDtos, detlDto); |
| | | // assert one != null; |
| | | // one.setAnfme(one.getAnfme() + detlDto.getAnfme()); |
| | | // } else { |
| | | // detlDtos.add(detlDto); |
| | | // } |
| | | // }); |
| | | // BasContainer container = basContainerService |
| | | // .selectOne(new EntityWrapper<BasContainer>().eq("barcode", param.getBarcode())); |
| | | // if (Objects.isNull(container)) { |
| | | // throw new CoolException("数据错误:容器码不存在!!"); |
| | | // } |
| | | // if (container.getMixMax() < detlDtos.size()) { |
| | | // throw new CoolException("超出容器最大混装数量,当前容器最大数量为:" + container.getMixMax() + "!!"); |
| | | // } |
| | | // List<Mat> tempMats = new ArrayList<>(); |
| | | // for (DetlDto detlDto : detlDtos) { |
| | | // Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", detlDto.getMatnr()) |
| | | // .eq("supp_code", detlDto.getStandby1())); |
| | | // tempMats.add(mat); |
| | | // } |
| | | // Set<Long> tagIds = tempMats.stream().map(Mat::getTagId).collect(Collectors.toSet()); |
| | | // if (tagIds.size() > 1) { |
| | | // throw new CoolException("组托物料类型不一致,只有相同的物料分类才可以组托!!"); |
| | | // } |
| | | // // 还可以放入多少种物料 |
| | | // Double suplus = container.getMixMax(); |
| | | // Date now = new Date(); |
| | | // for (DetlDto detlDto : detlDtos) { |
| | | // Mat mat = matService.selectByMatnr(detlDto.getMatnr()); |
| | | // if (Cools.isEmpty(mat)) { |
| | | // throw new CoolException(detlDto.getMatnr() + "商品档案不存在"); |
| | | // } |
| | | // // 最多可放数量 |
| | | // Double singleMax = mat.getUpQty() * suplus; |
| | | // if (singleMax.compareTo(detlDto.getAnfme()) < 0) { |
| | | // throw new CoolException("物料:" + detlDto.getMatnr() + "单次组托上限为:" + mat.getUpQty() + ",当前总量超出托盘装载上限!!"); |
| | | // } |
| | | // BigDecimal decimal = new BigDecimal(detlDto.getAnfme() / mat.getUpQty()); |
| | | // // 当前物料需要占用料箱格数 |
| | | // Integer curr = decimal.setScale(0, RoundingMode.CEILING).intValue(); |
| | | // suplus = suplus - curr; |
| | | // if (suplus < 0) { |
| | | // throw new CoolException("物料:" + detlDto.getMatnr() + ", 超出当前托盘装载上限!!"); |
| | | // } |
| | | // |
| | | // BasStationDetl stationDetl = basStationDetlService.selectOne(new EntityWrapper<BasStationDetl>() |
| | | // .eq("zpallet", param.getCarBarcode()) |
| | | // .eq("three_code", detlDto.getThreeCode())); |
| | | // if (Objects.isNull(stationDetl)) { |
| | | // throw new CoolException("明细内容不存在!!"); |
| | | // } |
| | | // |
| | | // Double v = Math.round((stationDetl.getAnfme() - stationDetl.getWorkQty()) * 10000) / 10000.0; |
| | | // if (detlDto.getAnfme().compareTo(v) > 0) { |
| | | // throw new CoolException("组托上限为:" + stationDetl.getAnfme() + ", 已组托:" + stationDetl.getWorkQty() + ", 还可组托:" + v); |
| | | // } |
| | | // |
| | | // WaitPakin waitPakin = new WaitPakin(); |
| | | // BeanUtils.copyProperties(mat, waitPakin); |
| | | // waitPakin.setBatch(detlDto.getBatch()); |
| | | // waitPakin.setType(param.getType()); |
| | | // waitPakin.setZpallet(param.getBarcode()); |
| | | // // 设置组托类型 |
| | | // waitPakin.setType(param.getType()); |
| | | // waitPakin.setIoStatus("N"); |
| | | // waitPakin.setAnfme(detlDto.getAnfme()); |
| | | // waitPakin.setThreeCode(detlDto.getThreeCode()); |
| | | // waitPakin.setStatus("Y"); |
| | | // waitPakin.setSuppCode(detlDto.getStandby1()); |
| | | // waitPakin.setStandby1(detlDto.getStandby1()); |
| | | // waitPakin.setStandby2(detlDto.getStandby2()); |
| | | // waitPakin.setStandby3(detlDto.getStandby3()); |
| | | // waitPakin.setBoxType1(detlDto.getBoxType1()); |
| | | // waitPakin.setBoxType2(detlDto.getBoxType2()); |
| | | // waitPakin.setBoxType3(detlDto.getBoxType3()); |
| | | // waitPakin.setAppeUser(userId); |
| | | // waitPakin.setAppeTime(now); |
| | | // waitPakin.setModiUser(userId); |
| | | // waitPakin.setModiTime(now); |
| | | // if (!waitPakinService.insert(waitPakin)) { |
| | | // throw new CoolException("保存入库通知档失败"); |
| | | // } |
| | | // |
| | | // Double v1 = Math.round((stationDetl.getWorkQty() + detlDto.getAnfme()) * 10000) / 10000.0; |
| | | // stationDetl.setWorkQty(v1); |
| | | // |
| | | // if (!basStationDetlService.updateById(stationDetl)) { |
| | | // throw new CoolException("站点明细修改失败"); |
| | | // } |
| | | // |
| | | // if (v1.compareTo(stationDetl.getAnfme()) >= 0) { |
| | | // if (!basStationDetlService.deleteById(stationDetl)) { |
| | | // throw new CoolException("原始数据移除失败!"); |
| | | // } |
| | | // } |
| | | // |
| | | // List<BasStationDetl> stas = basStationDetlService.selectList(new EntityWrapper<BasStationDetl>() |
| | | // .eq("dev_no", stationDetl.getDevNo())); |
| | | // if (Objects.isNull(stas) || stas.isEmpty()) { |
| | | // BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", stationDetl.getDevNo())); |
| | | // if (Objects.isNull(station)) { |
| | | // throw new CoolException("数据错误,站点不存在!!"); |
| | | // } |
| | | // station.setLocSts(LocStsType.LOC_STS_TYPE_O.type); |
| | | // station.setBarcode(""); |
| | | // if (!basStationService.updateById(station)) { |
| | | // throw new CoolException("站点状态更新失败!!"); |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | /** |
| | |
| | | if (!Objects.isNull(mast)) { |
| | | if (mast.getIoType().equals(TaskIOType.MERGE_OUT.type) || mast.getIoType().equals(TaskIOType.PICK_OUT.type) || mast.getIoType().equals(TaskIOType.CHECK_OUT.type)) { |
| | | int ioType = mast.getIoType() - 50; |
| | | |
| | | List<WrkDetl> wrkDetls103 = wrkDetlService |
| | | .selectList(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo())); |
| | | if (wrkDetls103.isEmpty()) { |
| | | ioType = 10; |
| | | } |
| | | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", wrkMast.getSourceLocNo())); |
| | | if (!Objects.isNull(locDetls) && !locDetls.isEmpty()) { |
| | | Double sum = wrkDetls103.stream().mapToDouble(WrkDetl::getAnfme).sum(); |
| | | Double summed = locDetls.stream().mapToDouble(LocDetl::getAnfme).sum(); |
| | | if (summed.compareTo(sum) <= 0) { |
| | | ioType = 10; |
| | | } |
| | | } |
| | | mast.setIoType(ioType); |
| | | mast.setWrkSts(2L); |
| | | mast.setSourceStaNo(mast.getSourceStaNo()); |
| | |
| | | // 生成工作号 |
| | | int workNo = commonService.getWorkNo(WorkNoType.getWorkNoType(ioType)); |
| | | if (Cools.isEmpty(wrkMast1)) { |
| | | Integer outSta = devp.getDevNo(); |
| | | // Integer outSta = devp.getDevNo(); |
| | | // 获取路径 |
| | | StaDesc staDesc = staDescService.queryCrnStn(ioType, locMast.getCrnNo(), outSta); |
| | | // StaDesc staDesc = staDescService.queryCrnStn(ioType, locMast.getCrnNo(), outSta); |
| | | |
| | | // 生成工作档 |
| | | WrkMast wrkMast = new WrkMast(); |
| | |
| | | wrkMast.setIoType(ioType); // 入出库类型 |
| | | wrkMast.setIoPri(13D); // 优先级:13 |
| | | wrkMast.setCrnNo(locMast.getCrnNo()); |
| | | wrkMast.setSourceStaNo(staDesc.getCrnStn() + ""); // 源站 |
| | | wrkMast.setStaNo(staDesc.getStnNo() + ""); // 目标站 |
| | | // wrkMast.setSourceStaNo(staDesc.getCrnStn() + ""); // 源站 |
| | | // wrkMast.setStaNo(staDesc.getStnNo() + ""); // 目标站 |
| | | wrkMast.setSourceLocNo(locMast.getLocNo()); // 源库位 |
| | | //小松项目,缓存出库AGV站点,用于清空缓存区库存 |
| | | wrkMast.setPauseMk(station.getDevNo()); |
| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.core.common.SnowflakeIdWorker; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | |
| | | import com.zy.asrs.mapper.TagMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.MatUtils; |
| | | import com.zy.asrs.utils.OrderInAndOutUtil; |
| | | import com.zy.common.model.DetlDto; |
| | | import com.zy.common.utils.NodeUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | private TagMapper tagMapper; |
| | | @Autowired |
| | | private CheckOrderDetlService checkOrderDetlService; |
| | | @Autowired |
| | | private CheckOrderService checkOrderService; |
| | | |
| | | |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | now, // 添加时间 |
| | | 9527L, // 修改人员 |
| | | now, // 修改时间 |
| | | null, // 备注 |
| | | 1 |
| | | null // 备注 |
| | | ); |
| | | if (!orderService.insert(order)) { |
| | | throw new CoolException("生成单据主档失败,请联系管理员"); |
| | |
| | | List<DetlDto> list = new ArrayList<>(); |
| | | List<DetlDto> orderDetails = param.getOrderDetails(); |
| | | for (DetlDto detail : orderDetails) { |
| | | DetlDto dto = new DetlDto(detail.getMatnr(), detail.getBatch(),detail.getBrand(),detail.getStandby1(),detail.getStandby2(),detail.getStandby3(),detail.getLineNumber(),detail.getBoxType1(),detail.getBoxType2(),detail.getBoxType3(), detail.getAnfme(), detail.getThreeCode()); |
| | | if (DetlDto.hasLineNumber(list, dto)) { |
| | | DetlDto detlDto = DetlDto.findLineNumber(list, dto.getMatnr(), dto.getBatch(),dto.getBrand(),dto.getStandby1(),dto.getStandby2(),dto.getStandby3(),dto.getLineNumber(),dto.getBoxType1(),dto.getBoxType2(),dto.getBoxType3()); |
| | | DetlDto dto = new DetlDto(detail.getMatnr(), detail.getBatch(), detail.getAnfme()); |
| | | if (DetlDto.has(list, dto)) { |
| | | DetlDto detlDto = DetlDto.find(list, dto.getMatnr(), dto.getBatch()); |
| | | assert detlDto != null; |
| | | detlDto.setAnfme(detlDto.getAnfme() + detail.getAnfme()); |
| | | } else { |
| | |
| | | } |
| | | OrderDetl orderDetl = new OrderDetl(); |
| | | orderDetl.sync(mat); |
| | | orderDetl.setLineNumber(detlDto.getLineNumber()); |
| | | orderDetl.setBatch(detlDto.getBatch()); |
| | | orderDetl.setAnfme(detlDto.getAnfme()); |
| | | orderDetl.setBrand(detlDto.getBrand()); |
| | | orderDetl.setStandby1(detlDto.getStandby1()); |
| | | orderDetl.setStandby2(detlDto.getStandby2()); |
| | | orderDetl.setStandby3(detlDto.getStandby3()); |
| | | orderDetl.setOrderId(order.getId()); |
| | | orderDetl.setOrderNo(order.getOrderNo()); |
| | | orderDetl.setCreateBy(9527L); |
| | |
| | | orderDetl.setUpdateTime(now); |
| | | orderDetl.setStatus(1); |
| | | orderDetl.setQty(0.0D); |
| | | orderDetl.setPakinPakoutStatus(1); |
| | | if (!orderDetlService.insert(orderDetl)) { |
| | | throw new CoolException("生成单据明细失败,请联系管理员"); |
| | | } |
| | |
| | | if (!Cools.isEmpty(param) && !Cools.isEmpty(param.getOrderNo())) { |
| | | // 指定订单 |
| | | Order order = orderService.selectByNo(param.getOrderNo()); |
| | | |
| | | // Order order = OrderInAndOutUtil.selectByNo(Boolean.TRUE,param.getOrderNo()); |
| | | |
| | | if (null != order) { |
| | | OpenOrderCompeteResult result = new OpenOrderCompeteResult(); |
| | | results.add(result); |
| | |
| | | result.setOrderTime(order.getOrderTime()); |
| | | result.setOrderType(order.getDocType$()); |
| | | List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId()); |
| | | // List<OrderDetl> orderDetls = OrderInAndOutUtil.selectByOrderId(order.getPakinPakoutStatus$(), order.getId()); |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | result.getOrderDetails().add(new DetlDto(orderDetl.getOrderNo(), orderDetl.getMatnr(), orderDetl.getBatch(),orderDetl.getBrand(), |
| | | orderDetl.getStandby1(),orderDetl.getStandby2(),orderDetl.getStandby3(),orderDetl.getLineNumber(), |
| | | orderDetl.getBoxType1(),orderDetl.getBoxType2(),orderDetl.getBoxType3(), orderDetl.getQty(), orderDetl.getThreeCode())); |
| | | result.getOrderDetails().add(new DetlDto(orderDetl.getOrderNo(), orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getQty())); |
| | | } |
| | | if (order.getSettle() == 4L) { |
| | | // 修改订单状态 4.完成 ===>> 6.已上报 |
| | | // if (!orderService.updateSettle(order.getId(), 6L, null)) { |
| | | // throw new CoolException("服务器内部错误,请联系管理员"); |
| | | // } |
| | | OrderInAndOutUtil.updateOrder(order.getPakinPakoutStatus$(),order.getId(), 6L, null); |
| | | if (!orderService.updateSettle(order.getId(), 6L, null)) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | // 所有订单 |
| | | // List<Order> orders = orderService.selectBySettle(4L); |
| | | List<Order> orders = OrderInAndOutUtil.selectBySettle(null, 4L); |
| | | if (orders.isEmpty()){ |
| | | orders = new ArrayList<>(); |
| | | } |
| | | List<Order> orders = orderService.selectList(new EntityWrapper<Order>().eq("settle", 4L)); |
| | | for (Order order : orders) { |
| | | OpenOrderCompeteResult result = new OpenOrderCompeteResult(); |
| | | results.add(result); |
| | |
| | | result.setOrderTime(order.getOrderTime()); |
| | | result.setOrderType(order.getDocType$()); |
| | | List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId()); |
| | | // List<OrderDetl> orderDetls = OrderInAndOutUtil.selectByOrderId(order.getPakinPakoutStatus$(), order.getId()); |
| | | |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | result.getOrderDetails().add(new DetlDto(orderDetl.getOrderNo(), orderDetl.getMatnr(), orderDetl.getBatch(),orderDetl.getBrand(), |
| | | orderDetl.getStandby1(),orderDetl.getStandby2(),orderDetl.getStandby3(),orderDetl.getLineNumber(), |
| | | orderDetl.getBoxType1(),orderDetl.getBoxType2(),orderDetl.getBoxType3(), |
| | | orderDetl.getQty(), orderDetl.getThreeCode())); |
| | | result.getOrderDetails().add(new DetlDto(orderDetl.getOrderNo(), orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getQty())); |
| | | } |
| | | // // 修改订单状态 4.完成 ===>> 6.已上报 |
| | | // if (!orderService.updateSettle(order.getId(), 6L, null)) { |
| | | // throw new CoolException("服务器内部错误,请联系管理员"); |
| | | // } |
| | | OrderInAndOutUtil.updateOrder(order.getPakinPakoutStatus$(),order.getId(),6L,null); |
| | | |
| | | // 修改订单状态 4.完成 ===>> 6.已上报 |
| | | if (!orderService.updateSettle(order.getId(), 6L, null)) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | } |
| | | } |
| | | } |
| | | return results; |
| | |
| | | now, // 添加时间 |
| | | 9527L, // 修改人员 |
| | | now, // 修改时间 |
| | | null, // 备注 |
| | | 2 |
| | | null // 备注 |
| | | ); |
| | | if (!orderService.insert(order)) { |
| | | throw new CoolException("生成单据主档失败,请联系管理员"); |
| | |
| | | List<DetlDto> list = new ArrayList<>(); |
| | | List<DetlDto> orderDetails = param.getOrderDetails(); |
| | | for (DetlDto detail : orderDetails) { |
| | | DetlDto dto = new DetlDto(detail.getMatnr(), detail.getBatch(),detail.getBrand(),detail.getStandby1(),detail.getStandby2(),detail.getStandby3(),detail.getLineNumber(), |
| | | detail.getBoxType1(),detail.getBoxType2(),detail.getBoxType3(), detail.getAnfme(), detail.getThreeCode()); |
| | | if (DetlDto.hasLineNumber(list, dto)) { |
| | | DetlDto detlDto = DetlDto.findLineNumber(list, dto.getMatnr(), dto.getBatch(),dto.getBrand(),dto.getStandby1(),dto.getStandby2(),dto.getStandby3(),dto.getLineNumber(), |
| | | dto.getBoxType1(),dto.getBoxType2(),dto.getBoxType3()); |
| | | DetlDto dto = new DetlDto(detail.getMatnr(), detail.getBatch(), detail.getAnfme()); |
| | | if (DetlDto.has(list, dto)) { |
| | | DetlDto detlDto = DetlDto.find(list, dto.getMatnr(), dto.getBatch()); |
| | | assert detlDto != null; |
| | | detlDto.setAnfme(detlDto.getAnfme() + detail.getAnfme()); |
| | | } else { |
| | |
| | | } |
| | | OrderDetl orderDetl = new OrderDetl(); |
| | | orderDetl.sync(mat); |
| | | orderDetl.setLineNumber(detlDto.getLineNumber()); |
| | | orderDetl.setBatch(detlDto.getBatch()); |
| | | orderDetl.setAnfme(detlDto.getAnfme()); |
| | | orderDetl.setBrand(detlDto.getBrand()); |
| | | orderDetl.setStandby1(detlDto.getStandby1()); |
| | | orderDetl.setStandby2(detlDto.getStandby2()); |
| | | orderDetl.setStandby3(detlDto.getStandby3()); |
| | | orderDetl.setOrderId(order.getId()); |
| | | orderDetl.setOrderNo(order.getOrderNo()); |
| | | orderDetl.setCreateBy(9527L); |
| | |
| | | orderDetl.setUpdateTime(now); |
| | | orderDetl.setStatus(1); |
| | | orderDetl.setQty(0.0D); |
| | | orderDetl.setPakinPakoutStatus(2); |
| | | if (!orderDetlService.insert(orderDetl)) { |
| | | throw new CoolException("生成单据明细失败,请联系管理员"); |
| | | } |
| | |
| | | if (!Cools.isEmpty(param) && !Cools.isEmpty(param.getOrderNo())) { |
| | | // 指定订单 |
| | | Order order = orderService.selectByNo(param.getOrderNo()); |
| | | // Order order = OrderInAndOutUtil.selectByNo(Boolean.FALSE, param.getOrderNo()); |
| | | if (null != order) { |
| | | OpenOrderCompeteResult result = new OpenOrderCompeteResult(); |
| | | results.add(result); |
| | |
| | | result.setOrderTime(order.getOrderTime()); |
| | | result.setOrderType(order.getDocType$()); |
| | | List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId()); |
| | | // List<OrderDetl> orderDetls = OrderInAndOutUtil.selectByOrderId(order.getPakinPakoutStatus$(),order.getId()); |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | result.getOrderDetails().add(new DetlDto(orderDetl.getOrderNo(), orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getBrand(), |
| | | orderDetl.getStandby1(),orderDetl.getStandby2(),orderDetl.getStandby3(),orderDetl.getLineNumber(), |
| | | orderDetl.getBoxType1(),orderDetl.getBoxType2(),orderDetl.getBoxType3(), orderDetl.getQty(), orderDetl.getThreeCode())); |
| | | result.getOrderDetails().add(new DetlDto(orderDetl.getOrderNo(), orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getQty())); |
| | | } |
| | | if (order.getSettle() == 4L) { |
| | | // 修改订单状态 4.完成 ===>> 6.已上报 |
| | | // if (!orderService.updateSettle(order.getId(), 6L, null)) { |
| | | // throw new CoolException("服务器内部错误,请联系管理员"); |
| | | // } |
| | | OrderInAndOutUtil.updateOrder(order.getPakinPakoutStatus$(),order.getId(),6L,null); |
| | | if (!orderService.updateSettle(order.getId(), 6L, null)) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | // 所有订单 |
| | | // List<Order> orders = orderService.selectList(new EntityWrapper<Order>().eq("settle", 4L)); |
| | | List<Order> orders = OrderInAndOutUtil.selectBySettle(null, 4L); |
| | | List<Order> orders = orderService.selectList(new EntityWrapper<Order>().eq("settle", 4L)); |
| | | for (Order order : orders) { |
| | | OpenOrderCompeteResult result = new OpenOrderCompeteResult(); |
| | | results.add(result); |
| | |
| | | result.setOrderTime(order.getOrderTime()); |
| | | result.setOrderType(order.getDocType$()); |
| | | List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId()); |
| | | // List<OrderDetl> orderDetls = OrderInAndOutUtil.selectByOrderId(order.getPakinPakoutStatus$(), order.getId()); |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | result.getOrderDetails().add(new DetlDto(orderDetl.getOrderNo(), orderDetl.getMatnr(), orderDetl.getBatch(),orderDetl.getBrand(), |
| | | orderDetl.getStandby1(),orderDetl.getStandby2(),orderDetl.getStandby3(),orderDetl.getLineNumber(), |
| | | orderDetl.getBoxType1(),orderDetl.getBoxType2(),orderDetl.getBoxType3(), orderDetl.getQty(), orderDetl.getThreeCode())); |
| | | result.getOrderDetails().add(new DetlDto(orderDetl.getOrderNo(), orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getQty())); |
| | | } |
| | | // 修改订单状态 4.完成 ===>> 6.已上报 |
| | | // if (!orderService.updateSettle(order.getId(), 6L, null)) { |
| | | // throw new CoolException("服务器内部错误,请联系管理员"); |
| | | // } |
| | | OrderInAndOutUtil.updateOrder(order.getPakinPakoutStatus$(),order.getId(),6L,null); |
| | | if (!orderService.updateSettle(order.getId(), 6L, null)) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | } |
| | | } |
| | | } |
| | | return results; |
| | |
| | | tagId = tagService.getTop().getId(); |
| | | } |
| | | mat.setTagId(tagId); |
| | | mat.setLocType(tagId); |
| | | mat.setMatnr(analyse.getMatnr()); |
| | | mat.setMaktx(param.getMaterialName()); |
| | | mat.setSpecs(param.getConfigureDesc()); |
| | |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | } else { |
| | | log.info("打包上线添加新物料[商品编号:{}]", mat.getMatnr()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void adjustmentOrderCreate(OpenAdjustmentOrderParam param) { |
| | | if(Cools.isEmpty(param.getOrderNo())){ |
| | | String prefix = ""; |
| | | DocType docType = docTypeService.selectById(param.getOrderNo()); |
| | | if(!Cools.isEmpty(docType)){ |
| | | prefix = "Adjust"; |
| | | } |
| | | param.setOrderNo(prefix + snowflakeIdWorker.nextId()); |
| | | } |
| | | CheckOrder checkOrder = checkOrderService.selectOne(new EntityWrapper<CheckOrder>().eq("order_no", param.getOrderNo()) ); |
| | | if (checkOrder != null) { |
| | | throw new CoolException("单据已存在"); |
| | | } |
| | | Date now = new Date(); |
| | | checkOrder = new CheckOrder(); |
| | | checkOrder.setOrderNo(param.getOrderNo()); |
| | | checkOrder.setUuid(String.valueOf(snowflakeIdWorker.nextId())); |
| | | checkOrder.setOrderTime( DateUtils.convert(now)); |
| | | checkOrder.setDocType(Long.valueOf(OrderTypeEnum.ADJUSTMENT.type)); |
| | | checkOrder.setSettle(1L); |
| | | checkOrder.setCreateBy(9527L); |
| | | checkOrder.setCreateTime(now); |
| | | checkOrder.setUpdateBy(9527L); |
| | | checkOrder.setUpdateTime(now); |
| | | checkOrder.setStatus(1); |
| | | |
| | | if (!checkOrderService.insert(checkOrder)) { |
| | | throw new CoolException("保存调整单主单失败"); |
| | | } |
| | | for (CheckOrderDetl checkOrderDetl1 : param.getOrderDetails()) { |
| | | LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>() |
| | | .eq("matnr", checkOrderDetl1.getMatnr()) |
| | | .eq("loc_no", checkOrderDetl1.getLocNo()) |
| | | .eq("batch", checkOrderDetl1.getBatch()) |
| | | ); |
| | | if (Cools.isEmpty(locDetl)) { |
| | | throw new CoolException("未找到库存明细,请检查库存"); |
| | | } |
| | | CheckOrderDetl checkOrderDetl = new CheckOrderDetl(); |
| | | checkOrderDetl.sync(locDetl); |
| | | checkOrderDetl.setLocDetlId(locDetl.getId()); |
| | | checkOrderDetl.setOrderId(checkOrder.getId()); |
| | | checkOrderDetl.setOrderNo(checkOrder.getOrderNo()); |
| | | checkOrderDetl.setAnfme(checkOrderDetl1.getAnfme()); |
| | | checkOrderDetl.setDiffQty(checkOrderDetl1.getDiffQty()); |
| | | checkOrderDetl.setWorkQty(checkOrderDetl1.getWorkQty()); |
| | | checkOrderDetl.setStatus(checkOrderDetl1.getStatus().equals(1)? CheckStatusEnum.ALLOW.type:CheckStatusEnum.FORBID.type); |
| | | checkOrderDetl.setZpallet(locDetl.getZpallet()); |
| | | checkOrderDetl.setCreateTime(now); |
| | | checkOrderDetl.setUpdateTime(now); |
| | | if (!checkOrderDetlService.insert(checkOrderDetl)) { |
| | | throw new CoolException("保存调整单明细失败"); |
| | | } |
| | | } |
| | | } |
| | |
| | | } else { |
| | | tagId = tagService.getTop().getId(); |
| | | } |
| | | mat.sync(matParam); |
| | | mat.sync(param); |
| | | // mat.setMatnr(param.getMatnr()); |
| | | // mat.setMaktx(param.getMaktx()); |
| | | // mat.setSpecs(param.getSpecs()); |
| | | // mat.setModel(param.getModel()); |
| | | |
| | | mat.setTagId(tagId); |
| | | mat.setLocType(tagId); |
| | | mat.setStatus(1); |
| | | mat.setCreateTime(now); |
| | | mat.setUpdateTime(now); |
| | |
| | | log.info("同步新物料[商品编号:{}]", mat.getMatnr()); |
| | | } |
| | | } else { |
| | | mat.sync(matParam); |
| | | mat.sync(param); |
| | | if (!matService.update(mat, new EntityWrapper<Mat>().eq("matnr",matParam.getMatnr()))) { |
| | | throw new CoolException("更新已存在商品信息失败,请联系管理员"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void adjustmentOrderCreate(OpenAdjustmentOrderParam param) { |
| | | if(Cools.isEmpty(param.getOrderNo())){ |
| | | String prefix = ""; |
| | | DocType docType = docTypeService.selectById(param.getOrderNo()); |
| | | if(!Cools.isEmpty(docType)){ |
| | | prefix = "Adjust"; |
| | | } |
| | | param.setOrderNo(prefix + snowflakeIdWorker.nextId()); |
| | | } |
| | | CheckOrder checkOrder = checkOrderService.selectOne(new EntityWrapper<CheckOrder>().eq("order_no", param.getOrderNo()) ); |
| | | if (checkOrder != null) { |
| | | throw new CoolException("单据已存在"); |
| | | } |
| | | Date now = new Date(); |
| | | checkOrder = new CheckOrder(); |
| | | checkOrder.setOrderNo(param.getOrderNo()); |
| | | checkOrder.setUuid(String.valueOf(snowflakeIdWorker.nextId())); |
| | | checkOrder.setOrderTime( DateUtils.convert(now)); |
| | | checkOrder.setDocType(Long.valueOf(OrderTypeEnum.ADJUSTMENT.type)); |
| | | checkOrder.setSettle(1L); |
| | | checkOrder.setCreateBy(9527L); |
| | | checkOrder.setCreateTime(now); |
| | | checkOrder.setUpdateBy(9527L); |
| | | checkOrder.setUpdateTime(now); |
| | | checkOrder.setStatus(1); |
| | | |
| | | if (!checkOrderService.insert(checkOrder)) { |
| | | throw new CoolException("保存调整单主单失败"); |
| | | } |
| | | for (CheckOrderDetl checkOrderDetl1 : param.getOrderDetails()) { |
| | | LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>() |
| | | .eq("matnr", checkOrderDetl1.getMatnr()) |
| | | .eq("loc_no", checkOrderDetl1.getLocNo()) |
| | | .eq("batch", checkOrderDetl1.getBatch()) |
| | | ); |
| | | if (Cools.isEmpty(locDetl)) { |
| | | throw new CoolException("未找到库存明细,请检查库存"); |
| | | } |
| | | CheckOrderDetl checkOrderDetl = new CheckOrderDetl(); |
| | | checkOrderDetl.sync(locDetl); |
| | | checkOrderDetl.setLocDetlId(locDetl.getId()); |
| | | checkOrderDetl.setOrderId(checkOrder.getId()); |
| | | checkOrderDetl.setOrderNo(checkOrder.getOrderNo()); |
| | | checkOrderDetl.setAnfme(checkOrderDetl1.getAnfme()); |
| | | checkOrderDetl.setDiffQty(checkOrderDetl1.getDiffQty()); |
| | | checkOrderDetl.setWorkQty(checkOrderDetl1.getWorkQty()); |
| | | checkOrderDetl.setStatus(checkOrderDetl1.getStatus().equals(1)?CheckStatusEnum.ALLOW.type:CheckStatusEnum.FORBID.type); |
| | | checkOrderDetl.setZpallet(locDetl.getZpallet()); |
| | | checkOrderDetl.setCreateTime(now); |
| | | checkOrderDetl.setUpdateTime(now); |
| | | if (!checkOrderDetlService.insert(checkOrderDetl)) { |
| | | throw new CoolException("保存调整单明细失败"); |
| | | } |
| | | } |
| | | |
| | |
| | | String orderNo = taskDto.getLocDtos().get(0).getOrderNo(); |
| | | // OrderPakout orderPakout = orderPakOutService.selectByNo(orderNo); |
| | | |
| | | int ioType = (taskDto.isAll() ? 101 : 103); |
| | | // int ioType = (taskDto.isAll() ? 101 : 103); |
| | | int ioType = 103; |
| | | if (ioType == 101) { |
| | | boolean DiffQty = taskDto.getLocDtos().stream().allMatch(locDto -> |
| | | locDetlService.selectOne(new EntityWrapper<LocDetl>() |
| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateAnfme(Double anfme, Integer wrkNo, String matnr, String batch) { |
| | | public boolean updateAnfme(Double anfme, Integer wrkNo, String matnr, String suppCode) { |
| | | if (anfme <= 0) { |
| | | return this.baseMapper.deleteItem(wrkNo, matnr, batch) > 0; |
| | | return this.baseMapper.deleteItem(wrkNo, matnr, suppCode) > 0; |
| | | } else { |
| | | return baseMapper.updateAnfme(anfme, wrkNo, matnr, batch) > 0; |
| | | return baseMapper.updateAnfme(anfme, wrkNo, matnr, suppCode) > 0; |
| | | } |
| | | } |
| | | |
| | |
| | | } catch (Exception ignore) { |
| | | |
| | | } |
| | | |
| | | } |
| | | // 修改库位状态 Q ====>> F |
| | | if (locMast.getLocSts().equals("Q")) { |
| | |
| | | } |
| | | } |
| | | break; |
| | | // case 103: |
| | | case 103: |
| | | // List<WrkDetl> wrkDetls103 = wrkDetlService |
| | | // .selectList(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo())); |
| | | // if (wrkDetls103.isEmpty()) { |
| | |
| | | // return FAIL.setMsg("全板出库 ===>> 工作明细档为空; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" |
| | | // + wrkMast.getSourceLocNo() + "]"); |
| | | // } |
| | | // |
| | | |
| | | // for (WrkDetl wrkDetl : wrkDetls103) { |
| | | // // 更新订单完成数量 |
| | | // OrderDetlPakout orderDetlPakout = orderDetlPakoutService.selectItem(wrkDetl.getOrderNo(), |
| | |
| | | // log.error(ignore.getMessage()); |
| | | // } |
| | | // } |
| | | // break; |
| | | break; |
| | | // 并板途中捡料 |
| | | case 108: |
| | | // 根据工作号,查询工作明细档 |
| | |
| | | station.setLocSts(LocStsType.LOC_STS_TYPE_O.type); |
| | | } |
| | | station.setBarcode(""); |
| | | basStationService.updateById(station); |
| | | if (!basStationService.updateById(station)) { |
| | | basStationDetlService.delete(new EntityWrapper<BasStationDetl>().eq("dev_no", station.getDevNo())); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | public static final String AGV_URL = "http://192.168.238.202/rcs/rtas/api/robot/controller"; |
| | | |
| | | //WCS系统接口地址 |
| | | // public static final String WCS_URL = "http://192.168.238.32:9090/wcs"; |
| | | public static final String WCS_URL = "http://192.168.238.32:9090/wcs"; |
| | | |
| | | public static final String WCS_URL = "http://192.168.238.31:9090/wcs"; |
| | | // public static final String WCS_URL = "http://192.168.238.31:9090/wcs"; |
| | | |
| | | //上架派工单反馈 |
| | | public static final String IN_DISPATCH_RESULT = "getInDispatchResult"; |
| | |
| | | |
| | | logger.info("++++++++ 许可证加载标记,搜索修改 ++++++++"); |
| | | licenseTimer.setSystemSupport(true); |
| | | // licenseTimer.setLicenseDays(9999); |
| | | // return true; |
| | | licenseTimer.setLicenseDays(9999); |
| | | return true; |
| | | |
| | | licenseTimer.setSystemSupport(install!=null); |
| | | |
| | | if (install != null) { |
| | | Date start = new Date(); |
| | | Date end = install.getNotAfter(); |
| | | Long starTime = start.getTime(); |
| | | Long endTime = end.getTime(); |
| | | Long num = endTime - starTime;//时间戳相差的毫秒数 |
| | | int day = (int) (num / 24 / 60 / 60 / 1000); |
| | | licenseTimer.setLicenseDays(day); |
| | | } |
| | | // licenseTimer.setSystemSupport(install!=null); |
| | | // |
| | | // if (install != null) { |
| | | // Date start = new Date(); |
| | | // Date end = install.getNotAfter(); |
| | | // Long starTime = start.getTime(); |
| | | // Long endTime = end.getTime(); |
| | | // Long num = endTime - starTime;//时间戳相差的毫秒数 |
| | | // int day = (int) (num / 24 / 60 / 60 / 1000); |
| | | // licenseTimer.setLicenseDays(day); |
| | | // } |
| | | |
| | | |
| | | return install != null; |
| | | // return install != null; |
| | | } catch (Exception e) { |
| | | return false; |
| | | } |
| | |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | username: sa |
| | | password: sa@123 |
| | | url: jdbc:sqlserver://192.168.238.31:1433;databasename=jsxsasrs |
| | | url: jdbc:sqlserver://192.168.238.32:1433;databasename=jsxsasrs |
| | | # url: jdbc:sqlserver://192.168.4.34:1433;databasename=jsxsasrs |
| | | mvc: |
| | | static-path-pattern: /** |
| | |
| | | |
| | | #License相关配置 |
| | | license: |
| | | subject: jsxsasrs |
| | | subject: jsxswms |
| | | publicAlias: publicCert |
| | | storePass: public_zhongyang_123456789 |
| | | licensePath: license.lic |
| | |
| | | |
| | | #KOPEN小松平台 |
| | | kopen: |
| | | # url: webservice.kopen.com.cn |
| | | url: 10.143.23.26 |
| | | url: webservice.kopen.com.cn |
| | | # url: 10.143.23.26 |
| | | port: 1482 |
| | | prefix: /kc-api/api/wms |
| | | |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="standbyAll"> |
| | | <choose> |
| | | <when test="batch != null and batch != ''"> |
| | | and batch = #{batch} |
| | | </when> |
| | | <otherwise> |
| | | and (batch IS NULL OR batch = '') |
| | | </otherwise> |
| | | </choose> |
| | | <!-- <choose>--> |
| | | <!-- <when test="batch != null and batch != ''">--> |
| | | <!-- and batch = #{batch}--> |
| | | <!-- </when>--> |
| | | <!-- <otherwise>--> |
| | | <!-- and (batch IS NULL OR batch = '')--> |
| | | <!-- </otherwise>--> |
| | | <!-- </choose>--> |
| | | <!-- <choose>--> |
| | | <!-- <when test="brand != null and brand != ''">--> |
| | | <!-- and brand = #{brand}--> |
| | |
| | | <when test="standby1 != null and standby1 != ''"> |
| | | and standby1 = #{standby1} |
| | | </when> |
| | | <otherwise> |
| | | and (standby1 IS NULL OR standby1 = '') |
| | | </otherwise> |
| | | </choose> |
| | | <!-- <choose>--> |
| | | <!-- <when test="standby2 != null and standby2 != ''">--> |
| | |
| | | |
| | | <sql id="batchSeq"> |
| | | <choose> |
| | | <when test="batch != null and batch != ''"> |
| | | and batch = #{batch} |
| | | <when test="suppCode != null and suppCode != ''"> |
| | | and supp_code = #{suppCode} |
| | | </when> |
| | | <otherwise> |
| | | and (batch IS NULL OR batch = '') |
| | | </otherwise> |
| | | </choose> |
| | | </sql> |
| | | |