From fa4025b0a7ff6dd9b90af70fc915dd6a5f014e18 Mon Sep 17 00:00:00 2001 From: gongbaoxiong <751575283@qq.com> Date: Thu, 25 Jul 2024 16:48:36 +0800 Subject: [PATCH] =?UTF-8?q?add:=20=E5=A2=9E=E5=8A=A0=E5=BB=B6=E8=BF=9F?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AllocationBillController.java | 3 +- .../controller/EasOutInBillController.java | 41 +++++++++++++++-- .../eas/controller/ReceiptBillController.java | 7 +-- .../wms/database/eas/dao/AllocationBill.java | 4 ++ .../nl/wms/database/eas/dao/EasOutInBill.java | 6 +++ .../nl/wms/database/eas/dao/ReceiptBill.java | 4 ++ .../wms/database/eas/dao/WarehouseInfo.java | 15 ++++++- .../eas/service/IeasOutInBillService.java | 2 +- .../eas/service/IreceiptBillService.java | 4 +- .../impl/AllocationBillServiceImpl.java | 1 - .../service/impl/EasOutInBillServiceImpl.java | 45 ++++++++++++------- .../service/impl/ReceiptBillServiceImpl.java | 28 +++++++----- .../org/nl/wms/schedule/EasBillSchedule.java | 6 ++- 13 files changed, 124 insertions(+), 42 deletions(-) diff --git a/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/AllocationBillController.java b/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/AllocationBillController.java index 113a45f..367324b 100644 --- a/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/AllocationBillController.java +++ b/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/AllocationBillController.java @@ -81,10 +81,11 @@ public class AllocationBillController { @Log("单据直接调拨") @SaIgnore //@SaCheckPermission("@el.check(allocationConfirm:edit')") - public CommonResult confirm(@RequestBody List params) { + public CommonResult confirm(@RequestBody List params) throws InterruptedException { if (params.isEmpty()) { throw new BadRequestException("参数为空!"); } + Thread.sleep(5000); // return RestBusinessTemplate.execute(() -> allocationBillService.allocationConfirm(params)); return RestBusinessTemplate.execute(() -> null); } diff --git a/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/EasOutInBillController.java b/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/EasOutInBillController.java index 0220f88..479c341 100644 --- a/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/EasOutInBillController.java +++ b/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/EasOutInBillController.java @@ -1,5 +1,6 @@ package org.nl.wms.database.eas.controller; +import java.util.ArrayList; import java.util.List; import java.util.Set; @@ -52,11 +53,12 @@ public class EasOutInBillController { @Log("出入库单据审核") @SaIgnore //@SaCheckPermission("@el.check(EasOutInBill:edit')") - public CommonResult audit(@RequestBody List ids) { + public CommonResult audit(@RequestBody List ids) throws InterruptedException { if (ids == null || ids.isEmpty()) { return CommonResult.failed(ResultCode.FAILED); } - return RestBusinessTemplate.execute(() -> easOutInBillService.audit(ids, true)); + Thread.sleep(5000); + return RestBusinessTemplate.execute(()->easOutInBillService.audit(ids, true)); } @@ -80,7 +82,13 @@ public class EasOutInBillController { @PostMapping("/getBillsCount") @Log("首页显示出入库单据数量") public CommonResult> getBillsCount() { - return RestBusinessTemplate.execute(() -> easOutInBillService.getBillsCount()); + return RestBusinessTemplate.execute(() -> { + try { + return easOutInBillService.getBillsCount(); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + }); } /** @@ -89,7 +97,32 @@ public class EasOutInBillController { @PostMapping("/getOrganizationInfo") @Log("获取组织机构信息") public CommonResult> getOrganizationInfo() { - return null; + List list =new ArrayList(); + WarehouseInfo w1=new WarehouseInfo(); + w1.setKczzbm("08"); + w1.setKczzmc("浙江宏智物流装备有限公司"); + list.add(w1); + WarehouseInfo w2=new WarehouseInfo(); + w2.setKczzbm("01.09.10"); + w2.setKczzmc("高空平台事业部"); + list.add(w2); + WarehouseInfo w3=new WarehouseInfo(); + w3.setKczzbm("01.09.03"); + w3.setKczzmc("搬运车厂"); + list.add(w3); + WarehouseInfo w4=new WarehouseInfo(); + w4.setKczzbm("01.09.04"); + w4.setKczzmc("电动车厂"); + list.add(w4); + WarehouseInfo w5=new WarehouseInfo(); + w5.setKczzbm("01.09.0"); + w5.setKczzmc("计划管理部"); + list.add(w5); + WarehouseInfo w6=new WarehouseInfo(); + w6.setKczzbm("01"); + w6.setKczzmc("诺力智能装备股份有限公司"); + list.add(w6); + return RestBusinessTemplate.execute(() -> list); } diff --git a/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/ReceiptBillController.java b/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/ReceiptBillController.java index 002c8ec..dd04522 100644 --- a/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/ReceiptBillController.java +++ b/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/ReceiptBillController.java @@ -84,10 +84,11 @@ public class ReceiptBillController { @Log("收货单确认") @SaIgnore //@SaCheckPermission("@el.check(receiptConfirm:edit')") - public CommonResult confirm(@RequestBody List params) { + public CommonResult confirm(@RequestBody List params) throws InterruptedException { if (params.isEmpty()) { throw new BadRequestException("参数为空!"); } + Thread.sleep(5000); // return RestBusinessTemplate.execute(() -> receiptBillService.receiptConfirm(params)); return RestBusinessTemplate.execute(() -> null); } @@ -114,8 +115,8 @@ public class ReceiptBillController { @PostMapping("/update") @Log("修改") //@SaCheckPermission("@el.check(ReceiptBill:edit')") - public CommonResult update(@RequestBody ReceiptBillVO entity) { - return RestBusinessTemplate.execute(() -> receiptBillService.update(entity)); + public CommonResult update(@RequestBody List entityList) { + return RestBusinessTemplate.execute(() -> receiptBillService.update(entityList)); } diff --git a/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/AllocationBill.java b/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/AllocationBill.java index ca993b7..0cc5def 100644 --- a/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/AllocationBill.java +++ b/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/AllocationBill.java @@ -26,6 +26,10 @@ public class AllocationBill extends Model { */ @TableId(value = "flid", type = IdType.NONE) private String flid; + /** + * 审核结果 + */ + private String shjg; /** * 单据ID diff --git a/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/EasOutInBill.java b/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/EasOutInBill.java index db6fa4b..ee6eef8 100644 --- a/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/EasOutInBill.java +++ b/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/EasOutInBill.java @@ -155,6 +155,12 @@ public class EasOutInBill extends Model { */ private String update_time; + /** + * 审核结果 + */ + private String shjg; + + /** * 获取主键值 diff --git a/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/ReceiptBill.java b/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/ReceiptBill.java index 1ebaa8b..66ddc0d 100644 --- a/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/ReceiptBill.java +++ b/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/ReceiptBill.java @@ -29,6 +29,10 @@ public class ReceiptBill extends Model { @TableId(value = "flid", type = IdType.NONE) private String flid; + /** + * 审核结果 + */ + private String shjg; /** * 送货单id diff --git a/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/WarehouseInfo.java b/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/WarehouseInfo.java index 9b19109..7f58776 100644 --- a/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/WarehouseInfo.java +++ b/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/WarehouseInfo.java @@ -28,13 +28,24 @@ public class WarehouseInfo implements Serializable { /** * 组织编码 */ - private String kcbm; + private String kczzbm; /** * 组织名称 */ - private String kcmc; + private String kczzmc; + + /** + * 仓管员编码 + */ + private String cgybm; + + + /** + * 仓管员名称 + */ + private String cgymc; /** * 状态 diff --git a/nlsso-server/src/main/java/org/nl/wms/database/eas/service/IeasOutInBillService.java b/nlsso-server/src/main/java/org/nl/wms/database/eas/service/IeasOutInBillService.java index 9251df0..7b00a4a 100644 --- a/nlsso-server/src/main/java/org/nl/wms/database/eas/service/IeasOutInBillService.java +++ b/nlsso-server/src/main/java/org/nl/wms/database/eas/service/IeasOutInBillService.java @@ -36,7 +36,7 @@ public interface IeasOutInBillService extends IService { * * @return JSONObject */ - List getBillsCount(); + List getBillsCount() throws InterruptedException; /** diff --git a/nlsso-server/src/main/java/org/nl/wms/database/eas/service/IreceiptBillService.java b/nlsso-server/src/main/java/org/nl/wms/database/eas/service/IreceiptBillService.java index 5abc7fc..5ccdc63 100644 --- a/nlsso-server/src/main/java/org/nl/wms/database/eas/service/IreceiptBillService.java +++ b/nlsso-server/src/main/java/org/nl/wms/database/eas/service/IreceiptBillService.java @@ -60,9 +60,9 @@ public interface IreceiptBillService extends IService { /** * 编辑 * - * @param entity / + * @param entityList / */ - void update(ReceiptBillVO entity); + void update(List entityList); /** * 多选删除 diff --git a/nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/AllocationBillServiceImpl.java b/nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/AllocationBillServiceImpl.java index c005ff8..010fcfb 100644 --- a/nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/AllocationBillServiceImpl.java +++ b/nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/AllocationBillServiceImpl.java @@ -63,7 +63,6 @@ public class AllocationBillServiceImpl extends ServiceImpl pageObject = new Page<>(params.getPage(), params.getSize()); Page allocationBills = allocationBillMapper.allocationPage(pageObject, params.getFuzzy()); - Thread.sleep(5000); return CommonPage.getPage(allocationBills, totalCount); } diff --git a/nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/EasOutInBillServiceImpl.java b/nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/EasOutInBillServiceImpl.java index 19042a3..8c30bac 100644 --- a/nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/EasOutInBillServiceImpl.java +++ b/nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/EasOutInBillServiceImpl.java @@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.nl.common.base.CommonPage; import org.nl.common.enums.wms.EasBillTypeEnum; import org.nl.common.exception.BadRequestException; @@ -78,7 +79,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl getBillsCount() { + public List getBillsCount() throws InterruptedException { List allCounts =easOutInBillMapper.getBillsCount(); HomeBillCounts allocations =new HomeBillCounts(); @@ -132,7 +133,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl i.like(EasOutInBill::getDjid, params.getFuzzy()) .or() @@ -549,23 +550,28 @@ public class EasOutInBillServiceImpl extends ServiceImpl updateWrapper = new UpdateWrapper().set("update_id", SecurityUtils.getCurrentUserId()).set("update_name", SecurityUtils.getCurrentNickName()).set("update_time", DateUtil.format(DateUtil.beginOfDay(DateUtil.date()), "yyyy-MM-dd")).eq("djid", bill.getBillId()); + if (StringUtils.isNoneBlank(msg)) { + updateWrapper.set("shjg", msg); + } else { + updateWrapper.set("djzt", "审核"); } + easOutInBillMapper.update(null, updateWrapper); + // msgDto = wmsToEasService.sendWebService(billJson); } else { SrmMsgDto srmMsgDto; String billJson = com.alibaba.fastjson.JSON.toJSONString(bill, SerializerFeature.WriteMapNullValue); - srmMsgDto = wmsToSrmService.sendWebPostData(billJson); - if (srmMsgDto != null) { - if ("false".equals(srmMsgDto.getSuccess())) { - throw new BadRequestException(srmMsgDto.getMessage()); - } + // srmMsgDto = wmsToSrmService.sendWebPostData(billJson); + String msg =""; + UpdateWrapper updateWrapper = new UpdateWrapper().set("update_id", SecurityUtils.getCurrentUserId()).set("update_name", SecurityUtils.getCurrentNickName()).set("update_time", DateUtil.format(DateUtil.beginOfDay(DateUtil.date()), "yyyy-MM-dd")).eq("djid", bill.getBillId()); + if (StringUtils.isNoneBlank(msg)) { + updateWrapper.set("shjg", msg); + } else { + updateWrapper.set("djzt", "审核"); } + easOutInBillMapper.update(null, updateWrapper); } - updateBills(bill); } catch (Exception e) { log.error("推送Eas单据失败,单据号为:[" + bill.getBillId() + "]异常原因:" + e.toString()); throw new BadRequestException(e.toString()); @@ -582,8 +588,15 @@ public class EasOutInBillServiceImpl extends ServiceImpl updateWrapper = new UpdateWrapper().set("update_id", SecurityUtils.getCurrentUserId()).set("update_name", SecurityUtils.getCurrentNickName()).set("update_time", DateUtil.format(DateUtil.beginOfDay(DateUtil.date()), "yyyy-MM-dd")).eq("djid", bill.getBillId()); + if (StringUtils.isNoneBlank(msg)) { + updateWrapper.set("shjg", msg); + } else { + updateWrapper.set("djzt", "审核"); + } + easOutInBillMapper.update(null, updateWrapper); } catch (Exception e) { log.error("推送Eas单据失败,单据号为:[" + bill.getBillId() + "]异常原因:" + e.toString()); //throw new BadRequestException(e.toString()); @@ -599,7 +612,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl().eq(ReceiptBill2::getDjid,entity.getDjid())); - if (receiptBill == null) { - // 如果不存在该记录,则插入数据 - ReceiptBill2 receiptBillNew = new ReceiptBill2(); - BeanUtils.copyProperties(entity, receiptBillNew); - receiptBill2Mapper.insert(receiptBillNew); - } else { - // 如果存在该记录,则更新数据 - BeanUtils.copyProperties(entity, receiptBill); - receiptBill2Mapper.updateById(receiptBill); + public void update(List entityList) { + if (CollectionUtils.isNotEmpty(entityList)) { + entityList.forEach(r -> { + ReceiptBill receiptBill = this.getById(r.getFlid()); + if (receiptBill == null) { + // 如果不存在该记录,则插入数据 + ReceiptBill receiptBillNew = new ReceiptBill(); + BeanUtils.copyProperties(r, receiptBillNew); + this.save(receiptBillNew); + } else { + // 如果存在该记录,则更新数据 + BeanUtils.copyProperties(r, receiptBill); + this.updateById(receiptBill); + } + }); } } diff --git a/nlsso-server/src/main/java/org/nl/wms/schedule/EasBillSchedule.java b/nlsso-server/src/main/java/org/nl/wms/schedule/EasBillSchedule.java index c0c7162..ff0d424 100644 --- a/nlsso-server/src/main/java/org/nl/wms/schedule/EasBillSchedule.java +++ b/nlsso-server/src/main/java/org/nl/wms/schedule/EasBillSchedule.java @@ -113,7 +113,11 @@ public class EasBillSchedule { SendHomeWebSocketServer.getWebSocketSet(); if (webSocketSet.size() > 0) { webSocketSet.forEach(c -> { - c.sendDataToClient(easOutInBillService.getBillsCount()); + try { + c.sendDataToClient(easOutInBillService.getBillsCount()); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } }); } //stopWatch.stop();