pom.xml
@@ -124,7 +124,7 @@ </dependencies> <build> <finalName>fyxcwms</finalName> <finalName>wms</finalName> <plugins> <plugin> <groupId>org.springframework.boot</groupId> src/main/java/com/zy/asrs/controller/LocDetlController.java
@@ -17,7 +17,6 @@ import com.zy.asrs.mapper.LocDetlMapper; import com.zy.asrs.service.LocDetlService; import com.zy.asrs.service.MatService; import com.zy.common.utils.RoleUtils; import com.zy.common.web.BaseController; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -146,8 +145,6 @@ excludeTrash(param); convert(param, wrapper); allLike(LocDetl.class, param.keySet(), wrapper, condition); // 不同继承角色显示不同库信息 RoleUtils.addRoleWrapperByLocNo(getUserId(), wrapper); if (!Cools.isEmpty(orderByField)) { wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); } src/main/java/com/zy/asrs/controller/LocMastController.java
@@ -19,7 +19,6 @@ import com.zy.asrs.service.LocMastService; import com.zy.common.entity.Parameter; import com.zy.common.model.Shelves; import com.zy.common.utils.RoleUtils; import com.zy.common.web.BaseController; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -66,8 +65,6 @@ excludeTrash(param); EntityWrapper<LocMast> wrapper = new EntityWrapper<>(); convert(param, wrapper); // 不同继承角色显示不同库信息 RoleUtils.addRoleWrapperByCrn(getUserId(), wrapper); if (!Cools.isEmpty(orderByField)) { wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); } src/main/java/com/zy/asrs/controller/MatController.java
@@ -17,9 +17,6 @@ import com.zy.asrs.service.MatService; import com.zy.asrs.service.MobileService; import com.zy.asrs.service.OrderDetlService; import com.zy.asrs.third.CodeDataParam; import com.zy.asrs.third.CodeParam; import com.zy.asrs.third.TokenUtils; import com.zy.asrs.utils.MatExcelListener; import com.zy.common.CodeRes; import com.zy.common.config.AdminInterceptor; @@ -98,27 +95,7 @@ return R.ok(matService.selectOne(new EntityWrapper<Mat>().eq("matnr", matnr))); } @RequestMapping(value = "/mat/tiaoma/auth") @ManagerAuth public synchronized R findByTiaoMa(@RequestParam("matnr") String matnr, @RequestParam(required = false, value = "orderNo") String orderNo) { List<CodeDataParam> data = mobileService.getData(TokenUtils.getToken(url), new CodeParam(Arrays.asList(matnr))); if (data == null || data.isEmpty()) { return R.error("条码不存在"); } CodeDataParam codeDataParam = data.get(0); if (!Cools.isEmpty(orderNo)) { List<OrderDetl> orderDetls = orderDetlService.selectList(new EntityWrapper<OrderDetl>().eq("order_no", orderNo).eq("matnr", codeDataParam.getProductionCode())); if (orderDetls.isEmpty()) { return R.error("该商品不存在在单据中"); } } Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", codeDataParam.getProductionCode())); mat.setMatnr(codeDataParam.getProductionCode()); mat.setSafeQty(codeDataParam.getQty()); mat.setUnit(codeDataParam.getBatchNum()); mat.setMemo(matnr); return R.ok(mat); } @RequestMapping(value = "/mat/list/auth") @ManagerAuth src/main/java/com/zy/asrs/controller/WrkDetlController.java
@@ -12,7 +12,6 @@ import com.core.common.R; import com.zy.asrs.entity.WrkDetl; import com.zy.asrs.service.WrkDetlService; import com.zy.common.utils.RoleUtils; import com.zy.common.web.BaseController; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -51,8 +50,6 @@ } else { wrapper.orderBy("appe_time", false); } // 不同继承角色显示不同库信息 RoleUtils.addRoleWrapperByBarcode(getUserId(), wrapper); return R.ok(wrkDetlService.selectPage(new Page<>(curr, limit), wrapper)); } src/main/java/com/zy/asrs/controller/WrkDetlLogController.java
@@ -12,7 +12,6 @@ import com.core.common.R; import com.zy.asrs.entity.WrkDetlLog; import com.zy.asrs.service.WrkDetlLogService; import com.zy.common.utils.RoleUtils; import com.zy.common.web.BaseController; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -90,46 +89,7 @@ } else { wrapper.orderBy("appe_time", false); } // 不同继承角色显示不同库信息 RoleUtils.addRoleWrapperByBarcode(getUserId(), wrapper); return R.ok(wrkDetlLogService.selectPage(new Page<>(curr, limit), wrapper)); // Integer wrkNo = null; // String orderNo = null; // String matnr = null; // String specs = null; // String zpallet = null; // String batch = null; // Double anfme = null; // Date modiTimeStart = null, modiTimeEnd = null; // for (Map.Entry<String, Object> entry : param.entrySet()) { // String val = String.valueOf(entry.getValue()); // if (Cools.isEmpty(val)) { // continue; // } // if (val.contains(RANGE_TIME_LINK)) { // String[] dates = val.split(RANGE_TIME_LINK); // modiTimeStart = DateUtils.convert(dates[0]); // modiTimeEnd = DateUtils.convert(dates[1]); // } else if (entry.getKey().equals("wrk_no")) { // wrkNo = Integer.parseInt(val); // } else if (entry.getKey().equals("order_no")) { // orderNo = val; // } else if (entry.getKey().equals("specs")) { // specs = val; // } else if (entry.getKey().equals("zpallet")) { // zpallet = val; // } else if (entry.getKey().equals("batch")) { // batch = val; // } else if (entry.getKey().equals("anfme")) { // anfme = Double.parseDouble(val); // }else if (entry.getKey().equals("matnr")) { // matnr = val; // } // } // List<WrkDetlLog> wrkDetlLogs = wrkDetlLogService.selectWrkDetlLogs(wrkNo, orderNo,matnr,specs,zpallet,batch,anfme, modiTimeStart, modiTimeEnd, curr, limit); // Page<WrkDetlLog> page1 = new Page<WrkDetlLog>(curr, limit).setRecords(wrkDetlLogs); // page1.setTotal(wrkDetlLogService.selectWrkDetlLogsTotal(wrkNo, orderNo,matnr,specs,zpallet,batch,anfme, modiTimeStart, modiTimeEnd)); // return R.ok(page1); } catch (Exception e) { return R.error("异常" + e); } src/main/java/com/zy/asrs/controller/WrkMastController.java
@@ -12,7 +12,6 @@ import com.core.common.R; import com.zy.asrs.entity.WrkMast; import com.zy.asrs.service.WrkMastService; import com.zy.common.utils.RoleUtils; import com.zy.common.web.BaseController; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -51,8 +50,6 @@ } else { wrapper.orderBy("io_time", false); } // 不同继承角色显示不同库信息 RoleUtils.addRoleWrapperByCrn(getUserId(), wrapper); return R.ok(wrkMastService.selectPage(new Page<>(curr, limit), wrapper)); } src/main/java/com/zy/asrs/controller/WrkMastLogController.java
@@ -12,7 +12,6 @@ import com.core.common.R; import com.zy.asrs.entity.WrkMastLog; import com.zy.asrs.service.WrkMastLogService; import com.zy.common.utils.RoleUtils; import com.zy.common.web.BaseController; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -54,8 +53,6 @@ } else { wrapper.orderBy("modi_time", false); } // 不同继承角色显示不同库信息 RoleUtils.addRoleWrapperByCrn(getUserId(), wrapper); return R.ok(wrkMastLogService.selectPage(new Page<>(curr, limit), wrapper)); } src/main/java/com/zy/asrs/entity/param/CombParam.java
@@ -24,6 +24,8 @@ @Data public static class CombMat { //订单明细的主键id private Long detlId; // 条码 private String threeCode; src/main/java/com/zy/asrs/mapper/OrderDetlMapper.java
@@ -36,7 +36,7 @@ int increaseWorkQty(@Param("orderId") Long orderId, @Param("matnr") String matnr, @Param("batch") String batch, @Param("workQty") Double workQty); int increaseWorkQty2(@Param("id") Long id, @Param("workQty") Double workQty); int increaseWorkQtyById(@Param("id") Long id, @Param("workQty") Double workQty); /** * 查询打印订单明细二维码数据 src/main/java/com/zy/asrs/service/MobileService.java
@@ -7,10 +7,6 @@ import com.zy.asrs.entity.OrderDetl; import com.zy.asrs.entity.param.CombParam; import com.zy.asrs.entity.param.MobileAdjustParam; import com.zy.asrs.entity.param.OffSaleParam; import com.zy.asrs.entity.param.pdaAdjustParam; import com.zy.asrs.third.CodeDataParam; import com.zy.asrs.third.CodeParam; import java.util.Date; import java.util.List; @@ -49,9 +45,6 @@ void leftoversOut(Map<String, Object> map, Long userId); List<CodeDataParam> getData(Map<String, Object> token, CodeParam codeParam); } src/main/java/com/zy/asrs/service/OrderDetlService.java
@@ -39,5 +39,5 @@ */ boolean increaseWorkQty(Long orderId, String matnr, String batch, Double workQty); boolean increaseWorkQty2(Long id, Double workQty); boolean increaseWorkQtyById(Long id, Double workQty); } src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -7,13 +7,12 @@ import com.core.common.*; import com.core.exception.CoolException; import com.zy.asrs.entity.*; import com.zy.asrs.entity.param.*; import com.zy.asrs.entity.param.CombParam; import com.zy.asrs.entity.param.ForwardAGVTaskParam; import com.zy.asrs.entity.param.MobileAdjustParam; import com.zy.asrs.entity.param.OpenOrderPakinParam; import com.zy.asrs.mapper.BasDevpMapper; import com.zy.asrs.service.*; import com.zy.asrs.third.CodeDataParam; import com.zy.asrs.third.CodeParam; import com.zy.asrs.third.MesResponse; import com.zy.asrs.third.TokenUtils; import com.zy.asrs.utils.MatUtils; import com.zy.common.constant.AgvSiteConstant; import com.zy.common.constant.ApiInterfaceConstant; @@ -29,9 +28,6 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.io.IOException; import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.*; /** @@ -137,12 +133,7 @@ String message = ""; boolean success = false; try { response = new HttpHandler.Builder() .setUri(ApiInterfaceConstant.AGV_IP) .setPath(ApiInterfaceConstant.AGV_CALL_IN_PATH) .setJson(body) .build() .doPost(); response = new HttpHandler.Builder().setUri(ApiInterfaceConstant.AGV_IP).setPath(ApiInterfaceConstant.AGV_CALL_IN_PATH).setJson(body).build().doPost(); JSONObject jsonObject = JSON.parseObject(response); if (jsonObject.getInteger("code").equals(0)) { success = true; @@ -158,15 +149,7 @@ } finally { try { // 保存接口日志 apiLogService.save( "入库呼叫agv", ApiInterfaceConstant.AGV_IP + ApiInterfaceConstant.AGV_CALL_IN_PATH, null, "127.0.0.1", body, response, success ); apiLogService.save("入库呼叫agv", ApiInterfaceConstant.AGV_IP + ApiInterfaceConstant.AGV_CALL_IN_PATH, null, "127.0.0.1", body, response, success); } catch (Exception e) { log.error("", e); } @@ -192,12 +175,7 @@ String message = ""; boolean success = false; try { response = new HttpHandler.Builder() .setUri(ApiInterfaceConstant.AGV_IP) .setPath(ApiInterfaceConstant.AGV_BIND_PATH) .setJson(body) .build() .doPost(); response = new HttpHandler.Builder().setUri(ApiInterfaceConstant.AGV_IP).setPath(ApiInterfaceConstant.AGV_BIND_PATH).setJson(body).build().doPost(); JSONObject res = JSON.parseObject(response); message = jsonObject.getString("message"); if (res.getInteger("code").equals(0)) { @@ -210,15 +188,7 @@ } finally { try { // 保存接口日志 apiLogService.save( "调用agv解绑暂存位", ApiInterfaceConstant.AGV_IP + ApiInterfaceConstant.AGV_BIND_PATH, null, "127.0.0.1", body, response, success ); apiLogService.save("调用agv解绑暂存位", ApiInterfaceConstant.AGV_IP + ApiInterfaceConstant.AGV_BIND_PATH, null, "127.0.0.1", body, response, success); } catch (Exception e) { log.error("", e); } @@ -242,12 +212,7 @@ String response = ""; boolean success = false; try { response = new HttpHandler.Builder() .setUri(ApiInterfaceConstant.AGV_IP) .setPath(ApiInterfaceConstant.AGV_BIND_PATH) .setJson(body) .build() .doPost(); response = new HttpHandler.Builder().setUri(ApiInterfaceConstant.AGV_IP).setPath(ApiInterfaceConstant.AGV_BIND_PATH).setJson(body).build().doPost(); JSONObject res = JSON.parseObject(response); if (res.getInteger("code").equals(0)) { success = true; @@ -259,15 +224,7 @@ } finally { try { // 保存接口日志 apiLogService.save( "调用agv绑定仓位", ApiInterfaceConstant.AGV_IP + ApiInterfaceConstant.AGV_BIND_PATH, null, "127.0.0.1", body, response, success ); apiLogService.save("调用agv绑定仓位", ApiInterfaceConstant.AGV_IP + ApiInterfaceConstant.AGV_BIND_PATH, null, "127.0.0.1", body, response, success); } catch (Exception e) { log.error("", e); } @@ -281,32 +238,26 @@ if (Cools.isEmpty(param.getBarcode(), param.getCombMats())) { throw new CoolException(BaseRes.PARAM); } HashMap<String, Object> comData = new HashMap<>(); param.getCombMats().forEach(elem -> { // 判断是否有相同条码的数据 if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>(). eq("zpallet", param.getBarcode()) .eq("io_status", "N") .eq("matnr", elem.getMatnr()).eq("batch", elem.getBatch())) > 0) { throw new CoolException(param.getBarcode() + "已有相同数据"); } if (comData.get(elem.getThreeCode()) == null) { comData.put(elem.getThreeCode(), elem); } else { throw new CoolException(elem.getThreeCode() + "该条码扫码了多次"); } }); // if(param.getCombMats().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()); } // if (param.getCombMats().size()>1){ // 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())); // int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet",param.getBarcode())); if (countLoc > 0 || countWrk > 0) { throw new CoolException("工作档/库存条码数据已存在===>>" + param.getBarcode()); 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(); @@ -317,15 +268,6 @@ // 生成入库通知档 List<DetlDto> detlDtos = new ArrayList<>(); param.getCombMats().forEach(elem -> { // 判断是否有相同条码的数据 if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>(). eq("zpallet", param.getBarcode()) .eq("io_status", "N") .eq("matnr", elem.getMatnr()).eq("three_code", elem.getThreeCode())) > 0) { throw new CoolException(param.getBarcode() + "已有相同数据"); } DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme()); if (DetlDto.has(detlDtos, detlDto)) { DetlDto one = DetlDto.find(detlDtos, detlDto.getMatnr(), detlDto.getBatch()); @@ -344,8 +286,8 @@ } WaitPakin waitPakin = new WaitPakin(); waitPakin.sync(mat); waitPakin.setSku(detlDto.getBatch()); //waitPakin.setBatch(detlDto.getBatch()); waitPakin.setTemp2(detlDto.getTemp2()); waitPakin.setBatch(detlDto.getBatch()); waitPakin.setZpallet(param.getBarcode()); // 托盘码 waitPakin.setIoStatus("N"); // 入出状态 waitPakin.setAnfme(detlDto.getAnfme()); // 数量 @@ -360,135 +302,53 @@ } // 关联组托 } else { Order order = orderService.selectByNo(param.getOrderNo()); Order order = orderService.selectOne(new EntityWrapper<Order>().eq("order_no", param.getOrderNo())); if (Cools.isEmpty(order) || order.getSettle() > 2) { throw new CoolException("单据编号已过期"); } // 生成入库通知档 List<DetlDto> detlDtos = new ArrayList<>(); List<String> codes = new ArrayList<>(); for (CombParam.CombMat elem : param.getCombMats()) { codes.add(elem.getThreeCode()); } List<CodeDataParam> data = getData(TokenUtils.getToken(url), new CodeParam(codes)); List<CombParam.CombMat> combMats = param.getCombMats(); for (int i = 0; i < data.size(); i++) { //} //for (CombParam.CombMat elem : param.getCombMats()) { CombParam.CombMat elem = combMats.get(i); CodeDataParam codeDataParam = data.get(i); elem.setTemp1(codeDataParam.getQuality()); elem.setAnfme(codeDataParam.getQty()); //elem.setBatch(codeDataParam.getBatchNum()); elem.setThreeCode(codeDataParam.getBarcode()); elem.setMatnr(codeDataParam.getProductionCode()); elem.setMaktx(codeDataParam.getProductionName()); // param.getCombMats().forEach(elem -> { param.getCombMats().forEach(elem -> { // 订单明细数量校验 OrderDetl orderDetl = orderDetlService.selectItem(order.getId(), elem.getMatnr(), elem.getBatch()); if (Cools.isEmpty(orderDetl)) { orderDetl = orderDetlService.selectItem(order.getId(), elem.getMatnr(), null); if (Cools.isEmpty(orderDetl)){ throw new CoolException("该单据中未找到对应物料明细"); } } if (Cools.isEmpty(codeDataParam.getQuality())) { throw new CoolException("条码未返回质量状态"); } if (Integer.parseInt(codeDataParam.getQuality()) != orderDetl.getInspect()) { throw new CoolException("单据质量状态和组托物料不匹配"); } OrderDetl orderDetl = orderDetlService.selectById(elem.getDetlId()); if (elem.getAnfme() > orderDetl.getEnableQty()) { throw new CoolException(orderDetl.getMatnr() + "入库数量不合法"); } // 修改订单作业数量 if (!orderDetlService.increaseWorkQty2(orderDetl.getId(), elem.getAnfme())) { if (!orderDetlService.increaseWorkQtyById(orderDetl.getId(), elem.getAnfme())) { throw new CoolException("修改单据作业数量失败"); } // DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme(),orderDetl.getManu()); DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme(), elem.getThreeCode() , orderDetl.getManu(), codeDataParam.getBatchNum(), orderDetl.getSupp(), orderDetl.getTemp1(), orderDetl.getTemp2(), orderDetl.getTemp3(), orderDetl.getTemp4()); detlDto.setTemp1(codeDataParam.getQuality()); detlDto.setFromOrderNo(codeDataParam.getBarcode()); if (DetlDto.has(detlDtos, detlDto)) { DetlDto one = DetlDto.find(detlDtos, detlDto.getMatnr(), detlDto.getBatch(), detlDto.getFromOrderNo()); assert one != null; one.setAnfme(one.getAnfme() + detlDto.getAnfme()); } else { detlDtos.add(detlDto); } // }); } for (DetlDto detlDto : detlDtos) { Mat mat = matService.selectByMatnr(detlDto.getMatnr()); Mat mat = matService.selectByMatnr(orderDetl.getMatnr()); if (Cools.isEmpty(mat)) { throw new CoolException(detlDto.getMatnr() + "商品档案不存在"); throw new CoolException(orderDetl.getMatnr() + "商品档案不存在"); } WaitPakin waitPakin = new WaitPakin(); waitPakin.sync(mat); waitPakin.setSku(detlDto.getBatch()); waitPakin.setOrderNo(order.getOrderNo()); // 单据编号 //waitPakin.setBatch(detlDto.getBatch()); // 序列码 waitPakin.setBatch(orderDetl.getBatch()); // 序列码 waitPakin.setZpallet(param.getBarcode()); // 托盘码 waitPakin.setIoStatus("N"); // 入出状态 waitPakin.setAnfme(detlDto.getAnfme()); // 数量 waitPakin.setAnfme(elem.getAnfme()); // 数量 waitPakin.setStatus("Y"); // 状态 waitPakin.setAppeUser(userId); waitPakin.setAppeTime(now); waitPakin.setModiUser(userId); waitPakin.setModiTime(now); waitPakin.setDanger(detlDto.getDanger()); waitPakin.setManu(detlDto.getMark()); //标记 waitPakin.setOrigin(order.getItemName());//仓库 waitPakin.setSupp(detlDto.getSuppName()); //供应商 waitPakin.setSku(detlDto.getCustomer()); //客户名称 waitPakin.setThreeCode(detlDto.getFromOrderNo()); //条码 waitPakin.setTemp1(detlDto.getTemp1()); waitPakin.setTemp2(detlDto.getTemp2()); waitPakin.setTemp3(detlDto.getTemp3()); waitPakin.setTemp4(detlDto.getTemp4()); int countWrk2 = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet", param.getBarcode())); if (countWrk2 > 0) { throw new CoolException("工作档条码数据已存在===>>" + param.getBarcode()); } waitPakin.setBatch(orderDetl.getBatch()); if (!waitPakinService.insert(waitPakin)) { throw new CoolException("保存入库通知档失败"); } } }); orderService.updateSettle(order.getId(), 2L, userId); } } public List<CodeDataParam> getData(Map<String, Object> token, CodeParam codeParam) { String response = null; try { response = new HttpHandler.Builder() .setHeaders(token) .setUri(url) .setPath(code) .setJson(JSON.toJSONString(codeParam)) .build() .doPost(); } catch (IOException e) { throw new RuntimeException(e); } log.info("getData:{}", response); MesResponse jsonObject = JSON.parseObject(response, MesResponse.class); if (jsonObject.getCode().equals(200)) { JSONObject jsonObject1 = JSON.parseObject(jsonObject.getData()); if (jsonObject1.getString("barcodeList") != null) { return JSON.parseArray(jsonObject1.getString("barcodeList"), CodeDataParam.class); } } throw new CoolException(jsonObject.getMessage()); } @Override @Transactional @@ -506,8 +366,7 @@ } // 判断是否有相同条码的数据 if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>(). eq("zpallet", param.getBarcode()).eq("io_status", "N")) > 0) { if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode()).eq("io_status", "N")) > 0) { throw new CoolException(param.getBarcode() + "数据正在进行入库"); } @@ -563,7 +422,6 @@ } // 查找商品 @@ -656,8 +514,7 @@ throw new CoolException(BaseRes.PARAM); } // 判断是否有相同条码的数据 if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>(). eq("zpallet", param.getBarcode()).eq("io_status", "N")) > 0) { if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode()).eq("io_status", "N")) > 0) { throw new CoolException(param.getBarcode() + "数据正在进行入库"); } Date now = new Date(); @@ -829,13 +686,11 @@ } for (LocDetl locDetl : locDetls) { //如果该库位出库路线所用的堆垛机out_enable不为Y,跳过该循环 LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>() .eq("loc_no", locDetl.getLocNo())); LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locDetl.getLocNo())); if (Cools.isEmpty(locMast)) { continue; } BasCrnp crn_no = basCrnpService.selectOne(new EntityWrapper<BasCrnp>() .eq("crn_no", locMast.getCrnNo())); BasCrnp crn_no = basCrnpService.selectOne(new EntityWrapper<BasCrnp>().eq("crn_no", locMast.getCrnNo())); if (Cools.isEmpty(crn_no) || !crn_no.getOutEnable().equals("Y")) { continue; } @@ -860,8 +715,7 @@ orderDetl.setWorkQty(orderDetl.getWorkQty() + curOutQty); orderDetl.setUpdateBy(userId); orderDetl.setUpdateTime(now); Wrapper wrapper = new EntityWrapper<OrderDetl>().eq("order_no", orderNo) .eq("matnr", orderDetl.getMatnr()); Wrapper wrapper = new EntityWrapper<OrderDetl>().eq("order_no", orderNo).eq("matnr", orderDetl.getMatnr()); if (!Cools.isEmpty(orderDetl.getBatch())) { wrapper.eq("batch", orderDetl.getBatch()); } @@ -937,19 +791,13 @@ } @Override @Transactional public void stockOut(OrderDetl orderDetl, BasDevp staNo, LocDetl locDetl, Double curOutQty, Integer ioType, Long userId, Date now) { public void stockOut(OrderDetl orderDetl, BasDevp staNo, LocDetl locDetl, Double curOutQty, Integer ioType, Long userId, Date now) { // 获取库位 LocMast locMast = locMastService.selectById(locDetl.getLocNo()); // 获取路径 Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>() .eq("type_no", ioType) .eq("stn_no", staNo.getDevNo()) .eq("crn_no", locMast.getCrnNo()); Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>().eq("type_no", ioType).eq("stn_no", staNo.getDevNo()).eq("crn_no", locMast.getCrnNo()); StaDesc staDesc = staDescService.selectOne(wrapper); if (Cools.isEmpty(staDesc)) { src/main/java/com/zy/asrs/service/impl/OrderDetlServiceImpl.java
@@ -92,7 +92,7 @@ } @Override public boolean increaseWorkQty2(Long id, Double workQty) { return this.baseMapper.increaseWorkQty2(id, workQty) > 0; public boolean increaseWorkQtyById(Long id, Double workQty) { return this.baseMapper.increaseWorkQtyById(id, workQty) > 0; } } src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
@@ -491,7 +491,7 @@ throw new CoolException("保存工作档明细失败"); } // 修改订单明细 if (!orderDetlService.increaseWorkQty2(orderDetl.getId(), locDto.getAnfme())) { if (!orderDetlService.increaseWorkQtyById(orderDetl.getId(), locDto.getAnfme())) { throw new CoolException("修改订单明细数量失败"); } orderService.updateSettle(orderDetl.getOrderId(), 2L, userId); src/main/java/com/zy/asrs/task/BareBoardScheduler.java
File was deleted src/main/java/com/zy/asrs/task/CheckDeepScheduler.java
File was deleted src/main/java/com/zy/asrs/task/ErrorStockScheduler.java
File was deleted src/main/java/com/zy/asrs/task/NotifyLogScheduler.java
File was deleted src/main/java/com/zy/asrs/task/handler/OrderSyncHandler.java
@@ -11,7 +11,6 @@ import com.zy.asrs.service.*; import com.zy.asrs.task.AbstractHandler; import com.zy.asrs.task.core.ReturnT; import com.zy.asrs.third.TokenUtils; import com.zy.common.model.MesPakinParam; import com.zy.common.utils.HttpHandler; import lombok.extern.slf4j.Slf4j; @@ -52,126 +51,7 @@ @Transactional public ReturnT<String> start(Order order) { DocType docType = docTypeService.selectById(order.getDocType()); if (null == docType) { return SUCCESS; } //List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId()); List<OrderDetlReport> orderDetls = orderDetlReportService.selectList(new EntityWrapper<OrderDetlReport>().eq("order_no", order.getOrderNo())); // 入库完成上报 if (docType.getPakin() == 1 && !Cools.isEmpty(orderDetls)) { MesPakinParam pakinParam = new MesPakinParam(); pakinParam.setReceiptNumber(order.getOrderNo()); pakinParam.setReceiptType(order.getDocType$()); pakinParam.setCompleteInd("1"); for (OrderDetlReport orderDetl : orderDetls) { MesPakinParam.Detl detl = new MesPakinParam.Detl(); detl.setQty(orderDetl.getAnfme()); detl.setBarcode(orderDetl.getThreeCode()); detl.setPalletBarcode(orderDetl.getZpallet()); detl.setProductionCode(orderDetl.getMatnr()); pakinParam.getBarcodeList().add(detl); } Map<String, Object> token = TokenUtils.getToken(url); if (Cools.isEmpty(token)) { return FAIL.setMsg("获取token失败"); } String response = ""; boolean success = false; try { response = new HttpHandler.Builder() .setHeaders(token) .setUri(url) .setPath(pakin) .setJson(JSON.toJSONString(pakinParam)) .build() .doPost(); JSONObject jsonObject = JSON.parseObject(response); if (jsonObject.getInteger("code").equals(200)) { success = true; // 修改订单状态 4.完成 ===>> 6.已上报 if (!orderService.updateSettle(order.getId(), 6L, null)) { throw new CoolException("服务器内部错误,请联系管理员"); } } else { log.error("请求接口失败!!!url:{};request:{};response:{}", url + pakin, JSON.toJSONString(pakinParam), response); throw new CoolException("上报mes系统失败"); } } catch (Exception e) { log.error("fail", e); // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); return FAIL.setMsg(e.getMessage()); } finally { try { // 保存接口日志 apiLogService.save( "成品库入库上报", url + pakin, null, "127.0.0.1", JSON.toJSONString(pakinParam), response, success ); } catch (Exception e) { log.error("", e); } } } // 出库完成上报 if (docType.getPakout() == 1) { // MesPakoutParam pakoutParam = new MesPakoutParam(); // pakoutParam.setTag(!order.getDocType$().equalsIgnoreCase("手动出库单")); // pakoutParam.setPakoutTime(DateUtils.convert(order.getUpdateTime())); // pakoutParam.setLgortFrom("5006"); // pakoutParam.setLgortTo("1111"); // if (!pakoutParam.isTag()) { // pakoutParam.setKunnr("C1000"); // } // pakoutParam.setOrderNo(order.getOrderNo()); // for (OrderDetl orderDetl : orderDetls) { // String serial = Cools.isEmpty(orderDetl.getBatch()) ? "" : orderDetl.getBatch(); // pakoutParam.getList().add(new MesPakoutParam.Detl(orderDetl.getMatnr() + (Cools.isEmpty(serial) ? "" : "-" + serial), orderDetl.getAnfme())); // } // String response = ""; // boolean success = false; // try { // response = new HttpHandler.Builder() // .setUri(MesConstant.URL) // .setPath(MesConstant.PAKOUT_URL) // .setJson(JSON.toJSONString(pakoutParam)) // .build() // .doPost(); // JSONObject jsonObject = JSON.parseObject(response); // if (jsonObject.getInteger("code").equals(200)) { // success = true; // // 修改订单状态 4.完成 ===>> 6.已上报 if (!orderService.updateSettle(order.getId(), 6L, null)) { throw new CoolException("服务器内部错误,请联系管理员"); } // } else { // log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL+MesConstant.PAKOUT_URL, JSON.toJSONString(pakoutParam), response); // throw new CoolException("上报mes系统失败"); // } // } catch (Exception e) { // log.error("fail", e); //// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); // return FAIL.setMsg(e.getMessage()); // } finally { // try { // // 保存接口日志 // apiLogService.save( // "成品库出库上报", // MesConstant.URL + MesConstant.PAKOUT_URL, // null, // "127.0.0.1", // JSON.toJSONString(pakoutParam), // response, // success // ); // } catch (Exception e) { log.error("", e); } // } } return SUCCESS; } src/main/java/com/zy/asrs/task/handler/WorkLogHandler.java
@@ -69,36 +69,15 @@ // exceptionHandle("删除入库通知档[workNo={0}]失败", wrkMast.getWrkNo()); } } // // 手动入库生成单据 【 上报三方平台 】 // if (!Cools.isEmpty(wrkDetls)) { // if (!orderService.saveHandlerOrder(Boolean.TRUE, wrkMast, wrkDetls)) { // exceptionHandle("生成手动入库单据[workNo={0}]失败", wrkMast.getWrkNo()); // } // } // 拣料再入库 } else if (wrkMast.getIoType() == 53) { // if (!Cools.isEmpty(wrkDetls)) { // if (!orderService.saveHandlerOrder(Boolean.FALSE, wrkMast, wrkDetls)) { // exceptionHandle("生成手动出库单据[workNo={0}]失败", wrkMast.getWrkNo()); // } // } } // 出库 -------------------------------------------------------------------------------- } else if (wrkMast.getWrkSts() == 15) { // if (!Cools.isEmpty(wrkDetls)) { // if (!orderService.saveHandlerOrder(Boolean.FALSE, wrkMast, wrkDetls)) { // exceptionHandle("生成手动出库单据[workNo={0}]失败", wrkMast.getWrkNo()); // } // } } // 保存工作主档历史档 // if (!wrkMastLogService.save(wrkMast.getWrkNo())) { // exceptionHandle("保存工作历史档[workNo={0}]失败", wrkMast.getWrkNo()); // } Date now = new Date(); WrkMast wrkMast1 = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", wrkMast.getWrkNo())); WrkMastLog wrkMastLog = new WrkMastLog(); @@ -124,9 +103,6 @@ } }); // if (!wrkDetlLogService.save(wrkMast.getWrkNo())) { //// exceptionHandle("保存工作明细历史档[workNo={0}]失败", wrkMast.getWrkNo()); // } // 删除工作明细档 if (!wrkDetlService.delete(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo()))) { exceptionHandle("删除工作明细档[workNo={0}]失败", wrkMast.getWrkNo()); src/main/java/com/zy/asrs/task/kingdee/InboundOrderScheduler.java
File was deleted src/main/java/com/zy/asrs/task/kingdee/LoginAuthenticationScheduler.java
File was deleted src/main/java/com/zy/asrs/task/kingdee/ReviewOrderSyncScheduler.java
File was deleted src/main/java/com/zy/asrs/task/kingdee/SaveOrderSyncScheduler.java
File was deleted src/main/java/com/zy/asrs/task/kingdee/SubmitOrderSyncScheduler.java
File was deleted src/main/java/com/zy/asrs/task/kingdee/handler/InboundOrderHandler.java
File was deleted src/main/java/com/zy/asrs/task/kingdee/handler/LoginAuthenticationHandler.java
File was deleted src/main/java/com/zy/asrs/task/kingdee/handler/ReviewOrderSyncHandler.java
File was deleted src/main/java/com/zy/asrs/task/kingdee/handler/SaveOrderSyncHandler.java
File was deleted src/main/java/com/zy/asrs/task/kingdee/handler/SubmitOrderSyncHandler.java
File was deleted src/main/java/com/zy/asrs/third/CodeDataParam.java
File was deleted src/main/java/com/zy/asrs/third/CodeParam.java
File was deleted src/main/java/com/zy/asrs/third/MesResponse.java
File was deleted src/main/java/com/zy/asrs/third/TokenUtils.java
File was deleted src/main/java/com/zy/asrs/utils/InitStaDesc.java
File was deleted src/main/java/com/zy/asrs/utils/Utils.java
@@ -22,30 +22,6 @@ private static final DecimalFormat fmt = new DecimalFormat("##0.00"); public static String getStaName(Integer sta) { HashMap<Integer, String> map = new HashMap<>(); map.put(113, "Ctu库102"); map.put(115, "Ctu库101"); map.put(204, "Ctu库201"); map.put(304, "Ctu库301"); map.put(31001, "四向库101"); map.put(1024, "堆垛机库北1号出库口"); map.put(1028, "堆垛机库北2号出库口"); map.put(1040, "堆垛机库南1号入库口"); map.put(1042, "堆垛机库南1号出库口"); map.put(2000, "堆垛机库北2楼出入库口"); map.put(2002, "堆垛机库北二楼出库口"); map.put(2010, "堆垛机库南二楼出入库口"); map.put(2012, "堆垛机库南二楼出库口"); map.put(3010, "堆垛机库南三楼出入库口"); map.put(3012, "堆垛机库南三楼出库口"); return map.get(sta) == null ? sta.toString() : map.get(sta); } public static boolean isNorth(Integer sourceStaNo) { if ((sourceStaNo > 1000 && sourceStaNo < 1040) || (sourceStaNo > 2000 && sourceStaNo > 2010) || (sourceStaNo > 3000 && sourceStaNo < 3010)) { src/main/java/com/zy/common/utils/RoleUtils.java
File was deleted src/main/java/com/zy/erp/kingdee/entity/param/InFormIdParam.java
File was deleted src/main/java/com/zy/erp/kingdee/entity/param/LoginParam.java
File was deleted src/main/java/com/zy/erp/kingdee/enums/KingDeeUtilType.java
File was deleted src/main/java/com/zy/erp/kingdee/utils/KingDeeUtil.java
File was deleted src/main/java/com/zy/erp/kingdee/utils/PostMesDataUtils.java
File was deleted src/main/resources/application.yml
@@ -39,7 +39,7 @@ #License相关配置 license: subject: fyxcwms subject: wms2.1 publicAlias: publicCert storePass: public_zhongyang_123456789 licensePath: license.lic @@ -57,16 +57,6 @@ doubleLocsLeft: 1 # 右深库位排号 doubleLocsRight: 4 # wms参数配置 wms-parameter: # 自动补空板功能开关 automaticFillingBoardStaNosBoolean: false # 自动补空板站点 automaticFillingBoardStaNos: 112,101 # 自动移库功能开关 autoLocMoveBoolean: false # 自动移库功能开关 穿梭 autoLocMoveUnilateralBoolean: false comb: limit: 5000 src/main/resources/mapper/MatMapper.xml
@@ -48,17 +48,10 @@ <select id="listByPage" resultMap="BaseResultMap"> SELECT isnull(mld.amount,0) as stock, mm.* FROM man_mat mm LEFT JOIN man_tag mt ON mm.tag_id = mt.id LEFT JOIN ( select matnr, sum(anfme) as amount from man_loc_detl group by matnr ) as mld on mld.matnr = mm.matnr WHERE 1=1 and (mm.memo is null or mm.memo != '打包上线') AND (CHARINDEX(','+#{tagId}+',', ','+mt.path+',') > 0 OR mt.id = #{tagId}) @@ -73,17 +66,10 @@ <select id="listByPage2" resultMap="BaseResultMap"> SELECT isnull(mld.amount,0) as stock, mm.* FROM man_mat mm LEFT JOIN man_tag mt ON mm.tag_id = mt.id LEFT JOIN ( select matnr, sum(anfme) as amount from man_loc_detl group by matnr ) as mld on mld.matnr = mm.matnr WHERE 1=1 and (mm.memo is null or mm.memo != '打包上线') AND (CHARINDEX(','+#{tagId}+',', ','+mt.path+',') > 0 OR mt.id = #{tagId}) src/main/resources/mapper/OrderDetlMapper.xml
@@ -222,7 +222,7 @@ </update> <update id="increaseWorkQty2"> <update id="increaseWorkQtyById"> update man_order_detl set work_qty = work_qty + #{workQty} where 1=1 src/main/webapp/static/js/common.js
@@ -1,4 +1,4 @@ var baseUrl = "/fyxcwms"; var baseUrl = "/wms"; // 详情窗口-高度 var detailHeight = '80%';