From b4a00f5c514c0ef8fe76f4537a9e68578f0fc1b0 Mon Sep 17 00:00:00 2001 From: anthonywj Date: Tue, 9 May 2023 15:02:46 +0800 Subject: [PATCH 01/48] =?UTF-8?q?=E5=8F=91=E7=A5=A8=EF=BC=8C=E5=8D=95?= =?UTF-8?q?=E6=8D=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../glxp/api/controller/BaseController.java | 4 +- .../controller/inout/IoOrderController.java | 10 +- .../inout/IoOrderInvoiceController.java | 15 +- .../glxp/api/http/sync/SpGetHttpClient.java | 5 +- .../api/idc/service/impl/IdcServiceImpl.java | 142 +++++++++--------- .../api/res/inout/RefreshInoiceResponse.java | 14 ++ src/main/resources/schemas/schema_v2.1.sql | 1 + 7 files changed, 109 insertions(+), 82 deletions(-) create mode 100644 src/main/java/com/glxp/api/res/inout/RefreshInoiceResponse.java diff --git a/src/main/java/com/glxp/api/controller/BaseController.java b/src/main/java/com/glxp/api/controller/BaseController.java index ca5e71431..d2c52744e 100644 --- a/src/main/java/com/glxp/api/controller/BaseController.java +++ b/src/main/java/com/glxp/api/controller/BaseController.java @@ -39,7 +39,9 @@ public class BaseController { public String getCustomerId() { AuthAdmin authAdmin = getUser(); - return authAdmin.getCustomerId() + ""; + if (authAdmin != null) + return authAdmin.getCustomerId() + ""; + return "110"; } public boolean isHosUser() { diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderController.java index cb69eb489..3492feaca 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderController.java @@ -138,15 +138,15 @@ public class IoOrderController extends BaseController { } List list = orderService.getfilterList(filterOrderRequest); for (IoOrderResponse ioOrderResponse : list) { - if(ioOrderResponse.getCheckStatus() == null){ - ioOrderResponse.setCheckStatus(0+""); + if (ioOrderResponse.getCheckStatus() == null) { + ioOrderResponse.setCheckStatus(0 + ""); } FilterOrderDetailCodeRequest filterOrderDetailCodeRequest = new FilterOrderDetailCodeRequest(); filterOrderDetailCodeRequest.setOrderIdFk(ioOrderResponse.getBillNo()); List ioOrderDetailCodeResponses = orderDetailBizService.getfilterList(filterOrderDetailCodeRequest); - BigDecimal amount=new BigDecimal(0.00); + BigDecimal amount = new BigDecimal(0.00); for (IoOrderDetailCodeResponse ioOrderDetailCodeRespons : ioOrderDetailCodeResponses) { - if(ioOrderDetailCodeRespons.getCount() != 0 && ioOrderDetailCodeRespons.getPrice()!=null ) { + if (ioOrderDetailCodeRespons.getCount() != 0 && ioOrderDetailCodeRespons.getPrice() != null) { amount = amount.add(new BigDecimal(ioOrderDetailCodeRespons.getCount()).multiply(ioOrderDetailCodeRespons.getPrice())); } } @@ -161,8 +161,6 @@ public class IoOrderController extends BaseController { } - - @AuthRuleAnnotation("") @GetMapping("/udiwms/inout/preInorder/filter") public BaseResponse filterPreInorder(FilterOrderRequest filterOrderRequest) { diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderInvoiceController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderInvoiceController.java index 4df72efea..3a4e50908 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderInvoiceController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderInvoiceController.java @@ -8,11 +8,15 @@ import com.glxp.api.annotation.Log; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.constant.BusinessType; +import com.glxp.api.dao.inout.IoOrderDetailCodeDao; import com.glxp.api.dao.inout.IoOrderInvoiceMapper; +import com.glxp.api.entity.inout.IoOrderDetailCodeEntity; import com.glxp.api.entity.inout.IoOrderInvoiceEntity; import com.glxp.api.http.sync.SpGetHttpClient; import com.glxp.api.idc.service.FileService; import com.glxp.api.req.inout.RefreshInoiceRequest; +import com.glxp.api.res.inout.RefreshInoiceResponse; +import com.glxp.api.service.inout.IoOrderDetailCodeService; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; @@ -29,14 +33,21 @@ public class IoOrderInvoiceController { SpGetHttpClient spGetHttpClient; @Resource FileService fileService; + @Resource + IoOrderDetailCodeDao ioOrderDetailCodeDao; @AuthRuleAnnotation("") @PostMapping("/udiwms/inout/order/refrshInvoice") @Log(title = "发票", businessType = BusinessType.INSERT) public BaseResponse addBizProduct(@RequestBody RefreshInoiceRequest refreshInoiceRequest) { - BaseResponse baseResponse = spGetHttpClient.getIoOrderInvoices(refreshInoiceRequest); + BaseResponse baseResponse = spGetHttpClient.getIoOrderInvoices(refreshInoiceRequest); if (baseResponse.getCode() == 20000) { - List orderInvoiceEntities = BeanUtil.toBean(baseResponse.getData(),List.class); + RefreshInoiceResponse refreshInoiceResponse = baseResponse.getData(); + + List orderDetailCodeEntities = refreshInoiceResponse.getOrderDetailCodeEntities(); + ioOrderDetailCodeDao.insertOrUpdateBatch(orderDetailCodeEntities); + + List orderInvoiceEntities = refreshInoiceResponse.getOrderInvoiceEntities(); if (CollUtil.isNotEmpty(orderInvoiceEntities)) { List syncFiles = new ArrayList<>(); for (IoOrderInvoiceEntity orderInvoiceEntity : orderInvoiceEntities) { diff --git a/src/main/java/com/glxp/api/http/sync/SpGetHttpClient.java b/src/main/java/com/glxp/api/http/sync/SpGetHttpClient.java index fd62d3e9a..666e4d927 100644 --- a/src/main/java/com/glxp/api/http/sync/SpGetHttpClient.java +++ b/src/main/java/com/glxp/api/http/sync/SpGetHttpClient.java @@ -21,6 +21,7 @@ import com.glxp.api.req.sync.BasicExportStatusRequest; import com.glxp.api.req.sync.OrderStatusFilterRequest; import com.glxp.api.req.sync.SyncUpLoadRequest; import com.glxp.api.res.PageSimpleResponse; +import com.glxp.api.res.inout.RefreshInoiceResponse; import com.glxp.api.res.sync.*; import com.glxp.api.res.system.SyncDataSetResponse; import com.glxp.api.service.sync.SyncDataSetService; @@ -140,7 +141,7 @@ public class SpGetHttpClient { String json = JSONUtil.toJsonStr(refreshInoiceRequest); String result = okHttpCli.doPostJson(getIpUrl() + "/directToSpms" + "/udiwms/inout/order/refrshInvoice", json, buildHeader()); BaseResponse response = - JSONObject.parseObject(result, new TypeReference() { + JSONObject.parseObject(result, new TypeReference>() { }); return response; } @@ -154,7 +155,7 @@ public class SpGetHttpClient { header.add(userId); String json = JSONUtil.toJsonStr(reviewFinishRequest); - String result = okHttpCli.doPostJson(getIpUrl() + "/directToSpms" + "/spms/inout/order/web/updateStatus", json, Convert.toStrArray(header)); + String result = okHttpCli.doPostJson(getIpUrl() + "/directToSpms" + "/spms/inout/order/web/updateStatus", json, Convert.toStrArray(header)); BaseResponse response = JSONObject.parseObject(result, new TypeReference>() { }); diff --git a/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java b/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java index 5c87b161f..844c53858 100644 --- a/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java +++ b/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java @@ -270,16 +270,16 @@ public class IdcServiceImpl implements IdcService { if(dataList.get(k).get("tableName"+k) == null) break; if(dataList.get(k).get("data"+k)!=null && dataList.get(k).get("filePathColumn"+k)!=null) { - List childList = JSONObject.parseArray(JSON.toJSONString(dataList.get(i).get("data"+k)), Map.class); - for(int x =0 ;x childList = JSONObject.parseArray(JSON.toJSONString(dataList.get(i).get("data"+k)), Map.class); + for(int x =0 ;x > list = dbDao.list(map); if(list!=null&&map.size()>0) { - List> data = new ArrayList<>(); - for(int k=0;i0 ? ","+key : key; - } - obj.put("uniqueColumn", uniqueColumn); - obj.put("operateMode", "D"); - data.add(obj); - } - Map msg = new HashMap(); - msg.put("messageId", CustomUtil.getId()); - msg.put("messageType", tnames[9]+"(删除)"); - msg.put("apiCode", "common"); - msg.put("tableName", DBAUtils.tableAliasName(tnames[2])); - msg.put("sendTime", new Date()); - msg.put("version", "1.0"); - msg.put("total", data.size()); - msg.put("data", data); - if (isUpload) { - String result = ""; - try { - result = relay("", JSON.toJSONString(msg), null, syncIp); - } catch (Exception ex) { - - } - if (IDCUtils.isJson(result)) { - JSONObject json = JSON.parseObject(result); - if (json.getInteger("code") == 20000) { - saveIdcLog(tnames[9], "", tnames[2] + ">success(delete)", i * limit, total); - } else { - success = false; - - saveIdcLog(tnames[9], "", tnames[2] + ">" + result, i * limit, total); - } - } else { - success = false; - saveIdcLog(tnames[9], "", syncIp + ":" + tnames[2] + ">fail:上传地址未连通", i * limit, total); - } - - } else { - saveIdcLog(tnames[9], "", tnames[2] + ">success(delete)", i * limit, total); - } - syncAddTaskStatus(msg, isUpload ? 1 : 0, true, startTime, isUpload,success); + List> data = new ArrayList<>(); + for(int k=0;i0 ? ","+key : key; + } + obj.put("uniqueColumn", uniqueColumn); + obj.put("operateMode", "D"); + data.add(obj); + } + Map msg = new HashMap(); + msg.put("messageId", CustomUtil.getId()); + msg.put("messageType", tnames[9]+"(删除)"); + msg.put("apiCode", "common"); + msg.put("tableName", DBAUtils.tableAliasName(tnames[2])); + msg.put("sendTime", new Date()); + msg.put("version", "1.0"); + msg.put("total", data.size()); + msg.put("data", data); + if (isUpload) { + String result = ""; + try { + result = relay("", JSON.toJSONString(msg), null, syncIp); + } catch (Exception ex) { + + } + if (IDCUtils.isJson(result)) { + JSONObject json = JSON.parseObject(result); + if (json.getInteger("code") == 20000) { + saveIdcLog(tnames[9], "", tnames[2] + ">success(delete)", i * limit, total); + } else { + success = false; + + saveIdcLog(tnames[9], "", tnames[2] + ">" + result, i * limit, total); + } + } else { + success = false; + saveIdcLog(tnames[9], "", syncIp + ":" + tnames[2] + ">fail:上传地址未连通", i * limit, total); + } + + } else { + saveIdcLog(tnames[9], "", tnames[2] + ">success(delete)", i * limit, total); + } + syncAddTaskStatus(msg, isUpload ? 1 : 0, true, startTime, isUpload,success); } } } @@ -1188,23 +1188,23 @@ public class IdcServiceImpl implements IdcService { try (InputStream inputStream = result.body().byteStream()) { - FileOutputStream outputStream = new FileOutputStream(filePath + filePathSlash + imagePath+fileName); + FileOutputStream outputStream = new FileOutputStream(filePath + filePathSlash + imagePath+fileName); - byte b[] = new byte[1024]; + byte b[] = new byte[1024]; - int len = 0; - while ((len = inputStream.read(b)) != -1) { - total += len; - outputStream.write(b, 0, len); + int len = 0; + while ((len = inputStream.read(b)) != -1) { + total += len; + outputStream.write(b, 0, len); - } + } - outputStream.flush(); - outputStream.close(); - if(!(total>0)) { - new File(filePath + filePathSlash + imagePath+fileName).delete(); - executeSql("delete from idc_file where filePath='"+fileName+"'"); - } + outputStream.flush(); + outputStream.close(); + if(!(total>0)) { + new File(filePath + filePathSlash + imagePath+fileName).delete(); + executeSql("delete from idc_file where filePath='"+fileName+"'"); + } } catch (Exception e) { @@ -1220,7 +1220,7 @@ public class IdcServiceImpl implements IdcService { // TODO Auto-generated catch block e.printStackTrace(); } - return (total>0); + return (total>0); } // @Override // public boolean signleDownloadFile(String syncIp, String fileName) { @@ -1355,7 +1355,7 @@ public class IdcServiceImpl implements IdcService { return systemParamConfigEntity; } - + /*把列数据转Map*/ diff --git a/src/main/java/com/glxp/api/res/inout/RefreshInoiceResponse.java b/src/main/java/com/glxp/api/res/inout/RefreshInoiceResponse.java new file mode 100644 index 000000000..58e68c388 --- /dev/null +++ b/src/main/java/com/glxp/api/res/inout/RefreshInoiceResponse.java @@ -0,0 +1,14 @@ +package com.glxp.api.res.inout; + +import com.glxp.api.entity.inout.IoOrderDetailCodeEntity; +import com.glxp.api.entity.inout.IoOrderInvoiceEntity; +import lombok.Data; + +import java.util.List; + +@Data +public class RefreshInoiceResponse { + + List orderInvoiceEntities; + List orderDetailCodeEntities; +} diff --git a/src/main/resources/schemas/schema_v2.1.sql b/src/main/resources/schemas/schema_v2.1.sql index e7eddb38c..6c4f5d2ec 100644 --- a/src/main/resources/schemas/schema_v2.1.sql +++ b/src/main/resources/schemas/schema_v2.1.sql @@ -416,3 +416,4 @@ CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'spaceOut', 'tinyint', 1); CALL Pro_Temp_ColumnWork('io_order_detail_code', 'id', 'bigint ', 2); CALL Pro_Temp_ColumnWork('io_order_detail_biz', 'id', 'bigint ', 2); +CALL Pro_Temp_ColumnWork('io_order_invoice', 'bizIdFk', 'bigint ', 2); From d55358b8cd6a11e11c12566ec7bdb488b631007b Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Tue, 9 May 2023 15:49:41 +0800 Subject: [PATCH 02/48] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=8F=91=E7=A5=A8=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inout/IoOrderDetailBizController.java | 3 +- .../mapper/inout/IoOrderInvoiceMapper.xml | 28 +++++++++++++------ 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java index 88be98cfe..a64b72d80 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java @@ -648,7 +648,8 @@ public class IoOrderDetailBizController extends BaseController { String msg = ""; IoOrderInvoiceRequest ioOrderInvoiceEntity = new IoOrderInvoiceRequest(); ioOrderInvoiceEntity.setOrderIdFk(ioOrderDetailCodeRespons.getOrderIdFk()); - ioOrderInvoiceEntity.setBizIdFk(ioOrderDetailCodeRespons.getId()); + ioOrderInvoiceEntity.setBatchNo(ioOrderDetailCodeRespons.getBatchNo()); + ioOrderInvoiceEntity.setBindRlFk(ioOrderDetailCodeRespons.getBindRlFk().toString()); List ioOrderInvoiceEntityList = ioOrderInvoiceService.selectOrderInvoice(ioOrderInvoiceEntity); for (IoOrderInvoiceEntity obj : ioOrderInvoiceEntityList) { if (StrUtil.isNotEmpty(obj.getInvoiceEncode())) { diff --git a/src/main/resources/mybatis/mapper/inout/IoOrderInvoiceMapper.xml b/src/main/resources/mybatis/mapper/inout/IoOrderInvoiceMapper.xml index de5cb763f..2984b40cd 100644 --- a/src/main/resources/mybatis/mapper/inout/IoOrderInvoiceMapper.xml +++ b/src/main/resources/mybatis/mapper/inout/IoOrderInvoiceMapper.xml @@ -12,18 +12,30 @@ From 3b29b7f804a557fbc5e34094c44576160601b3e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Tue, 9 May 2023 15:57:45 +0800 Subject: [PATCH 03/48] =?UTF-8?q?=E7=89=A9=E8=B5=84=E6=91=86=E6=94=BE?= =?UTF-8?q?=E4=B8=8B=E6=9E=B6=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/inv/InvPlaceController.java | 34 + .../inv/InvPreInProductDetailEntity.java | 7 +- .../glxp/api/res/inv/BindInvSpaceRequest.java | 3 +- .../api/service/inv/InvPlaceOrderService.java | 3 + .../glxp/api/service/inv/InvPlaceService.java | 10 + .../inv/impl/InvPlaceOrderServiceImpl.java | 122 +++ .../service/inv/impl/InvPlaceServiceImpl.java | 782 ++++++++++++++---- 7 files changed, 780 insertions(+), 181 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/inv/InvPlaceController.java b/src/main/java/com/glxp/api/controller/inv/InvPlaceController.java index d879b7a03..4b616a181 100644 --- a/src/main/java/com/glxp/api/controller/inv/InvPlaceController.java +++ b/src/main/java/com/glxp/api/controller/inv/InvPlaceController.java @@ -94,6 +94,20 @@ public class InvPlaceController { return invPlaceService.bindInvSpace(bindInvSpaceRequest); } + /** + * 下架货位接口 + * + * @param bindInvSpaceRequest + * @return + */ + @PostMapping("/spms/inv/product/unbindInvOrderSpace") + public BaseResponse unbindInvOrderSpace(@RequestBody BindInvSpaceRequest bindInvSpaceRequest) { + if (null == bindInvSpaceRequest) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); + } + return invPlaceService.unbindInvOrderSpace(bindInvSpaceRequest); + } + /** * 更换货位接口 @@ -175,6 +189,26 @@ public class InvPlaceController { } + /** + * 下架 + * + * @param bindInvSpaceRequest + * @return + */ + @GetMapping("/spms/inv/product/getInvProductOutInfo") + private BaseResponse getInvProductOutInfo(BindInvSpaceRequest bindInvSpaceRequest) { + List list = new ArrayList<>(); + //判断有没有库存 + String msg=invPlaceService.checkOutCount(bindInvSpaceRequest); + if(StrUtil.isEmpty(msg)){ + //有库存做插入货位号 + return invPlaceOrderService.unbindInvSpaceOne(bindInvSpaceRequest); + }else{ + return ResultVOUtils.error(500, msg); + } + + } + /** * 从库存详情查询单据列表 * diff --git a/src/main/java/com/glxp/api/entity/inv/InvPreInProductDetailEntity.java b/src/main/java/com/glxp/api/entity/inv/InvPreInProductDetailEntity.java index b465b09a1..a7ae00960 100644 --- a/src/main/java/com/glxp/api/entity/inv/InvPreInProductDetailEntity.java +++ b/src/main/java/com/glxp/api/entity/inv/InvPreInProductDetailEntity.java @@ -1,9 +1,6 @@ package com.glxp.api.entity.inv; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.*; import lombok.Data; import java.util.Date; @@ -118,7 +115,7 @@ public class InvPreInProductDetailEntity { /** * 货位编码 */ - @TableField(value = "invSpaceCode") + @TableField(value = "invSpaceCode" , updateStrategy = FieldStrategy.IGNORED) private String invSpaceCode; /** diff --git a/src/main/java/com/glxp/api/res/inv/BindInvSpaceRequest.java b/src/main/java/com/glxp/api/res/inv/BindInvSpaceRequest.java index d549c103d..03d535bc5 100644 --- a/src/main/java/com/glxp/api/res/inv/BindInvSpaceRequest.java +++ b/src/main/java/com/glxp/api/res/inv/BindInvSpaceRequest.java @@ -41,7 +41,7 @@ public class BindInvSpaceRequest { private String code; /** - * 上架方式 1:按物资上架 2:按单上架 3:变更货位 + * 上架方式 1:按物资上架 2:按单上架 3:变更货位 4:物资下架 */ private Integer type; @@ -55,4 +55,5 @@ public class BindInvSpaceRequest { private String changeSpaceCode; + private Integer outCount; } diff --git a/src/main/java/com/glxp/api/service/inv/InvPlaceOrderService.java b/src/main/java/com/glxp/api/service/inv/InvPlaceOrderService.java index 42f5abd70..9540b346c 100644 --- a/src/main/java/com/glxp/api/service/inv/InvPlaceOrderService.java +++ b/src/main/java/com/glxp/api/service/inv/InvPlaceOrderService.java @@ -27,6 +27,9 @@ public interface InvPlaceOrderService { //批量绑定货位 BaseResponse bindInvSpaceAll(BindInvSpaceRequest bindInvSpaceRequest); + //单条解绑货位 + BaseResponse unbindInvSpaceOne(BindInvSpaceRequest bindInvSpaceRequest); + List filterInvPlaceOrderDetailList(FilterInvPlaceOrderRequest filterInvPlaceOrderRequest); } diff --git a/src/main/java/com/glxp/api/service/inv/InvPlaceService.java b/src/main/java/com/glxp/api/service/inv/InvPlaceService.java index 44358651c..175683561 100644 --- a/src/main/java/com/glxp/api/service/inv/InvPlaceService.java +++ b/src/main/java/com/glxp/api/service/inv/InvPlaceService.java @@ -36,6 +36,13 @@ public interface InvPlaceService { */ BaseResponse bindInvOrderSpace(BindInvSpaceRequest bindInvSpaceRequest); + /** + * 下架货位 + * + * @param bindInvSpaceRequest + */ + BaseResponse unbindInvOrderSpace(BindInvSpaceRequest bindInvSpaceRequest); + /** * 更换货位 @@ -70,4 +77,7 @@ public interface InvPlaceService { //判断有没有库存 String checkCount(BindInvSpaceRequest bindInvSpaceRequest); + //判断有没有库存 + String checkOutCount(BindInvSpaceRequest bindInvSpaceRequest); + } diff --git a/src/main/java/com/glxp/api/service/inv/impl/InvPlaceOrderServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/InvPlaceOrderServiceImpl.java index 913172bf7..5bcc1a337 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/InvPlaceOrderServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/InvPlaceOrderServiceImpl.java @@ -375,6 +375,128 @@ public class InvPlaceOrderServiceImpl implements InvPlaceOrderService { return ResultVOUtils.success(recordId); } + @Override + public BaseResponse unbindInvSpaceOne(BindInvSpaceRequest bindInvSpaceRequest) { + + Long relId = null; + String batchNo = null; + String nameCode = null; + String supId = null; + String produceDate = null; + String expireDate = null; + String serialNo = null; + List filterInvPlaceOrderRequestList = new ArrayList<>(); + InvWarehouseEntity invWarehouseEntity = invWarehouseDao.selectOne(new QueryWrapper().eq("code", bindInvSpaceRequest.getInvCode())); + if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_PREIN) { + QueryWrapper ew = new QueryWrapper<>(); + ew.eq("code", bindInvSpaceRequest.getCode()); + ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); + ew.last("limit 1"); + InvPreInProductDetailEntity invPreInProductDetailEntity = invPreInProductDetailDao.selectOne(ew); + relId = invPreInProductDetailEntity.getRelId(); + batchNo = invPreInProductDetailEntity.getBatchNo(); + nameCode = invPreInProductDetailEntity.getNameCode(); + supId = invPreInProductDetailEntity.getSupId(); + produceDate = invPreInProductDetailEntity.getProduceDate(); + expireDate = invPreInProductDetailEntity.getExpireDate(); + serialNo = invPreInProductDetailEntity.getSerialNo(); + + } else if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_ADVANCE) { + QueryWrapper ew = new QueryWrapper<>(); + ew.eq("code", bindInvSpaceRequest.getCode()); + ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); + ew.last("limit 1"); + InvPreProductDetailEntity invPreProductDetailEntity = invPreProductDetailDao.selectOne(ew); + relId = invPreProductDetailEntity.getRelId(); + batchNo = invPreProductDetailEntity.getBatchNo(); + nameCode = invPreProductDetailEntity.getNameCode(); + supId = invPreProductDetailEntity.getSupId(); + produceDate = invPreProductDetailEntity.getProduceDate(); + expireDate = invPreProductDetailEntity.getExpireDate(); + serialNo = invPreProductDetailEntity.getSerialNo(); + } else if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_NORMAL) { + QueryWrapper ew = new QueryWrapper<>(); + ew.eq("code", bindInvSpaceRequest.getCode()); + ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); + ew.last("limit 1"); + InvProductDetailEntity invProductDetailEntity = invProductDetailDao.selectOne(ew); + relId = invProductDetailEntity.getRelId(); + batchNo = invProductDetailEntity.getBatchNo(); + nameCode = invProductDetailEntity.getNameCode(); + supId = invProductDetailEntity.getSupId(); + produceDate = invProductDetailEntity.getProduceDate(); + expireDate = invProductDetailEntity.getExpireDate(); + serialNo = invProductDetailEntity.getSerialNo(); + } + + + //判断是不是第一次进行添加 是就插入一条主表 + String recordId = ""; + if (StrUtil.isEmpty(bindInvSpaceRequest.getOrderId())) { + InvPlaceOrderEntity invPlaceOrderEntity = new InvPlaceOrderEntity(); + //操作人ID + String userId = customerService.getUserIdStr(); + + recordId = gennerOrderUtils.createInvPlaceOrderNo(new OrderNoTypeBean(Constant.INV_PLACE_ORDER, "yyyyMMdd")); + InvPlaceOrderEntity orderEntity = new InvPlaceOrderEntity(); + orderEntity.setId(IdUtil.getSnowflakeNextId()); + orderEntity.setRecordId(recordId); + orderEntity.setType(4); + orderEntity.setCreateUser(userId); + orderEntity.setCreateTime(new Date()); + orderEntity.setUpdateTime(new Date()); + invPlaceOrderDao.insert(orderEntity); + + //插入附表 + InvPlaceOrderDetailEntity invPlaceOrderDetailEntity = new InvPlaceOrderDetailEntity(); + invPlaceOrderDetailEntity.setId(IdUtil.getSnowflakeNextId()); + invPlaceOrderDetailEntity.setRecordId(recordId); + invPlaceOrderDetailEntity.setBatchNo(batchNo); + invPlaceOrderDetailEntity.setRelId(relId + ""); + invPlaceOrderDetailEntity.setNameCode(nameCode); + invPlaceOrderDetailEntity.setExpireDate(expireDate); + invPlaceOrderDetailEntity.setProduceDate(produceDate); + invPlaceOrderDetailEntity.setSupId(supId); + invPlaceOrderDetailEntity.setInvCode(bindInvSpaceRequest.getInvCode()); + invPlaceOrderDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getInvSpaceCode()); + invPlaceOrderDetailEntity.setCode(bindInvSpaceRequest.getCode()); + invPlaceOrderDetailEntity.setSerialNo(serialNo); + invPlaceOrderDetailEntity.setCount(1); + invPlaceOrderDetailDao.insert(invPlaceOrderDetailEntity); + } else { + recordId = bindInvSpaceRequest.getOrderId(); + //查询有没有存在一样的code有就加数量没有新增 + QueryWrapper ew = new QueryWrapper<>(); + ew.eq("recordId", bindInvSpaceRequest.getOrderId()); + ew.eq("code", bindInvSpaceRequest.getCode()); + InvPlaceOrderDetailEntity invPlaceOrderDetailEntity = invPlaceOrderDetailDao.selectOne(ew); + if (invPlaceOrderDetailEntity != null) { + invPlaceOrderDetailEntity.setCount(invPlaceOrderDetailEntity.getCount() + 1); + invPlaceOrderDetailDao.updateById(invPlaceOrderDetailEntity); + } else { + //插入附表 + invPlaceOrderDetailEntity = new InvPlaceOrderDetailEntity(); + invPlaceOrderDetailEntity.setId(IdUtil.getSnowflakeNextId()); + invPlaceOrderDetailEntity.setRecordId(bindInvSpaceRequest.getOrderId()); + invPlaceOrderDetailEntity.setInvCode(bindInvSpaceRequest.getInvCode()); + invPlaceOrderDetailEntity.setBatchNo(batchNo); + invPlaceOrderDetailEntity.setRelId(relId + ""); + invPlaceOrderDetailEntity.setNameCode(nameCode); + invPlaceOrderDetailEntity.setExpireDate(expireDate); + invPlaceOrderDetailEntity.setProduceDate(produceDate); + invPlaceOrderDetailEntity.setSupId(supId); + invPlaceOrderDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getInvSpaceCode()); + invPlaceOrderDetailEntity.setCode(bindInvSpaceRequest.getCode()); + invPlaceOrderDetailEntity.setCount(1); + invPlaceOrderDetailEntity.setSerialNo(serialNo); + invPlaceOrderDetailDao.insert(invPlaceOrderDetailEntity); + } + } + + + return ResultVOUtils.success(recordId); + } + @Override public List filterInvPlaceOrderDetailList(FilterInvPlaceOrderRequest filterInvPlaceOrderRequest) { if (null == filterInvPlaceOrderRequest) { diff --git a/src/main/java/com/glxp/api/service/inv/impl/InvPlaceServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/InvPlaceServiceImpl.java index 6b42abb4b..d88765f02 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/InvPlaceServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/InvPlaceServiceImpl.java @@ -22,10 +22,12 @@ import com.glxp.api.res.basic.UdiRelevanceResponse; import com.glxp.api.res.inout.IoOrderResponse; import com.glxp.api.res.inv.BindInvSpaceRequest; import com.glxp.api.res.inv.InvPlaceDetailResponse; +import com.glxp.api.service.auth.CustomerService; import com.glxp.api.service.basic.UdiRelevanceService; import com.glxp.api.service.inv.InvPlaceOrderService; import com.glxp.api.service.inv.InvPlaceService; import com.glxp.api.util.BeanCopyUtils; +import com.glxp.api.util.GennerOrderUtils; import com.glxp.api.util.OrderNoTypeBean; import io.swagger.models.auth.In; import lombok.extern.slf4j.Slf4j; @@ -62,7 +64,10 @@ public class InvPlaceServiceImpl implements InvPlaceService { private InvPlaceOrderDetailDao invPlaceOrderDetailDao; @Resource private UdiRelevanceService udiRelevanceService; - + @Resource + private CustomerService customerService; + @Resource + private GennerOrderUtils gennerOrderUtils; @Override @@ -82,64 +87,64 @@ public class InvPlaceServiceImpl implements InvPlaceService { //查询仓库的部门ID // String deptCode = invWarehouseDao.selectParentIdByCode(bindInvSpaceRequest.getInvCode()); InvWarehouseEntity invWarehouseEntity = invWarehouseDao.filterGroupInvSubAndcode(bindInvSpaceRequest.getInvCode()); - List invPlaceOrderDetailEntityList=new ArrayList<>(); + List invPlaceOrderDetailEntityList = new ArrayList<>(); if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_PREIN) { - invPlaceOrderDetailEntityList=invPlaceOrderDetailDao.selectList(new QueryWrapper().eq("recordId",bindInvSpaceRequest.getOrderId())); + invPlaceOrderDetailEntityList = invPlaceOrderDetailDao.selectList(new QueryWrapper().eq("recordId", bindInvSpaceRequest.getOrderId())); for (InvPlaceOrderDetailEntity invPlaceOrderDetailEntity : invPlaceOrderDetailEntityList) { for (Integer i = 0; i < invPlaceOrderDetailEntity.getCount(); i++) { //拆解库存表 - QueryWrapper ew=new QueryWrapper<>(); - InvPreInProductDetailEntity invPreInProductDetailEntity=new InvPreInProductDetailEntity(); - if(bindInvSpaceRequest.getType()==3){ - ew.eq("code",invPlaceOrderDetailEntity.getCode()); - ew.eq("invSpaceCode",bindInvSpaceRequest.getInvSpaceCode()); + QueryWrapper ew = new QueryWrapper<>(); + InvPreInProductDetailEntity invPreInProductDetailEntity = new InvPreInProductDetailEntity(); + if (bindInvSpaceRequest.getType() == 3) { + ew.eq("code", invPlaceOrderDetailEntity.getCode()); + ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); ew.last("limit 1"); - invPreInProductDetailEntity=invPreInProductDetailDao.selectOne(ew); - }else{ - ew.eq("code",invPlaceOrderDetailEntity.getCode()); - ew.and(o-> o.isNull("invSpaceCode").or().eq("invSpaceCode","")); - ew.gt("inCount",0); + invPreInProductDetailEntity = invPreInProductDetailDao.selectOne(ew); + } else { + ew.eq("code", invPlaceOrderDetailEntity.getCode()); + ew.and(o -> o.isNull("invSpaceCode").or().eq("invSpaceCode", "")); + ew.gt("inCount", 0); ew.last("limit 1"); - invPreInProductDetailEntity=invPreInProductDetailDao.selectOne(ew); + invPreInProductDetailEntity = invPreInProductDetailDao.selectOne(ew); } - if(invPreInProductDetailEntity.getInCount()>0){ - String nameCode=invPreInProductDetailEntity.getNameCode(); - int reCount=getActCount(nameCode); - invPreInProductDetailEntity.setInCount(invPreInProductDetailEntity.getInCount()-1); - invPreInProductDetailEntity.setCount(invPreInProductDetailEntity.getCount()-1); - invPreInProductDetailEntity.setReCount(invPreInProductDetailEntity.getReCount()-reCount); + if (invPreInProductDetailEntity.getInCount() > 0) { + String nameCode = invPreInProductDetailEntity.getNameCode(); + int reCount = getActCount(nameCode); + invPreInProductDetailEntity.setInCount(invPreInProductDetailEntity.getInCount() - 1); + invPreInProductDetailEntity.setCount(invPreInProductDetailEntity.getCount() - 1); + invPreInProductDetailEntity.setReCount(invPreInProductDetailEntity.getReCount() - reCount); invPreInProductDetailDao.updateById(invPreInProductDetailEntity); ew.clear(); - ew.eq("code",invPlaceOrderDetailEntity.getCode()); - if(bindInvSpaceRequest.getType()==3){ - ew.eq("invSpaceCode",bindInvSpaceRequest.getChangeSpaceCode()); - }else{ - ew.eq("invSpaceCode",invPlaceOrderDetailEntity.getInvSpaceCode()); + ew.eq("code", invPlaceOrderDetailEntity.getCode()); + if (bindInvSpaceRequest.getType() == 3) { + ew.eq("invSpaceCode", bindInvSpaceRequest.getChangeSpaceCode()); + } else { + ew.eq("invSpaceCode", invPlaceOrderDetailEntity.getInvSpaceCode()); } - InvPreInProductDetailEntity invPreInProductDetailEntity1=invPreInProductDetailDao.selectOne(ew); - if(invPreInProductDetailEntity1!=null){ - invPreInProductDetailEntity1.setCount(invPreInProductDetailEntity1.getCount()+1); - invPreInProductDetailEntity1.setInCount(invPreInProductDetailEntity1.getInCount()+1); - invPreInProductDetailEntity1.setReCount(invPreInProductDetailEntity1.getReCount()+reCount); + InvPreInProductDetailEntity invPreInProductDetailEntity1 = invPreInProductDetailDao.selectOne(ew); + if (invPreInProductDetailEntity1 != null) { + invPreInProductDetailEntity1.setCount(invPreInProductDetailEntity1.getCount() + 1); + invPreInProductDetailEntity1.setInCount(invPreInProductDetailEntity1.getInCount() + 1); + invPreInProductDetailEntity1.setReCount(invPreInProductDetailEntity1.getReCount() + reCount); invPreInProductDetailDao.updateById(invPreInProductDetailEntity1); - }else{ + } else { invPreInProductDetailEntity.setId(null); invPreInProductDetailEntity.setInCount(1); invPreInProductDetailEntity.setCount(1); invPreInProductDetailEntity.setReCount(reCount); invPreInProductDetailEntity.setOutCount(0); - if (bindInvSpaceRequest.getType()==3){ - invPreInProductDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getChangeSpaceCode()); - }else{ - invPreInProductDetailEntity.setInvSpaceCode(invPlaceOrderDetailEntity.getInvSpaceCode()); - } + if (bindInvSpaceRequest.getType() == 3) { + invPreInProductDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getChangeSpaceCode()); + } else { + invPreInProductDetailEntity.setInvSpaceCode(invPlaceOrderDetailEntity.getInvSpaceCode()); + } invPreInProductDetailDao.insert(invPreInProductDetailEntity); } } @@ -149,58 +154,58 @@ public class InvPlaceServiceImpl implements InvPlaceService { } else if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_ADVANCE) { - invPlaceOrderDetailEntityList=invPlaceOrderDetailDao.selectList(new QueryWrapper().eq("recordId",bindInvSpaceRequest.getOrderId())); + invPlaceOrderDetailEntityList = invPlaceOrderDetailDao.selectList(new QueryWrapper().eq("recordId", bindInvSpaceRequest.getOrderId())); for (InvPlaceOrderDetailEntity invPlaceOrderDetailEntity : invPlaceOrderDetailEntityList) { for (Integer i = 0; i < invPlaceOrderDetailEntity.getCount(); i++) { //拆解库存表 - InvPreProductDetailEntity invPreInProductDetailEntity=new InvPreProductDetailEntity(); - QueryWrapper ew=new QueryWrapper<>(); - if(bindInvSpaceRequest.getType()==3){ - ew.eq("code",invPlaceOrderDetailEntity.getCode()); - ew.eq("invSpaceCode",bindInvSpaceRequest.getInvSpaceCode()); + InvPreProductDetailEntity invPreInProductDetailEntity = new InvPreProductDetailEntity(); + QueryWrapper ew = new QueryWrapper<>(); + if (bindInvSpaceRequest.getType() == 3) { + ew.eq("code", invPlaceOrderDetailEntity.getCode()); + ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); ew.last("limit 1"); - invPreInProductDetailEntity=invPreProductDetailDao.selectOne(ew); - }else{ - ew.eq("code",invPlaceOrderDetailEntity.getCode()); - ew.and(o-> o.isNull("invSpaceCode").or().eq("invSpaceCode","")); - ew.gt("inCount",0); + invPreInProductDetailEntity = invPreProductDetailDao.selectOne(ew); + } else { + ew.eq("code", invPlaceOrderDetailEntity.getCode()); + ew.and(o -> o.isNull("invSpaceCode").or().eq("invSpaceCode", "")); + ew.gt("inCount", 0); ew.last("limit 1"); - invPreInProductDetailEntity=invPreProductDetailDao.selectOne(ew); + invPreInProductDetailEntity = invPreProductDetailDao.selectOne(ew); } - if(invPreInProductDetailEntity.getInCount()>0){ - String nameCode=invPreInProductDetailEntity.getNameCode(); - int reCount=getActCount(nameCode); - invPreInProductDetailEntity.setInCount(invPreInProductDetailEntity.getInCount()-1); - invPreInProductDetailEntity.setCount(invPreInProductDetailEntity.getCount()-1); - invPreInProductDetailEntity.setReCount(invPreInProductDetailEntity.getReCount()-reCount); + if (invPreInProductDetailEntity.getInCount() > 0) { + String nameCode = invPreInProductDetailEntity.getNameCode(); + int reCount = getActCount(nameCode); + invPreInProductDetailEntity.setInCount(invPreInProductDetailEntity.getInCount() - 1); + invPreInProductDetailEntity.setCount(invPreInProductDetailEntity.getCount() - 1); + invPreInProductDetailEntity.setReCount(invPreInProductDetailEntity.getReCount() - reCount); invPreProductDetailDao.updateById(invPreInProductDetailEntity); ew.clear(); - ew.eq("code",invPlaceOrderDetailEntity.getCode()); - if(bindInvSpaceRequest.getType()==3){ - ew.eq("invSpaceCode",bindInvSpaceRequest.getChangeSpaceCode()); - }else{ - ew.eq("invSpaceCode",invPlaceOrderDetailEntity.getInvSpaceCode()); + ew.eq("code", invPlaceOrderDetailEntity.getCode()); + if (bindInvSpaceRequest.getType() == 3) { + ew.eq("invSpaceCode", bindInvSpaceRequest.getChangeSpaceCode()); + } else { + ew.eq("invSpaceCode", invPlaceOrderDetailEntity.getInvSpaceCode()); } - InvPreProductDetailEntity invPreInProductDetailEntity1=invPreProductDetailDao.selectOne(ew); - if(invPreInProductDetailEntity1!=null){ - invPreInProductDetailEntity1.setCount(invPreInProductDetailEntity1.getCount()+1); - invPreInProductDetailEntity1.setInCount(invPreInProductDetailEntity1.getInCount()+1); - invPreInProductDetailEntity1.setReCount(invPreInProductDetailEntity1.getReCount()+reCount); + InvPreProductDetailEntity invPreInProductDetailEntity1 = invPreProductDetailDao.selectOne(ew); + if (invPreInProductDetailEntity1 != null) { + invPreInProductDetailEntity1.setCount(invPreInProductDetailEntity1.getCount() + 1); + invPreInProductDetailEntity1.setInCount(invPreInProductDetailEntity1.getInCount() + 1); + invPreInProductDetailEntity1.setReCount(invPreInProductDetailEntity1.getReCount() + reCount); invPreProductDetailDao.updateById(invPreInProductDetailEntity1); - }else{ + } else { invPreInProductDetailEntity.setId(null); invPreInProductDetailEntity.setInCount(1); invPreInProductDetailEntity.setCount(1); invPreInProductDetailEntity.setOutCount(0); invPreInProductDetailEntity.setReCount(reCount); - if (bindInvSpaceRequest.getType()==3){ + if (bindInvSpaceRequest.getType() == 3) { invPreInProductDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getChangeSpaceCode()); - }else{ + } else { invPreInProductDetailEntity.setInvSpaceCode(invPlaceOrderDetailEntity.getInvSpaceCode()); } invPreProductDetailDao.insert(invPreInProductDetailEntity); @@ -210,57 +215,57 @@ public class InvPlaceServiceImpl implements InvPlaceService { } } else { - invPlaceOrderDetailEntityList=invPlaceOrderDetailDao.selectList(new QueryWrapper().eq("recordId",bindInvSpaceRequest.getOrderId())); + invPlaceOrderDetailEntityList = invPlaceOrderDetailDao.selectList(new QueryWrapper().eq("recordId", bindInvSpaceRequest.getOrderId())); for (InvPlaceOrderDetailEntity invPlaceOrderDetailEntity : invPlaceOrderDetailEntityList) { for (Integer i = 0; i < invPlaceOrderDetailEntity.getCount(); i++) { //拆解库存表 - InvProductDetailEntity invPreInProductDetailEntity=new InvProductDetailEntity(); - QueryWrapper ew=new QueryWrapper<>(); - if(bindInvSpaceRequest.getType()==3){ - ew.eq("code",invPlaceOrderDetailEntity.getCode()); - ew.eq("invSpaceCode",bindInvSpaceRequest.getInvSpaceCode()); + InvProductDetailEntity invPreInProductDetailEntity = new InvProductDetailEntity(); + QueryWrapper ew = new QueryWrapper<>(); + if (bindInvSpaceRequest.getType() == 3) { + ew.eq("code", invPlaceOrderDetailEntity.getCode()); + ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); ew.last("limit 1"); - invPreInProductDetailEntity=invProductDetailDao.selectOne(ew); - }else{ - ew.eq("code",invPlaceOrderDetailEntity.getCode()); - ew.and(o-> o.isNull("invSpaceCode").or().eq("invSpaceCode","")); - ew.gt("inCount",0); + invPreInProductDetailEntity = invProductDetailDao.selectOne(ew); + } else { + ew.eq("code", invPlaceOrderDetailEntity.getCode()); + ew.and(o -> o.isNull("invSpaceCode").or().eq("invSpaceCode", "")); + ew.gt("inCount", 0); ew.last("limit 1"); - invPreInProductDetailEntity=invProductDetailDao.selectOne(ew); + invPreInProductDetailEntity = invProductDetailDao.selectOne(ew); } - if(invPreInProductDetailEntity.getInCount()>0){ - String nameCode=invPreInProductDetailEntity.getNameCode(); - int reCount=getActCount(nameCode); - invPreInProductDetailEntity.setInCount(invPreInProductDetailEntity.getInCount()-1); - invPreInProductDetailEntity.setCount(invPreInProductDetailEntity.getCount()-1); - invPreInProductDetailEntity.setReCount(invPreInProductDetailEntity.getReCount()-reCount); + if (invPreInProductDetailEntity.getInCount() > 0) { + String nameCode = invPreInProductDetailEntity.getNameCode(); + int reCount = getActCount(nameCode); + invPreInProductDetailEntity.setInCount(invPreInProductDetailEntity.getInCount() - 1); + invPreInProductDetailEntity.setCount(invPreInProductDetailEntity.getCount() - 1); + invPreInProductDetailEntity.setReCount(invPreInProductDetailEntity.getReCount() - reCount); invProductDetailDao.updateById(invPreInProductDetailEntity); ew.clear(); - ew.eq("code",invPlaceOrderDetailEntity.getCode()); - if(bindInvSpaceRequest.getType()==3){ - ew.eq("invSpaceCode",bindInvSpaceRequest.getChangeSpaceCode()); - }else{ - ew.eq("invSpaceCode",invPlaceOrderDetailEntity.getInvSpaceCode()); + ew.eq("code", invPlaceOrderDetailEntity.getCode()); + if (bindInvSpaceRequest.getType() == 3) { + ew.eq("invSpaceCode", bindInvSpaceRequest.getChangeSpaceCode()); + } else { + ew.eq("invSpaceCode", invPlaceOrderDetailEntity.getInvSpaceCode()); } - InvProductDetailEntity invPreInProductDetailEntity1=invProductDetailDao.selectOne(ew); - if(invPreInProductDetailEntity1!=null){ - invPreInProductDetailEntity1.setCount(invPreInProductDetailEntity1.getCount()+1); - invPreInProductDetailEntity1.setInCount(invPreInProductDetailEntity1.getInCount()+1); - invPreInProductDetailEntity1.setReCount(invPreInProductDetailEntity1.getReCount()+reCount); + InvProductDetailEntity invPreInProductDetailEntity1 = invProductDetailDao.selectOne(ew); + if (invPreInProductDetailEntity1 != null) { + invPreInProductDetailEntity1.setCount(invPreInProductDetailEntity1.getCount() + 1); + invPreInProductDetailEntity1.setInCount(invPreInProductDetailEntity1.getInCount() + 1); + invPreInProductDetailEntity1.setReCount(invPreInProductDetailEntity1.getReCount() + reCount); invProductDetailDao.updateById(invPreInProductDetailEntity1); - }else{ + } else { invPreInProductDetailEntity.setId(null); invPreInProductDetailEntity.setInCount(1); invPreInProductDetailEntity.setCount(1); invPreInProductDetailEntity.setOutCount(0); invPreInProductDetailEntity.setReCount(reCount); - if (bindInvSpaceRequest.getType()==3){ + if (bindInvSpaceRequest.getType() == 3) { invPreInProductDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getChangeSpaceCode()); - }else{ + } else { invPreInProductDetailEntity.setInvSpaceCode(invPlaceOrderDetailEntity.getInvSpaceCode()); } invProductDetailDao.insert(invPreInProductDetailEntity); @@ -271,12 +276,12 @@ public class InvPlaceServiceImpl implements InvPlaceService { } int total = invPlaceOrderDetailEntityList.stream().mapToInt(InvPlaceOrderDetailEntity::getCount).sum(); - QueryWrapper ew=new QueryWrapper<>(); - ew.eq("recordId",bindInvSpaceRequest.getOrderId()); - InvPlaceOrderEntity invPlaceOrderEntity=new InvPlaceOrderEntity(); + QueryWrapper ew = new QueryWrapper<>(); + ew.eq("recordId", bindInvSpaceRequest.getOrderId()); + InvPlaceOrderEntity invPlaceOrderEntity = new InvPlaceOrderEntity(); invPlaceOrderEntity.setRecordId(bindInvSpaceRequest.getOrderId()); invPlaceOrderEntity.setCount(total); - invPlaceOrderDao.update(invPlaceOrderEntity,ew); + invPlaceOrderDao.update(invPlaceOrderEntity, ew); // if (CollUtil.isNotEmpty(list)) { // List ids = list.stream().map(InvProductDetailEntity::getId).collect(Collectors.toList()); @@ -314,42 +319,42 @@ public class InvPlaceServiceImpl implements InvPlaceService { //查询仓库的部门ID // String deptCode = invWarehouseDao.selectParentIdByCode(bindInvSpaceRequest.getInvCode()); InvWarehouseEntity invWarehouseEntity = invWarehouseDao.filterGroupInvSubAndcode(bindInvSpaceRequest.getInvCode()); - List invPlaceOrderDetailEntityList=new ArrayList<>(); + List invPlaceOrderDetailEntityList = new ArrayList<>(); if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_PREIN) { - invPlaceOrderDetailEntityList=invPlaceOrderDetailDao.selectList(new QueryWrapper().eq("recordId",bindInvSpaceRequest.getOrderId())); - QueryWrapper ew=new QueryWrapper<>(); - ew.eq("orderId",bindInvSpaceRequest.getOId()); - InvPreInProductDetailEntity invPreInProductDetailEntity=new InvPreInProductDetailEntity(); + invPlaceOrderDetailEntityList = invPlaceOrderDetailDao.selectList(new QueryWrapper().eq("recordId", bindInvSpaceRequest.getOrderId())); + QueryWrapper ew = new QueryWrapper<>(); + ew.eq("orderId", bindInvSpaceRequest.getOId()); + InvPreInProductDetailEntity invPreInProductDetailEntity = new InvPreInProductDetailEntity(); invPreInProductDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getInvSpaceCode()); - invPreInProductDetailDao.update(invPreInProductDetailEntity,ew); + invPreInProductDetailDao.update(invPreInProductDetailEntity, ew); } else if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_ADVANCE) { - invPlaceOrderDetailEntityList=invPlaceOrderDetailDao.selectList(new QueryWrapper().eq("recordId",bindInvSpaceRequest.getOrderId())); - QueryWrapper ew=new QueryWrapper<>(); - ew.eq("orderId",bindInvSpaceRequest.getOId()); - InvPreProductDetailEntity invPreProductDetailEntity=new InvPreProductDetailEntity(); + invPlaceOrderDetailEntityList = invPlaceOrderDetailDao.selectList(new QueryWrapper().eq("recordId", bindInvSpaceRequest.getOrderId())); + QueryWrapper ew = new QueryWrapper<>(); + ew.eq("orderId", bindInvSpaceRequest.getOId()); + InvPreProductDetailEntity invPreProductDetailEntity = new InvPreProductDetailEntity(); invPreProductDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getInvSpaceCode()); - invPreProductDetailDao.update(invPreProductDetailEntity,ew); + invPreProductDetailDao.update(invPreProductDetailEntity, ew); } else { - invPlaceOrderDetailEntityList=invPlaceOrderDetailDao.selectList(new QueryWrapper().eq("recordId",bindInvSpaceRequest.getOrderId())); - QueryWrapper ew=new QueryWrapper<>(); - ew.eq("orderId",bindInvSpaceRequest.getOId()); - InvProductDetailEntity invProductDetailEntity=new InvProductDetailEntity(); + invPlaceOrderDetailEntityList = invPlaceOrderDetailDao.selectList(new QueryWrapper().eq("recordId", bindInvSpaceRequest.getOrderId())); + QueryWrapper ew = new QueryWrapper<>(); + ew.eq("orderId", bindInvSpaceRequest.getOId()); + InvProductDetailEntity invProductDetailEntity = new InvProductDetailEntity(); invProductDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getInvSpaceCode()); - invProductDetailDao.update(invProductDetailEntity,ew); + invProductDetailDao.update(invProductDetailEntity, ew); } int total = invPlaceOrderDetailEntityList.stream().mapToInt(InvPlaceOrderDetailEntity::getCount).sum(); - QueryWrapper ew=new QueryWrapper<>(); - ew.eq("recordId",bindInvSpaceRequest.getOrderId()); - InvPlaceOrderEntity invPlaceOrderEntity=new InvPlaceOrderEntity(); + QueryWrapper ew = new QueryWrapper<>(); + ew.eq("recordId", bindInvSpaceRequest.getOrderId()); + InvPlaceOrderEntity invPlaceOrderEntity = new InvPlaceOrderEntity(); invPlaceOrderEntity.setRecordId(bindInvSpaceRequest.getOrderId()); invPlaceOrderEntity.setCount(total); - invPlaceOrderDao.update(invPlaceOrderEntity,ew); + invPlaceOrderDao.update(invPlaceOrderEntity, ew); return ResultVOUtils.success(); } @@ -480,84 +485,161 @@ public class InvPlaceServiceImpl implements InvPlaceService { @Override public String checkCount(BindInvSpaceRequest bindInvSpaceRequest) { InvWarehouseEntity invWarehouseEntity = invWarehouseDao.selectOne(new QueryWrapper().eq("code", bindInvSpaceRequest.getInvCode())); - Integer count=0; + Integer count = 0; if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_PREIN) { - if(bindInvSpaceRequest.getType()==3){ - QueryWrapper ew=new QueryWrapper<>(); - ew.eq("code",bindInvSpaceRequest.getCode()); - ew.eq("invSpaceCode",bindInvSpaceRequest.getInvSpaceCode()); - InvPreInProductDetailEntity invPreInProductDetailEntity=invPreInProductDetailDao.selectOne(ew); - count=invPreInProductDetailEntity.getInCount(); - }else{ - count = invPreInProductDetailDao.getInventoryQuantity(bindInvSpaceRequest.getCode()); + if (bindInvSpaceRequest.getType() == 3) { + QueryWrapper ew = new QueryWrapper<>(); + ew.eq("code", bindInvSpaceRequest.getCode()); + ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); + InvPreInProductDetailEntity invPreInProductDetailEntity = invPreInProductDetailDao.selectOne(ew); + count = invPreInProductDetailEntity.getInCount(); + } else { + count = invPreInProductDetailDao.getInventoryQuantity(bindInvSpaceRequest.getCode()); } - if(count==null || count<=0){ + if (count == null || count <= 0) { return "该产品库存不足!"; } - if(StrUtil.isNotBlank(bindInvSpaceRequest.getOrderId())){ - QueryWrapper ew=new QueryWrapper(); - ew.eq("recordId",bindInvSpaceRequest.getOrderId()); - ew.eq("code",bindInvSpaceRequest.getCode()); - InvPlaceOrderDetailEntity invPlaceOrderDetailEntity =invPlaceOrderDetailDao.selectOne(ew); - if(invPlaceOrderDetailEntity==null){ - invPlaceOrderDetailEntity=new InvPlaceOrderDetailEntity(); + if (StrUtil.isNotBlank(bindInvSpaceRequest.getOrderId())) { + QueryWrapper ew = new QueryWrapper(); + ew.eq("recordId", bindInvSpaceRequest.getOrderId()); + ew.eq("code", bindInvSpaceRequest.getCode()); + InvPlaceOrderDetailEntity invPlaceOrderDetailEntity = invPlaceOrderDetailDao.selectOne(ew); + if (invPlaceOrderDetailEntity == null) { + invPlaceOrderDetailEntity = new InvPlaceOrderDetailEntity(); invPlaceOrderDetailEntity.setCount(0); } - if(invPlaceOrderDetailEntity.getCount()>=count){ + if (invPlaceOrderDetailEntity.getCount() >= count) { return "该产品库存不足!"; } } } else if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_ADVANCE) { - if(bindInvSpaceRequest.getType()==3){ - QueryWrapper ew=new QueryWrapper<>(); - ew.eq("code",bindInvSpaceRequest.getCode()); - ew.eq("invSpaceCode",bindInvSpaceRequest.getInvSpaceCode()); - InvPreProductDetailEntity invPreProductDetailEntity=invPreProductDetailDao.selectOne(ew); - count=invPreProductDetailEntity.getInCount(); - }else{ - count = invPreProductDetailDao.getInventoryQuantity(bindInvSpaceRequest.getCode()); + if (bindInvSpaceRequest.getType() == 3) { + QueryWrapper ew = new QueryWrapper<>(); + ew.eq("code", bindInvSpaceRequest.getCode()); + ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); + InvPreProductDetailEntity invPreProductDetailEntity = invPreProductDetailDao.selectOne(ew); + count = invPreProductDetailEntity.getInCount(); + } else { + count = invPreProductDetailDao.getInventoryQuantity(bindInvSpaceRequest.getCode()); } - if(count==null || count<=0){ + if (count == null || count <= 0) { return "该产品库存不足!"; } - if(StrUtil.isNotBlank(bindInvSpaceRequest.getOrderId())){ - QueryWrapper ew=new QueryWrapper(); - ew.eq("recordId",bindInvSpaceRequest.getOrderId()); - ew.eq("code",bindInvSpaceRequest.getCode()); - InvPlaceOrderDetailEntity invPlaceOrderDetailEntity =invPlaceOrderDetailDao.selectOne(ew); - if(invPlaceOrderDetailEntity==null){ - invPlaceOrderDetailEntity=new InvPlaceOrderDetailEntity(); + if (StrUtil.isNotBlank(bindInvSpaceRequest.getOrderId())) { + QueryWrapper ew = new QueryWrapper(); + ew.eq("recordId", bindInvSpaceRequest.getOrderId()); + ew.eq("code", bindInvSpaceRequest.getCode()); + InvPlaceOrderDetailEntity invPlaceOrderDetailEntity = invPlaceOrderDetailDao.selectOne(ew); + if (invPlaceOrderDetailEntity == null) { + invPlaceOrderDetailEntity = new InvPlaceOrderDetailEntity(); invPlaceOrderDetailEntity.setCount(0); } - if(invPlaceOrderDetailEntity.getCount()>=count){ + if (invPlaceOrderDetailEntity.getCount() >= count) { return "该产品库存不足!"; } } - } else if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_NORMAL){ - if(bindInvSpaceRequest.getType()==3){ - QueryWrapper ew=new QueryWrapper<>(); - ew.eq("code",bindInvSpaceRequest.getCode()); - ew.eq("invSpaceCode",bindInvSpaceRequest.getInvSpaceCode()); - InvProductDetailEntity invProductDetailEntity=invProductDetailDao.selectOne(ew); - count=invProductDetailEntity.getInCount(); - }else{ - count = invProductDetailDao.getInventoryQuantity(bindInvSpaceRequest.getCode()); + } else if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_NORMAL) { + if (bindInvSpaceRequest.getType() == 3) { + QueryWrapper ew = new QueryWrapper<>(); + ew.eq("code", bindInvSpaceRequest.getCode()); + ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); + InvProductDetailEntity invProductDetailEntity = invProductDetailDao.selectOne(ew); + count = invProductDetailEntity.getInCount(); + } else { + count = invProductDetailDao.getInventoryQuantity(bindInvSpaceRequest.getCode()); } - if(count==null || count<=0){ + if (count == null || count <= 0) { return "该产品库存不足!"; } - if(StrUtil.isNotBlank(bindInvSpaceRequest.getOrderId())){ - QueryWrapper ew=new QueryWrapper(); - ew.eq("recordId",bindInvSpaceRequest.getOrderId()); - ew.eq("code",bindInvSpaceRequest.getCode()); - InvPlaceOrderDetailEntity invPlaceOrderDetailEntity =invPlaceOrderDetailDao.selectOne(ew); - if(invPlaceOrderDetailEntity==null){ - invPlaceOrderDetailEntity=new InvPlaceOrderDetailEntity(); + if (StrUtil.isNotBlank(bindInvSpaceRequest.getOrderId())) { + QueryWrapper ew = new QueryWrapper(); + ew.eq("recordId", bindInvSpaceRequest.getOrderId()); + ew.eq("code", bindInvSpaceRequest.getCode()); + InvPlaceOrderDetailEntity invPlaceOrderDetailEntity = invPlaceOrderDetailDao.selectOne(ew); + if (invPlaceOrderDetailEntity == null) { + invPlaceOrderDetailEntity = new InvPlaceOrderDetailEntity(); + invPlaceOrderDetailEntity.setCount(0); + } + if (invPlaceOrderDetailEntity.getCount() >= count) { + return "该产品库存不足!"; + } + } + } + return ""; + } + + + @Override + public String checkOutCount(BindInvSpaceRequest bindInvSpaceRequest) { + InvWarehouseEntity invWarehouseEntity = invWarehouseDao.selectOne(new QueryWrapper().eq("code", bindInvSpaceRequest.getInvCode())); + if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_PREIN) { + QueryWrapper ew = new QueryWrapper<>(); + ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); + ew.eq("code", bindInvSpaceRequest.getCode()); + ew.select("count"); + ew.last("limit 1"); + InvPreInProductDetailEntity invPreInProductDetailEntity = invPreInProductDetailDao.selectOne(ew); + if (invPreInProductDetailEntity.getCount() <= 0) { + return "该产品没存在该货架上!"; + } + if (StrUtil.isNotBlank(bindInvSpaceRequest.getOrderId())) { + QueryWrapper ew1 = new QueryWrapper(); + ew1.eq("recordId", bindInvSpaceRequest.getOrderId()); + ew1.eq("code", bindInvSpaceRequest.getCode()); + InvPlaceOrderDetailEntity invPlaceOrderDetailEntity = invPlaceOrderDetailDao.selectOne(ew1); + if (invPlaceOrderDetailEntity == null) { + invPlaceOrderDetailEntity = new InvPlaceOrderDetailEntity(); + invPlaceOrderDetailEntity.setCount(0); + } + if (invPlaceOrderDetailEntity.getCount() >= invPreInProductDetailEntity.getCount()) { + return "该产品库存不足!"; + } + } + } else if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_ADVANCE) { + QueryWrapper ew = new QueryWrapper<>(); + ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); + ew.eq("code", bindInvSpaceRequest.getCode()); + ew.select("count"); + ew.last("limit 1"); + InvPreProductDetailEntity invPreProductDetailEntity = invPreProductDetailDao.selectOne(ew); + if (invPreProductDetailEntity.getCount() <= 0) { + return "该产品没存在该货架上!"; + } + if (StrUtil.isNotBlank(bindInvSpaceRequest.getOrderId())) { + QueryWrapper ew1 = new QueryWrapper(); + ew1.eq("recordId", bindInvSpaceRequest.getOrderId()); + ew1.eq("code", bindInvSpaceRequest.getCode()); + InvPlaceOrderDetailEntity invPlaceOrderDetailEntity = invPlaceOrderDetailDao.selectOne(ew1); + if (invPlaceOrderDetailEntity == null) { + invPlaceOrderDetailEntity = new InvPlaceOrderDetailEntity(); + invPlaceOrderDetailEntity.setCount(0); + } + if (invPlaceOrderDetailEntity.getCount() >= invPreProductDetailEntity.getCount()) { + return "该产品库存不足!"; + } + } + } else if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_NORMAL) { + QueryWrapper ew = new QueryWrapper<>(); + ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); + ew.eq("code", bindInvSpaceRequest.getCode()); + ew.select("count"); + ew.last("limit 1"); + InvProductDetailEntity invProductDetailEntity = invProductDetailDao.selectOne(ew); + if (invProductDetailEntity.getCount() <= 0) { + return "该产品没存在该货架上!"; + } + if (StrUtil.isNotBlank(bindInvSpaceRequest.getOrderId())) { + QueryWrapper ew1 = new QueryWrapper(); + ew1.eq("recordId", bindInvSpaceRequest.getOrderId()); + ew1.eq("code", bindInvSpaceRequest.getCode()); + InvPlaceOrderDetailEntity invPlaceOrderDetailEntity = invPlaceOrderDetailDao.selectOne(ew1); + if (invPlaceOrderDetailEntity == null) { + invPlaceOrderDetailEntity = new InvPlaceOrderDetailEntity(); invPlaceOrderDetailEntity.setCount(0); } - if(invPlaceOrderDetailEntity.getCount()>=count){ + if (invPlaceOrderDetailEntity.getCount() >= invProductDetailEntity.getCount()) { return "该产品库存不足!"; } } @@ -565,11 +647,13 @@ public class InvPlaceServiceImpl implements InvPlaceService { return ""; } + public int getActCount(String nameCode) { UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectByNameCode(nameCode); int count = getActCount(udiRelevanceResponse); return count; } + public int getActCount(UdiRelevanceResponse udiRelevanceResponse) { int actCount; if (!udiRelevanceResponse.getUseDy() && (udiRelevanceResponse.getDiType() == null || udiRelevanceResponse.getDiType() != 2)) { @@ -590,4 +674,352 @@ public class InvPlaceServiceImpl implements InvPlaceService { return actCount; } + + @Override + public BaseResponse unbindInvOrderSpace(BindInvSpaceRequest bindInvSpaceRequest) { + //查询仓库的部门ID +// String deptCode = invWarehouseDao.selectParentIdByCode(bindInvSpaceRequest.getInvCode()); + InvWarehouseEntity invWarehouseEntity = invWarehouseDao.filterGroupInvSubAndcode(bindInvSpaceRequest.getInvCode()); + List invPlaceOrderDetailEntityList = new ArrayList<>(); + int total=0; + if (bindInvSpaceRequest.getOutCount() > 0) { + if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_PREIN) { + invPlaceOrderDetailEntityList = invPlaceOrderDetailDao.selectList(new QueryWrapper().eq("recordId", bindInvSpaceRequest.getOrderId())); + for (InvPlaceOrderDetailEntity invPlaceOrderDetailEntity : invPlaceOrderDetailEntityList) { + + for (Integer i = 0; i < invPlaceOrderDetailEntity.getCount(); i++) { + //去掉库存 + QueryWrapper ew = new QueryWrapper<>(); + InvPreInProductDetailEntity invPreInProductDetailEntity = new InvPreInProductDetailEntity(); + ew.eq("code", invPlaceOrderDetailEntity.getCode()); + ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); + ew.gt("inCount", 0); + ew.last("limit 1"); + invPreInProductDetailEntity = invPreInProductDetailDao.selectOne(ew); + + + if (invPreInProductDetailEntity.getInCount() > 0) { + String nameCode = invPreInProductDetailEntity.getNameCode(); + int reCount = getActCount(nameCode); + invPreInProductDetailEntity.setInCount(invPreInProductDetailEntity.getInCount() - 1); + invPreInProductDetailEntity.setCount(invPreInProductDetailEntity.getCount() - 1); + invPreInProductDetailEntity.setReCount(invPreInProductDetailEntity.getReCount() - reCount); + invPreInProductDetailDao.updateById(invPreInProductDetailEntity); + + //如果库存为空就删了该数据 + ew.clear(); + ew.eq("code", invPlaceOrderDetailEntity.getCode()); + ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); + ew.last("limit 1"); + invPreInProductDetailEntity = invPreInProductDetailDao.selectOne(ew); + if (invPreInProductDetailEntity != null && invPreInProductDetailEntity.getInCount() == 0 && invPreInProductDetailEntity.getOutCount() == 0 + && invPreInProductDetailEntity.getCount() == 0 && invPreInProductDetailEntity.getReCount() == 0) { + invPreInProductDetailDao.deleteById(invPreInProductDetailEntity); + } + + + //如果有存在数据就加没有就新建 + ew.clear(); + ew.eq("code", invPlaceOrderDetailEntity.getCode()); + ew.and(o -> o.isNull("invSpaceCode").or().eq("invSpaceCode", "")); + ew.last("limit 1"); + invPreInProductDetailEntity = invPreInProductDetailDao.selectOne(ew); + if (invPreInProductDetailEntity != null) { + nameCode = invPreInProductDetailEntity.getNameCode(); + reCount = getActCount(nameCode); + invPreInProductDetailEntity.setInCount(invPreInProductDetailEntity.getInCount() + 1); + invPreInProductDetailEntity.setCount(invPreInProductDetailEntity.getCount() + 1); + invPreInProductDetailEntity.setReCount(invPreInProductDetailEntity.getReCount() + reCount); + invPreInProductDetailDao.updateById(invPreInProductDetailEntity); + } else { + ew.clear(); + ew.eq("code", invPlaceOrderDetailEntity.getCode()); + ew.last("limit 1"); + invPreInProductDetailEntity = invPreInProductDetailDao.selectOne(ew); + invPreInProductDetailEntity.setId(null); + invPreInProductDetailEntity.setInvSpaceCode(""); + invPreInProductDetailEntity.setInCount(1); + invPreInProductDetailEntity.setCount(1); + invPreInProductDetailEntity.setReCount(reCount); + invPreInProductDetailEntity.setOutCount(0); + invPreInProductDetailDao.insert(invPreInProductDetailEntity); + } + } + } + } + } else if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_ADVANCE) { + + invPlaceOrderDetailEntityList = invPlaceOrderDetailDao.selectList(new QueryWrapper().eq("recordId", bindInvSpaceRequest.getOrderId())); + for (InvPlaceOrderDetailEntity invPlaceOrderDetailEntity : invPlaceOrderDetailEntityList) { + + for (Integer i = 0; i < invPlaceOrderDetailEntity.getCount(); i++) { + //去掉库存 + QueryWrapper ew = new QueryWrapper<>(); + InvPreProductDetailEntity invPreProductDetailEntity = new InvPreProductDetailEntity(); + ew.eq("code", invPlaceOrderDetailEntity.getCode()); + ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); + ew.gt("inCount", 0); + ew.last("limit 1"); + invPreProductDetailEntity = invPreProductDetailDao.selectOne(ew); + + + if (invPreProductDetailEntity.getInCount() > 0) { + String nameCode = invPlaceOrderDetailEntity.getNameCode(); + int reCount = getActCount(nameCode); + invPreProductDetailEntity.setInCount(invPreProductDetailEntity.getInCount() - 1); + invPreProductDetailEntity.setCount(invPreProductDetailEntity.getCount() - 1); + invPreProductDetailEntity.setReCount(invPreProductDetailEntity.getReCount() - reCount); + invPreProductDetailDao.updateById(invPreProductDetailEntity); + + //如果库存为空就删了该数据 + ew.clear(); + ew.eq("code", invPlaceOrderDetailEntity.getCode()); + ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); + ew.last("limit 1"); + invPreProductDetailEntity = invPreProductDetailDao.selectOne(ew); + if (invPreProductDetailEntity != null && invPreProductDetailEntity.getInCount() == 0 && invPreProductDetailEntity.getOutCount() == 0 + && invPreProductDetailEntity.getCount() == 0 && invPreProductDetailEntity.getReCount() == 0) { + invPreProductDetailDao.deleteById(invPreProductDetailEntity); + } + + + //如果有存在数据就加没有就新建 + ew.clear(); + ew.eq("code", invPlaceOrderDetailEntity.getCode()); + ew.and(o -> o.isNull("invSpaceCode").or().eq("invSpaceCode", "")); + ew.last("limit 1"); + invPreProductDetailEntity = invPreProductDetailDao.selectOne(ew); + if (invPreProductDetailEntity != null) { + nameCode = invPreProductDetailEntity.getNameCode(); + reCount = getActCount(nameCode); + invPreProductDetailEntity.setInCount(invPreProductDetailEntity.getInCount() + 1); + invPreProductDetailEntity.setCount(invPreProductDetailEntity.getCount() + 1); + invPreProductDetailEntity.setReCount(invPreProductDetailEntity.getReCount() + reCount); + invPreProductDetailDao.updateById(invPreProductDetailEntity); + } else { + ew.clear(); + ew.eq("code", invPlaceOrderDetailEntity.getCode()); + ew.last("limit 1"); + invPreProductDetailEntity = invPreProductDetailDao.selectOne(ew); + invPreProductDetailEntity.setId(null); + invPreProductDetailEntity.setInvSpaceCode(""); + invPreProductDetailEntity.setInCount(1); + invPreProductDetailEntity.setCount(1); + invPreProductDetailEntity.setReCount(reCount); + invPreProductDetailEntity.setOutCount(0); + invPreProductDetailDao.insert(invPreProductDetailEntity); + } + } + } + } + + + } else { + invPlaceOrderDetailEntityList = invPlaceOrderDetailDao.selectList(new QueryWrapper().eq("recordId", bindInvSpaceRequest.getOrderId())); + for (InvPlaceOrderDetailEntity invPlaceOrderDetailEntity : invPlaceOrderDetailEntityList) { + + for (Integer i = 0; i < invPlaceOrderDetailEntity.getCount(); i++) { + //去掉库存 + QueryWrapper ew = new QueryWrapper<>(); + InvProductDetailEntity invProductDetailEntity = new InvProductDetailEntity(); + ew.eq("code", invPlaceOrderDetailEntity.getCode()); + ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); + ew.gt("inCount", 0); + ew.last("limit 1"); + invProductDetailEntity = invProductDetailDao.selectOne(ew); + + + if (invProductDetailEntity.getInCount() > 0) { + String nameCode = invProductDetailEntity.getNameCode(); + int reCount = getActCount(nameCode); + invProductDetailEntity.setInCount(invProductDetailEntity.getInCount() - 1); + invProductDetailEntity.setCount(invProductDetailEntity.getCount() - 1); + invProductDetailEntity.setReCount(invProductDetailEntity.getReCount() - reCount); + invProductDetailDao.updateById(invProductDetailEntity); + + //如果库存为空就删了该数据 + ew.clear(); + ew.eq("code", invPlaceOrderDetailEntity.getCode()); + ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); + ew.last("limit 1"); + invProductDetailEntity = invProductDetailDao.selectOne(ew); + if (invProductDetailEntity != null && invProductDetailEntity.getInCount() == 0 && invProductDetailEntity.getOutCount() == 0 + && invProductDetailEntity.getCount() == 0 && invProductDetailEntity.getReCount() == 0) { + invProductDetailDao.deleteById(invProductDetailEntity); + } + + + //如果有存在数据就加没有就新建 + ew.clear(); + ew.eq("code", invPlaceOrderDetailEntity.getCode()); + ew.and(o -> o.isNull("invSpaceCode").or().eq("invSpaceCode", "")); + ew.last("limit 1"); + invProductDetailEntity = invProductDetailDao.selectOne(ew); + if (invProductDetailEntity != null) { + nameCode = invProductDetailEntity.getNameCode(); + reCount = getActCount(nameCode); + invProductDetailEntity.setInCount(invProductDetailEntity.getInCount() + 1); + invProductDetailEntity.setCount(invProductDetailEntity.getCount() + 1); + invProductDetailEntity.setReCount(invProductDetailEntity.getReCount() + reCount); + invProductDetailDao.updateById(invProductDetailEntity); + } else { + ew.clear(); + ew.eq("code", invPlaceOrderDetailEntity.getCode()); + ew.last("limit 1"); + invProductDetailEntity = invProductDetailDao.selectOne(ew); + invProductDetailEntity.setId(null); + invProductDetailEntity.setInvSpaceCode(""); + invProductDetailEntity.setInCount(1); + invProductDetailEntity.setCount(1); + invProductDetailEntity.setReCount(reCount); + invProductDetailEntity.setOutCount(0); + invProductDetailDao.insert(invProductDetailEntity); + } + } + } + } + } + total = invPlaceOrderDetailEntityList.stream().mapToInt(InvPlaceOrderDetailEntity::getCount).sum(); + } else { + if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_PREIN) { + + QueryWrapper ew = new QueryWrapper<>(); + ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); + InvPreInProductDetailEntity invPreInProductDetailEntity = new InvPreInProductDetailEntity(); + invPreInProductDetailEntity.setInvSpaceCode(""); + List invProductDetailEntityList=invPreInProductDetailDao.selectList(ew); + //操作人ID + String userId = customerService.getUserIdStr(); + String recordId = gennerOrderUtils.createInvPlaceOrderNo(new OrderNoTypeBean(Constant.INV_PLACE_ORDER, "yyyyMMdd")); + //插入主表 + InvPlaceOrderEntity orderEntity = new InvPlaceOrderEntity(); + orderEntity.setId(IdUtil.getSnowflakeNextId()); + orderEntity.setRecordId(recordId); + orderEntity.setType(4); + orderEntity.setCreateUser(userId); + orderEntity.setCreateTime(new Date()); + orderEntity.setUpdateTime(new Date()); + invPlaceOrderDao.insert(orderEntity); + for (InvPreInProductDetailEntity productDetailEntity : invProductDetailEntityList) { + for (int i=0;i ew = new QueryWrapper<>(); + ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); + InvPreProductDetailEntity invPreProductDetailEntity = new InvPreProductDetailEntity(); + invPreProductDetailEntity.setInvSpaceCode(""); + List invProductDetailEntityList=invPreProductDetailDao.selectList(ew); + //操作人ID + String userId = customerService.getUserIdStr(); + String recordId = gennerOrderUtils.createInvPlaceOrderNo(new OrderNoTypeBean(Constant.INV_PLACE_ORDER, "yyyyMMdd")); + //插入主表 + InvPlaceOrderEntity orderEntity = new InvPlaceOrderEntity(); + orderEntity.setId(IdUtil.getSnowflakeNextId()); + orderEntity.setRecordId(recordId); + orderEntity.setType(4); + orderEntity.setCreateUser(userId); + orderEntity.setCreateTime(new Date()); + orderEntity.setUpdateTime(new Date()); + invPlaceOrderDao.insert(orderEntity); + for (InvPreProductDetailEntity productDetailEntity : invProductDetailEntityList) { + for (int i=0;i ew = new QueryWrapper<>(); + ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); + InvProductDetailEntity invProductDetailEntity = new InvProductDetailEntity(); + invProductDetailEntity.setInvSpaceCode(""); + List invProductDetailEntityList=invProductDetailDao.selectList(ew); + //操作人ID + String userId = customerService.getUserIdStr(); + String recordId = gennerOrderUtils.createInvPlaceOrderNo(new OrderNoTypeBean(Constant.INV_PLACE_ORDER, "yyyyMMdd")); + //插入主表 + InvPlaceOrderEntity orderEntity = new InvPlaceOrderEntity(); + orderEntity.setId(IdUtil.getSnowflakeNextId()); + orderEntity.setRecordId(recordId); + orderEntity.setType(4); + orderEntity.setCreateUser(userId); + orderEntity.setCreateTime(new Date()); + orderEntity.setUpdateTime(new Date()); + invPlaceOrderDao.insert(orderEntity); + for (InvProductDetailEntity productDetailEntity : invProductDetailEntityList) { + for (int i=0;i ew = new QueryWrapper<>(); + ew.eq("recordId", bindInvSpaceRequest.getOrderId()); + InvPlaceOrderEntity invPlaceOrderEntity = new InvPlaceOrderEntity(); + invPlaceOrderEntity.setRecordId(bindInvSpaceRequest.getOrderId()); + invPlaceOrderEntity.setCount(total); + invPlaceOrderDao.update(invPlaceOrderEntity, ew); + return ResultVOUtils.success(); + } } From 2eccbe7c8aa3a44192b5bde804813ec6317ccf4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Tue, 9 May 2023 16:22:47 +0800 Subject: [PATCH 04/48] =?UTF-8?q?=E7=89=A9=E8=B5=84=E6=91=86=E6=94=BE?= =?UTF-8?q?=E4=B8=8B=E6=9E=B6=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/inv/impl/InvPlaceServiceImpl.java | 123 +++++++++++------- 1 file changed, 75 insertions(+), 48 deletions(-) diff --git a/src/main/java/com/glxp/api/service/inv/impl/InvPlaceServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/InvPlaceServiceImpl.java index d88765f02..c0b6c40a9 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/InvPlaceServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/InvPlaceServiceImpl.java @@ -902,22 +902,31 @@ public class InvPlaceServiceImpl implements InvPlaceService { invPlaceOrderDao.insert(orderEntity); for (InvPreInProductDetailEntity productDetailEntity : invProductDetailEntityList) { for (int i=0;i ew1 = new QueryWrapper<>(); + ew1.eq("recordId", recordId); + ew1.eq("code", productDetailEntity.getCode()); + InvPlaceOrderDetailEntity invPlaceOrderDetailEntity = invPlaceOrderDetailDao.selectOne(ew1); + if (invPlaceOrderDetailEntity != null) { + invPlaceOrderDetailEntity.setCount(invPlaceOrderDetailEntity.getCount() + 1); + invPlaceOrderDetailDao.updateById(invPlaceOrderDetailEntity); + }else{ + invPlaceOrderDetailEntity = new InvPlaceOrderDetailEntity(); + invPlaceOrderDetailEntity.setId(IdUtil.getSnowflakeNextId()); + invPlaceOrderDetailEntity.setRecordId(recordId); + invPlaceOrderDetailEntity.setBatchNo(productDetailEntity.getBatchNo()); + invPlaceOrderDetailEntity.setRelId(productDetailEntity.getRelId() + ""); + invPlaceOrderDetailEntity.setNameCode(productDetailEntity.getNameCode()); + invPlaceOrderDetailEntity.setExpireDate(productDetailEntity.getExpireDate()); + invPlaceOrderDetailEntity.setProduceDate(productDetailEntity.getProduceDate()); + invPlaceOrderDetailEntity.setSupId(productDetailEntity.getSupId()); + invPlaceOrderDetailEntity.setInvCode(bindInvSpaceRequest.getInvCode()); + invPlaceOrderDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getInvSpaceCode()); + invPlaceOrderDetailEntity.setCode(productDetailEntity.getCode()); + invPlaceOrderDetailEntity.setSerialNo(productDetailEntity.getSerialNo()); + invPlaceOrderDetailEntity.setCount(1); + invPlaceOrderDetailDao.insert(invPlaceOrderDetailEntity); + } total++; } } @@ -945,22 +954,31 @@ public class InvPlaceServiceImpl implements InvPlaceService { invPlaceOrderDao.insert(orderEntity); for (InvPreProductDetailEntity productDetailEntity : invProductDetailEntityList) { for (int i=0;i ew1 = new QueryWrapper<>(); + ew1.eq("recordId", recordId); + ew1.eq("code", productDetailEntity.getCode()); + InvPlaceOrderDetailEntity invPlaceOrderDetailEntity = invPlaceOrderDetailDao.selectOne(ew1); + if (invPlaceOrderDetailEntity != null) { + invPlaceOrderDetailEntity.setCount(invPlaceOrderDetailEntity.getCount() + 1); + invPlaceOrderDetailDao.updateById(invPlaceOrderDetailEntity); + }else{ + invPlaceOrderDetailEntity = new InvPlaceOrderDetailEntity(); + invPlaceOrderDetailEntity.setId(IdUtil.getSnowflakeNextId()); + invPlaceOrderDetailEntity.setRecordId(recordId); + invPlaceOrderDetailEntity.setBatchNo(productDetailEntity.getBatchNo()); + invPlaceOrderDetailEntity.setRelId(productDetailEntity.getRelId() + ""); + invPlaceOrderDetailEntity.setNameCode(productDetailEntity.getNameCode()); + invPlaceOrderDetailEntity.setExpireDate(productDetailEntity.getExpireDate()); + invPlaceOrderDetailEntity.setProduceDate(productDetailEntity.getProduceDate()); + invPlaceOrderDetailEntity.setSupId(productDetailEntity.getSupId()); + invPlaceOrderDetailEntity.setInvCode(bindInvSpaceRequest.getInvCode()); + invPlaceOrderDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getInvSpaceCode()); + invPlaceOrderDetailEntity.setCode(productDetailEntity.getCode()); + invPlaceOrderDetailEntity.setSerialNo(productDetailEntity.getSerialNo()); + invPlaceOrderDetailEntity.setCount(1); + invPlaceOrderDetailDao.insert(invPlaceOrderDetailEntity); + } total++; } } @@ -987,22 +1005,31 @@ public class InvPlaceServiceImpl implements InvPlaceService { invPlaceOrderDao.insert(orderEntity); for (InvProductDetailEntity productDetailEntity : invProductDetailEntityList) { for (int i=0;i ew1 = new QueryWrapper<>(); + ew1.eq("recordId", recordId); + ew1.eq("code", productDetailEntity.getCode()); + InvPlaceOrderDetailEntity invPlaceOrderDetailEntity = invPlaceOrderDetailDao.selectOne(ew1); + if (invPlaceOrderDetailEntity != null) { + invPlaceOrderDetailEntity.setCount(invPlaceOrderDetailEntity.getCount() + 1); + invPlaceOrderDetailDao.updateById(invPlaceOrderDetailEntity); + }else{ + invPlaceOrderDetailEntity = new InvPlaceOrderDetailEntity(); + invPlaceOrderDetailEntity.setId(IdUtil.getSnowflakeNextId()); + invPlaceOrderDetailEntity.setRecordId(recordId); + invPlaceOrderDetailEntity.setBatchNo(productDetailEntity.getBatchNo()); + invPlaceOrderDetailEntity.setRelId(productDetailEntity.getRelId() + ""); + invPlaceOrderDetailEntity.setNameCode(productDetailEntity.getNameCode()); + invPlaceOrderDetailEntity.setExpireDate(productDetailEntity.getExpireDate()); + invPlaceOrderDetailEntity.setProduceDate(productDetailEntity.getProduceDate()); + invPlaceOrderDetailEntity.setSupId(productDetailEntity.getSupId()); + invPlaceOrderDetailEntity.setInvCode(bindInvSpaceRequest.getInvCode()); + invPlaceOrderDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getInvSpaceCode()); + invPlaceOrderDetailEntity.setCode(productDetailEntity.getCode()); + invPlaceOrderDetailEntity.setSerialNo(productDetailEntity.getSerialNo()); + invPlaceOrderDetailEntity.setCount(1); + invPlaceOrderDetailDao.insert(invPlaceOrderDetailEntity); + } total++; } } From 4ed43cda03c12d54cea9f36b8218a08273eb7aa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Tue, 9 May 2023 17:27:47 +0800 Subject: [PATCH 05/48] =?UTF-8?q?=E5=BA=93=E5=AD=98=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=B4=A7=E6=9E=B6=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inv/InvPreProductController.java | 9 ++- .../inv/InvPreinProductController.java | 14 ++-- .../glxp/api/dao/inv/InvPreProductDao.java | 4 + .../glxp/api/dao/inv/InvPreinProductDao.java | 6 ++ .../req/inv/FilterInvPreProductRequest.java | 6 ++ .../req/inv/FilterInvPreinProductRequest.java | 2 + .../api/service/inv/InvPreProductService.java | 5 ++ .../service/inv/InvPreinProductService.java | 5 ++ .../inv/impl/InvPreProductServiceImpl.java | 11 +++ .../inv/impl/InvPreinProductServiceImpl.java | 11 +++ .../mybatis/mapper/inv/InvPreProductDao.xml | 81 +++++++++++++++++++ .../mybatis/mapper/inv/InvPreinProductDao.xml | 81 +++++++++++++++++++ .../mapper/inv/invProductDetailDao.xml | 8 +- 13 files changed, 233 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/inv/InvPreProductController.java b/src/main/java/com/glxp/api/controller/inv/InvPreProductController.java index 539ee80f3..ab66a8ddc 100644 --- a/src/main/java/com/glxp/api/controller/inv/InvPreProductController.java +++ b/src/main/java/com/glxp/api/controller/inv/InvPreProductController.java @@ -71,7 +71,14 @@ public class InvPreProductController extends BaseController { filterInvPreProductRequest.setInvCodes(invCodes); } } - List list = invPreProductService.filterList(filterInvPreProductRequest); + List list = new ArrayList<>(); + + if (StrUtil.isNotEmpty(filterInvPreProductRequest.getInvSpaceCode())) { + list = invPreProductService.findGroupBySpace(filterInvPreProductRequest); + } else { + list = invPreProductService.filterList(filterInvPreProductRequest); + } + PageInfo pageInfo = new PageInfo<>(list); InvPreProductPageResponse pageResponse = new InvPreProductPageResponse<>(); pageResponse.setList(pageInfo.getList()); diff --git a/src/main/java/com/glxp/api/controller/inv/InvPreinProductController.java b/src/main/java/com/glxp/api/controller/inv/InvPreinProductController.java index d3ad067fe..235a53390 100644 --- a/src/main/java/com/glxp/api/controller/inv/InvPreinProductController.java +++ b/src/main/java/com/glxp/api/controller/inv/InvPreinProductController.java @@ -13,10 +13,7 @@ import com.glxp.api.req.inv.FilterInvPreProductDetailRequest; import com.glxp.api.req.inv.FilterInvPreinDetailRequest; import com.glxp.api.req.inv.FilterInvPreinProductRequest; import com.glxp.api.res.PageSimpleResponse; -import com.glxp.api.res.inv.InvPreProductDetailResponse; -import com.glxp.api.res.inv.InvPreProductPageResponse; -import com.glxp.api.res.inv.InvPreinDetailResponse; -import com.glxp.api.res.inv.InvPreinProductResponse; +import com.glxp.api.res.inv.*; import com.glxp.api.service.auth.CustomerService; import com.glxp.api.service.auth.WarehouseUserService; import com.glxp.api.service.inv.InvPreinDetailService; @@ -65,7 +62,14 @@ public class InvPreinProductController extends BaseController { filterInvPreinProductRequest.setInvCodes(invCodes); } } - List list = invPreinProductService.filterList(filterInvPreinProductRequest); + + List list = new ArrayList<>(); + if (StrUtil.isNotEmpty(filterInvPreinProductRequest.getInvSpaceCode())) { + list = invPreinProductService.findGroupBySpace(filterInvPreinProductRequest); + } else { + list = invPreinProductService.filterList(filterInvPreinProductRequest); + } + PageInfo pageInfo = new PageInfo<>(list); InvPreProductPageResponse pageResponse = new InvPreProductPageResponse<>(); pageResponse.setList(pageInfo.getList()); diff --git a/src/main/java/com/glxp/api/dao/inv/InvPreProductDao.java b/src/main/java/com/glxp/api/dao/inv/InvPreProductDao.java index d97268869..363c17af3 100644 --- a/src/main/java/com/glxp/api/dao/inv/InvPreProductDao.java +++ b/src/main/java/com/glxp/api/dao/inv/InvPreProductDao.java @@ -33,5 +33,9 @@ public interface InvPreProductDao extends BaseMapperPlus filterPreProductList(FilterInvPreProductRequest invPreProductRequest); + List findGroupBySpace(FilterInvPreProductRequest invPreProductRequest); + + + } diff --git a/src/main/java/com/glxp/api/dao/inv/InvPreinProductDao.java b/src/main/java/com/glxp/api/dao/inv/InvPreinProductDao.java index 785a06c56..90ae59f22 100644 --- a/src/main/java/com/glxp/api/dao/inv/InvPreinProductDao.java +++ b/src/main/java/com/glxp/api/dao/inv/InvPreinProductDao.java @@ -2,7 +2,9 @@ package com.glxp.api.dao.inv; import com.glxp.api.dao.BaseMapperPlus; import com.glxp.api.entity.inv.InvPreinProductEntity; +import com.glxp.api.req.inv.FilterInvPreProductRequest; import com.glxp.api.req.inv.FilterInvPreinProductRequest; +import com.glxp.api.res.inv.InvPreProductResponse; import com.glxp.api.res.inv.InvPreinProductResponse; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -33,4 +35,8 @@ public interface InvPreinProductDao extends BaseMapperPlus filterPreProductList(FilterInvPreinProductRequest invPreProductRequest); + List findGroupBySpace(FilterInvPreinProductRequest invPreProductRequest); + + + } diff --git a/src/main/java/com/glxp/api/req/inv/FilterInvPreProductRequest.java b/src/main/java/com/glxp/api/req/inv/FilterInvPreProductRequest.java index 4aeb982cd..3074d58c9 100644 --- a/src/main/java/com/glxp/api/req/inv/FilterInvPreProductRequest.java +++ b/src/main/java/com/glxp/api/req/inv/FilterInvPreProductRequest.java @@ -98,6 +98,12 @@ public class FilterInvPreProductRequest extends ListPageRequest { */ private String cplb; + /** + * 货位号 + */ + private String invSpaceCode; + + /** * 是否过滤0库存 */ diff --git a/src/main/java/com/glxp/api/req/inv/FilterInvPreinProductRequest.java b/src/main/java/com/glxp/api/req/inv/FilterInvPreinProductRequest.java index 6def0ab36..9c2583dae 100644 --- a/src/main/java/com/glxp/api/req/inv/FilterInvPreinProductRequest.java +++ b/src/main/java/com/glxp/api/req/inv/FilterInvPreinProductRequest.java @@ -103,6 +103,8 @@ public class FilterInvPreinProductRequest extends ListPageRequest { */ private String cplb; + private String invSpaceCode; + /** * 是否过滤0库存 */ diff --git a/src/main/java/com/glxp/api/service/inv/InvPreProductService.java b/src/main/java/com/glxp/api/service/inv/InvPreProductService.java index 8db3bcdc9..f276d679e 100644 --- a/src/main/java/com/glxp/api/service/inv/InvPreProductService.java +++ b/src/main/java/com/glxp/api/service/inv/InvPreProductService.java @@ -4,7 +4,9 @@ import com.glxp.api.entity.inv.InvPreProductEntity; import com.glxp.api.entity.inv.InvProductDetailEntity; import com.glxp.api.entity.inv.InvProductEntity; import com.glxp.api.req.inv.FilterInvPreProductRequest; +import com.glxp.api.req.inv.FilterInvProductRequest; import com.glxp.api.res.inv.InvPreProductResponse; +import com.glxp.api.res.inv.InvProductResponse; import java.util.List; @@ -30,6 +32,9 @@ public interface InvPreProductService { */ List filterList(FilterInvPreProductRequest invPreProductRequest); + + List findGroupBySpace(FilterInvPreProductRequest invPreProductRequest); + /** * 查询寄售库存列表 * diff --git a/src/main/java/com/glxp/api/service/inv/InvPreinProductService.java b/src/main/java/com/glxp/api/service/inv/InvPreinProductService.java index d1369a83b..fdf98ea66 100644 --- a/src/main/java/com/glxp/api/service/inv/InvPreinProductService.java +++ b/src/main/java/com/glxp/api/service/inv/InvPreinProductService.java @@ -1,7 +1,9 @@ package com.glxp.api.service.inv; import com.glxp.api.entity.inv.InvPreinProductEntity; +import com.glxp.api.req.inv.FilterInvPreProductRequest; import com.glxp.api.req.inv.FilterInvPreinProductRequest; +import com.glxp.api.res.inv.InvPreProductResponse; import com.glxp.api.res.inv.InvPreinProductResponse; import java.util.List; @@ -36,6 +38,9 @@ public interface InvPreinProductService { */ List filterPreinProductList(FilterInvPreinProductRequest invPreProductRequest); + List findGroupBySpace(FilterInvPreinProductRequest filterInvPreinDetailRequest); + + /** * 根据ID查询寄售库存信息 * diff --git a/src/main/java/com/glxp/api/service/inv/impl/InvPreProductServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/InvPreProductServiceImpl.java index b4f6a5d98..126f48011 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/InvPreProductServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/InvPreProductServiceImpl.java @@ -58,6 +58,17 @@ public class InvPreProductServiceImpl implements InvPreProductService { return invPreProductDao.filterList(invPreProductRequest); } + @Override + public List findGroupBySpace(FilterInvPreProductRequest invPreProductRequest) { + if (null == invPreProductRequest) { + return Collections.emptyList(); + } + if (null != invPreProductRequest.getPage() && null != invPreProductRequest.getLimit()) { + PageHelper.offsetPage((invPreProductRequest.getPage() - 1) * invPreProductRequest.getLimit(), invPreProductRequest.getLimit()); + } + return invPreProductDao.findGroupBySpace(invPreProductRequest); + } + @Override public List filterPreProductList(FilterInvPreProductRequest invPreProductRequest) { if (null == invPreProductRequest) { diff --git a/src/main/java/com/glxp/api/service/inv/impl/InvPreinProductServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/InvPreinProductServiceImpl.java index fa195182c..eb5f45a85 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/InvPreinProductServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/InvPreinProductServiceImpl.java @@ -68,6 +68,17 @@ public class InvPreinProductServiceImpl implements InvPreinProductService { return invPreinProductDao.filterPreProductList(invPreProductRequest); } + @Override + public List findGroupBySpace(FilterInvPreinProductRequest invPreProductRequest) { + if (null == invPreProductRequest) { + return Collections.emptyList(); + } + if (null != invPreProductRequest.getPage()) { + PageHelper.offsetPage((invPreProductRequest.getPage() - 1) * invPreProductRequest.getLimit(), invPreProductRequest.getLimit()); + } + return invPreinProductDao.findGroupBySpace(invPreProductRequest); + } + @Override public InvPreinProductEntity findById(String id) { return invPreinProductDao.selectById(id); diff --git a/src/main/resources/mybatis/mapper/inv/InvPreProductDao.xml b/src/main/resources/mybatis/mapper/inv/InvPreProductDao.xml index 6dcb9fe21..dd1c00110 100644 --- a/src/main/resources/mybatis/mapper/inv/InvPreProductDao.xml +++ b/src/main/resources/mybatis/mapper/inv/InvPreProductDao.xml @@ -136,4 +136,85 @@ + + diff --git a/src/main/resources/mybatis/mapper/inv/InvPreinProductDao.xml b/src/main/resources/mybatis/mapper/inv/InvPreinProductDao.xml index 45109277a..a91705992 100644 --- a/src/main/resources/mybatis/mapper/inv/InvPreinProductDao.xml +++ b/src/main/resources/mybatis/mapper/inv/InvPreinProductDao.xml @@ -135,4 +135,85 @@ + + diff --git a/src/main/resources/mybatis/mapper/inv/invProductDetailDao.xml b/src/main/resources/mybatis/mapper/inv/invProductDetailDao.xml index f2c474299..82731773f 100644 --- a/src/main/resources/mybatis/mapper/inv/invProductDetailDao.xml +++ b/src/main/resources/mybatis/mapper/inv/invProductDetailDao.xml @@ -14,9 +14,9 @@ ipp.expireDate, bp.ylqxzcrbarmc, bp.zczbhhzbapzbh, - ipp.inCount, - ipp.outCount, - ipp.reCount, + sum(ipp.inCount) as inCount, + sum(ipp.outCount) as outCount, + sum(ipp.reCount) as reCount, basic_corp.name supName, ipp.supId, auth_dept.name deptName, @@ -30,7 +30,7 @@ left join basic_corp on ipp.supId = basic_corp.erpId left join auth_dept on auth_dept.code = ipp.deptCode left join auth_warehouse on auth_warehouse.code = ipp.invCode - left join auth_space `as` on ipp.code = `as`.code + left join auth_space `as` on ipp.invSpaceCode = `as`.code AND bp.cpmctymc like concat('%', #{cpmctymc}, '%') From 17e1cdc144be2a00aefbd9e591fc12f2d0cd2fef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Tue, 9 May 2023 17:37:32 +0800 Subject: [PATCH 06/48] =?UTF-8?q?=E5=BA=93=E5=AD=98=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=B4=A7=E6=9E=B6=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/glxp/api/res/inv/InvPreProductDetailResponse.java | 3 +++ .../java/com/glxp/api/res/inv/InvPreinProductResponse.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/main/java/com/glxp/api/res/inv/InvPreProductDetailResponse.java b/src/main/java/com/glxp/api/res/inv/InvPreProductDetailResponse.java index a1535ad1d..4a8ed68ef 100644 --- a/src/main/java/com/glxp/api/res/inv/InvPreProductDetailResponse.java +++ b/src/main/java/com/glxp/api/res/inv/InvPreProductDetailResponse.java @@ -129,4 +129,7 @@ public class InvPreProductDetailResponse { private String invSpaceName; + // 货位名称 + private String spaceName; + } diff --git a/src/main/java/com/glxp/api/res/inv/InvPreinProductResponse.java b/src/main/java/com/glxp/api/res/inv/InvPreinProductResponse.java index 35940bb15..f31c78d9c 100644 --- a/src/main/java/com/glxp/api/res/inv/InvPreinProductResponse.java +++ b/src/main/java/com/glxp/api/res/inv/InvPreinProductResponse.java @@ -105,4 +105,7 @@ public class InvPreinProductResponse { */ private String invCode; + // 货位名称 + private String spaceName; + } From 0d3c03266052dd9eb91c474ef1a6bb1eb63c00c3 Mon Sep 17 00:00:00 2001 From: anthonywj Date: Tue, 9 May 2023 17:59:01 +0800 Subject: [PATCH 07/48] =?UTF-8?q?=E5=BA=93=E5=AD=98=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=8C=E5=86=85=E7=BD=91=E5=8D=95=E6=8D=AE?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E5=90=8C=E6=AD=A5=E5=88=B0=E5=A4=96=E7=BD=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/inout/IoOrderController.java | 14 +++++ .../glxp/api/http/sync/SpGetHttpClient.java | 16 +++++ .../glxp/api/service/sync/HeartService.java | 2 - .../mybatis/mapper/inv/InvPreProductDao.xml | 1 + .../mybatis/mapper/inv/InvPreinProductDao.xml | 60 +++++++++---------- .../mybatis/mapper/inv/invProductDao.xml | 2 +- 6 files changed, 62 insertions(+), 33 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderController.java index 3492feaca..e51adc96d 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderController.java @@ -18,6 +18,7 @@ import com.glxp.api.entity.auth.InvWarehouseEntity; import com.glxp.api.entity.basic.BasicBussinessTypeEntity; import com.glxp.api.entity.basic.EntrustReceEntity; import com.glxp.api.entity.inout.*; +import com.glxp.api.http.sync.SpGetHttpClient; import com.glxp.api.req.auth.FilterInvBusUserRequest; import com.glxp.api.req.basic.BasicEntrustRecRequest; import com.glxp.api.req.inout.*; @@ -34,6 +35,7 @@ import com.glxp.api.service.basic.IBasicBussinessTypeService; import com.glxp.api.service.inout.*; import com.glxp.api.util.CustomUtil; import com.glxp.api.util.GennerOrderUtils; +import com.glxp.api.util.IntUtil; import com.glxp.api.util.OrderNoTypeBean; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; @@ -644,10 +646,22 @@ public class IoOrderController extends BaseController { return ResultVOUtils.success(); } + @Resource + SpGetHttpClient spGetHttpClient; + @PostMapping("/udiwms/inout/order/updateOrder") @Log(title = "单据管理", businessType = BusinessType.UPDATE) public BaseResponse updateOrder(@RequestBody IoOrderEntity ioOrderEntity) { + + ioOrderEntity.setUpdateTime(new Date()); orderService.updateByBillNo(ioOrderEntity); + + if (IntUtil.value(ioOrderEntity.getCheckStatus()) != 0) { + IoOrderEntity orderEntity = new IoOrderEntity(); + orderEntity.setBillNo(ioOrderEntity.getBillNo()); + orderEntity.setCheckStatus(1); + spGetHttpClient.updateCheckStatus(orderEntity, getUserId() + ""); + } return ResultVOUtils.success(); } diff --git a/src/main/java/com/glxp/api/http/sync/SpGetHttpClient.java b/src/main/java/com/glxp/api/http/sync/SpGetHttpClient.java index 666e4d927..2687a3cf9 100644 --- a/src/main/java/com/glxp/api/http/sync/SpGetHttpClient.java +++ b/src/main/java/com/glxp/api/http/sync/SpGetHttpClient.java @@ -162,6 +162,22 @@ public class SpGetHttpClient { return response; } + //确认自助平台单据--直连接口 + public BaseResponse updateCheckStatus(IoOrderEntity orderEntity, String userId) { + + + List header = (List) Convert.toList(buildHeader()); + header.add("ADMIN_ID"); + header.add(userId); + + String json = JSONUtil.toJsonStr(orderEntity); + String result = okHttpCli.doPostJson(getIpUrl() + "/directToSpms" + "/udiwms/inout/order/updateOrder", json, Convert.toStrArray(header)); + BaseResponse response = + JSONObject.parseObject(result, new TypeReference>() { + }); + return response; + } + // 最小销售标识获取国家库信息 public BaseResponse> getSyncDi(ProductInfoFilterRequest productInfoFilterRequest) { diff --git a/src/main/java/com/glxp/api/service/sync/HeartService.java b/src/main/java/com/glxp/api/service/sync/HeartService.java index 065381970..19323a654 100644 --- a/src/main/java/com/glxp/api/service/sync/HeartService.java +++ b/src/main/java/com/glxp/api/service/sync/HeartService.java @@ -168,8 +168,6 @@ public class HeartService { } catch (IOException e) { throw new RuntimeException(e); } - - basicExportService.updateExportStatus(basicExportStatusEntity1); return ResultVOUtils.success(); } diff --git a/src/main/resources/mybatis/mapper/inv/InvPreProductDao.xml b/src/main/resources/mybatis/mapper/inv/InvPreProductDao.xml index dd1c00110..aebb81fbb 100644 --- a/src/main/resources/mybatis/mapper/inv/InvPreProductDao.xml +++ b/src/main/resources/mybatis/mapper/inv/InvPreProductDao.xml @@ -77,6 +77,7 @@ + group by ipp.id select ipp.id, - ipp.nameCode, - bp.cpmctymc, - ipp.relIdFk, - bp.ggxh, - ipp.batchNo, - ipp.productionDate, - ipp.expireDate, - bp.ylqxzcrbarmc, - bp.zczbhhzbapzbh, - ipp.inCount, - ipp.outCount, - ipp.reCount, - ipp.customerId, - basic_corp.name supName, - ipp.supId, - auth_dept.name deptName, - auth_warehouse.name invName, - ipp.deptCode, - ipp.invCode + ipp.nameCode, + bp.cpmctymc, + ipp.relIdFk, + bp.ggxh, + ipp.batchNo, + ipp.productionDate, + ipp.expireDate, + bp.ylqxzcrbarmc, + bp.zczbhhzbapzbh, + ipp.inCount, + ipp.outCount, + ipp.reCount, + ipp.customerId, + basic_corp.name supName, + ipp.supId, + auth_dept.name deptName, + auth_warehouse.name invName, + ipp.deptCode, + ipp.invCode from inv_prein_product ipp - inner join basic_udirel on ipp.relIdFk = basic_udirel.id - inner join basic_products bp on basic_udirel.uuid = bp.uuid - left join basic_corp on ipp.supId = basic_corp.erpId - left join auth_dept on auth_dept.code = ipp.deptCode - left join auth_warehouse on auth_warehouse.code = ipp.invCode + inner join basic_udirel on ipp.relIdFk = basic_udirel.id + inner join basic_products bp on basic_udirel.uuid = bp.uuid + left join basic_corp on ipp.supId = basic_corp.erpId + left join auth_dept on auth_dept.code = ipp.deptCode + left join auth_warehouse on auth_warehouse.code = ipp.invCode AND bp.cpmctymc like concat('%', #{cpmctymc}, '%') @@ -75,16 +75,17 @@ + group by ipp.id - diff --git a/src/main/resources/mybatis/mapper/inv/invProductDao.xml b/src/main/resources/mybatis/mapper/inv/invProductDao.xml index 708fd49b3..ae35efa14 100644 --- a/src/main/resources/mybatis/mapper/inv/invProductDao.xml +++ b/src/main/resources/mybatis/mapper/inv/invProductDao.xml @@ -85,7 +85,7 @@ - GROUP BY ip.relIdFk, ip.batchNo + GROUP BY ip.relIdFk, ip.batchNo, ip.supId order by ip.updateTime desc From 851232e2708f7a955807d8437b2f2ed1c3ee275d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Wed, 10 May 2023 11:26:52 +0800 Subject: [PATCH 08/48] =?UTF-8?q?=E5=BA=93=E5=AD=98=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=B4=A7=E6=9E=B6=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/inv/InvPlaceController.java | 34 +++++++++++ .../api/dao/inv/InvPreInProductDetailDao.java | 3 + .../api/dao/inv/InvPreProductDetailDao.java | 3 + .../glxp/api/dao/inv/InvProductDetailDao.java | 3 + .../api/res/inv/InvPlaceDetailResponse.java | 4 ++ .../api/service/inv/InvPlaceOrderService.java | 7 +++ .../inv/impl/InvPlaceOrderServiceImpl.java | 57 +++++++++++++++---- .../service/inv/impl/InvPlaceServiceImpl.java | 2 - .../mapper/inv/InvPreInProductDetailDao.xml | 37 ++++++++++++ .../mapper/inv/InvPreProductDetailDao.xml | 35 ++++++++++++ .../mapper/inv/invProductDetailDao.xml | 35 ++++++++++++ 11 files changed, 206 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/inv/InvPlaceController.java b/src/main/java/com/glxp/api/controller/inv/InvPlaceController.java index 4b616a181..8b6e46867 100644 --- a/src/main/java/com/glxp/api/controller/inv/InvPlaceController.java +++ b/src/main/java/com/glxp/api/controller/inv/InvPlaceController.java @@ -16,6 +16,7 @@ import com.glxp.api.res.inv.InvPlaceDetailResponse; import com.glxp.api.res.inv.InvPlaceOrderDetailResponse; import com.glxp.api.service.inv.InvPlaceOrderService; import com.glxp.api.service.inv.InvPlaceService; +import org.apache.commons.collections.ArrayStack; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -23,7 +24,9 @@ import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import javax.validation.Valid; +import java.lang.reflect.Array; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; /** @@ -237,5 +240,36 @@ public class InvPlaceController { return ResultVOUtils.page(pageInfo); } + /** + * 查询库存摆放记录 + * + * @return + */ + @GetMapping("/spms/inv/product/selectPlaceList") + public BaseResponse selectPlaceList(FilterInvPlaceRequest filterInvPlaceRequest) { + List invPlaceDetailResponseList=new ArrayStack(); + if(StrUtil.isNotBlank(filterInvPlaceRequest.getCode())){ + List list= Arrays.asList(filterInvPlaceRequest.getCode().split("#")); + if(list!=null && list.size()>=3){ + if(list.get(2) !=null && !list.get(2).equals("null")){ + //用产品查询 + filterInvPlaceRequest.setCode(list.get(2)); + invPlaceDetailResponseList= invPlaceOrderService.filterProductList(filterInvPlaceRequest); + }else if(list.get(0) !=null && list.get(1)!=null && !list.get(0).equals("null") && !list.get(1).equals("null") ){ + //用货位查询 + filterInvPlaceRequest.setInvCode(list.get(0)); + filterInvPlaceRequest.setInvSpaceCode(list.get(1)); + filterInvPlaceRequest.setCode(null); + invPlaceDetailResponseList= invPlaceOrderService.filterSpaceList(filterInvPlaceRequest); + }else{ + return ResultVOUtils.error(999,"扫码错误!"); + } + } + } + + PageInfo pageInfo = new PageInfo<>(invPlaceDetailResponseList); + return ResultVOUtils.page(pageInfo); + } + } diff --git a/src/main/java/com/glxp/api/dao/inv/InvPreInProductDetailDao.java b/src/main/java/com/glxp/api/dao/inv/InvPreInProductDetailDao.java index d4f1859d0..332207111 100644 --- a/src/main/java/com/glxp/api/dao/inv/InvPreInProductDetailDao.java +++ b/src/main/java/com/glxp/api/dao/inv/InvPreInProductDetailDao.java @@ -46,4 +46,7 @@ public interface InvPreInProductDetailDao extends BaseMapperPlus filterSpaceList(FilterInvPlaceRequest filterInvPlaceOrderRequest); + } diff --git a/src/main/java/com/glxp/api/dao/inv/InvPreProductDetailDao.java b/src/main/java/com/glxp/api/dao/inv/InvPreProductDetailDao.java index 15972bf6b..4adff783e 100644 --- a/src/main/java/com/glxp/api/dao/inv/InvPreProductDetailDao.java +++ b/src/main/java/com/glxp/api/dao/inv/InvPreProductDetailDao.java @@ -45,4 +45,7 @@ public interface InvPreProductDetailDao extends BaseMapperPlus getInvPlaceOrderList(FilterInvPlaceRequest filterInvPlaceRequest); Integer getInventoryQuantity(@Param("code") String code); + + //用货架查询 + List filterSpaceList(FilterInvPlaceRequest filterInvPlaceOrderRequest); } diff --git a/src/main/java/com/glxp/api/dao/inv/InvProductDetailDao.java b/src/main/java/com/glxp/api/dao/inv/InvProductDetailDao.java index 789eee944..7a61a9b6e 100644 --- a/src/main/java/com/glxp/api/dao/inv/InvProductDetailDao.java +++ b/src/main/java/com/glxp/api/dao/inv/InvProductDetailDao.java @@ -98,4 +98,7 @@ public interface InvProductDetailDao extends BaseMapperPlus getInvPlaceOrderList(FilterInvPlaceRequest filterInvPlaceRequest); Integer getInventoryQuantity(@Param("code") String code); + + //用货架查询 + List filterSpaceList(FilterInvPlaceRequest filterInvPlaceOrderRequest); } diff --git a/src/main/java/com/glxp/api/res/inv/InvPlaceDetailResponse.java b/src/main/java/com/glxp/api/res/inv/InvPlaceDetailResponse.java index 19ad425a4..22697dc89 100644 --- a/src/main/java/com/glxp/api/res/inv/InvPlaceDetailResponse.java +++ b/src/main/java/com/glxp/api/res/inv/InvPlaceDetailResponse.java @@ -118,4 +118,8 @@ public class InvPlaceDetailResponse { */ private String manufactory; + private Integer count; + + private String cpmctymc; + } diff --git a/src/main/java/com/glxp/api/service/inv/InvPlaceOrderService.java b/src/main/java/com/glxp/api/service/inv/InvPlaceOrderService.java index 9540b346c..690d4d7c3 100644 --- a/src/main/java/com/glxp/api/service/inv/InvPlaceOrderService.java +++ b/src/main/java/com/glxp/api/service/inv/InvPlaceOrderService.java @@ -7,6 +7,7 @@ import com.glxp.api.req.inv.FilterInvPlaceOrderRequest; import com.glxp.api.req.inv.FilterInvPlaceRequest; import com.glxp.api.res.inout.IoOrderResponse; import com.glxp.api.res.inv.BindInvSpaceRequest; +import com.glxp.api.res.inv.InvPlaceDetailResponse; import com.glxp.api.res.inv.InvPlaceOrderDetailResponse; import com.glxp.api.res.inv.InvPlaceOrderResponse; @@ -32,4 +33,10 @@ public interface InvPlaceOrderService { List filterInvPlaceOrderDetailList(FilterInvPlaceOrderRequest filterInvPlaceOrderRequest); + + //用产品查询 + List filterProductList(FilterInvPlaceRequest filterInvPlaceOrderRequest); + + //用货架查询 + List filterSpaceList(FilterInvPlaceRequest filterInvPlaceOrderRequest); } diff --git a/src/main/java/com/glxp/api/service/inv/impl/InvPlaceOrderServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/InvPlaceOrderServiceImpl.java index 5bcc1a337..37b909ada 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/InvPlaceOrderServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/InvPlaceOrderServiceImpl.java @@ -1,5 +1,6 @@ package com.glxp.api.service.inv.impl; +import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; @@ -18,6 +19,7 @@ import com.glxp.api.req.inv.FilterInvPlaceOrderRequest; import com.glxp.api.req.inv.FilterInvPlaceRequest; import com.glxp.api.res.inout.IoOrderResponse; import com.glxp.api.res.inv.BindInvSpaceRequest; +import com.glxp.api.res.inv.InvPlaceDetailResponse; import com.glxp.api.res.inv.InvPlaceOrderDetailResponse; import com.glxp.api.res.inv.InvPlaceOrderResponse; import com.glxp.api.service.auth.CustomerService; @@ -26,6 +28,7 @@ import com.glxp.api.service.inv.InvPlaceOrderService; import com.glxp.api.util.GennerOrderUtils; import com.glxp.api.util.OrderNoTypeBean; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -34,6 +37,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Date; import java.util.List; +import java.util.stream.Collectors; @Slf4j @Service @@ -129,8 +133,8 @@ public class InvPlaceOrderServiceImpl implements InvPlaceOrderService { if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_PREIN) { QueryWrapper ew = new QueryWrapper<>(); ew.eq("code", bindInvSpaceRequest.getCode()); - if(bindInvSpaceRequest.getType()==3){ - ew.eq("invSpaceCode",bindInvSpaceRequest.getInvSpaceCode()); + if (bindInvSpaceRequest.getType() == 3) { + ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); } ew.last("limit 1"); InvPreInProductDetailEntity invPreInProductDetailEntity = invPreInProductDetailDao.selectOne(ew); @@ -144,8 +148,8 @@ public class InvPlaceOrderServiceImpl implements InvPlaceOrderService { } else if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_ADVANCE) { QueryWrapper ew = new QueryWrapper<>(); ew.eq("code", bindInvSpaceRequest.getCode()); - if(bindInvSpaceRequest.getType()==3){ - ew.eq("invSpaceCode",bindInvSpaceRequest.getInvSpaceCode()); + if (bindInvSpaceRequest.getType() == 3) { + ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); } ew.last("limit 1"); InvPreProductDetailEntity invPreInProductDetailEntity = invPreProductDetailDao.selectOne(ew); @@ -159,8 +163,8 @@ public class InvPlaceOrderServiceImpl implements InvPlaceOrderService { } else if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_NORMAL) { QueryWrapper ew = new QueryWrapper<>(); ew.eq("code", bindInvSpaceRequest.getCode()); - if(bindInvSpaceRequest.getType()==3){ - ew.eq("invSpaceCode",bindInvSpaceRequest.getInvSpaceCode()); + if (bindInvSpaceRequest.getType() == 3) { + ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); } ew.last("limit 1"); InvProductDetailEntity invPreInProductDetailEntity = invProductDetailDao.selectOne(ew); @@ -203,9 +207,9 @@ public class InvPlaceOrderServiceImpl implements InvPlaceOrderService { invPlaceOrderDetailEntity.setProduceDate(produceDate); invPlaceOrderDetailEntity.setSupId(supId); invPlaceOrderDetailEntity.setInvCode(bindInvSpaceRequest.getInvCode()); - if(bindInvSpaceRequest.getType()==3){ + if (bindInvSpaceRequest.getType() == 3) { invPlaceOrderDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getChangeSpaceCode()); - }else{ + } else { invPlaceOrderDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getInvSpaceCode()); } invPlaceOrderDetailEntity.setCode(bindInvSpaceRequest.getCode()); @@ -234,9 +238,9 @@ public class InvPlaceOrderServiceImpl implements InvPlaceOrderService { invPlaceOrderDetailEntity.setExpireDate(expireDate); invPlaceOrderDetailEntity.setProduceDate(produceDate); invPlaceOrderDetailEntity.setSupId(supId); - if(bindInvSpaceRequest.getType()==3){ + if (bindInvSpaceRequest.getType() == 3) { invPlaceOrderDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getChangeSpaceCode()); - }else{ + } else { invPlaceOrderDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getInvSpaceCode()); } invPlaceOrderDetailEntity.setCode(bindInvSpaceRequest.getCode()); @@ -339,7 +343,7 @@ public class InvPlaceOrderServiceImpl implements InvPlaceOrderService { invPlaceOrderDetailEntity.setRecordId(recordId); invPlaceOrderDetailEntity.setBatchNo(filterInvPlaceOrderRequest.getBatchNo()); invPlaceOrderDetailEntity.setCode(filterInvPlaceOrderRequest.getCode()); - invPlaceOrderDetailEntity.setRelId(filterInvPlaceOrderRequest.getRelId()+""); + invPlaceOrderDetailEntity.setRelId(filterInvPlaceOrderRequest.getRelId() + ""); invPlaceOrderDetailEntity.setNameCode(filterInvPlaceOrderRequest.getNameCode()); invPlaceOrderDetailEntity.setExpireDate(filterInvPlaceOrderRequest.getExpireDate()); invPlaceOrderDetailEntity.setProduceDate(filterInvPlaceOrderRequest.getProduceDate()); @@ -358,7 +362,7 @@ public class InvPlaceOrderServiceImpl implements InvPlaceOrderService { invPlaceOrderDetailEntity.setRecordId(recordId); invPlaceOrderDetailEntity.setCode(filterInvPlaceOrderRequest.getCode()); invPlaceOrderDetailEntity.setBatchNo(filterInvPlaceOrderRequest.getBatchNo()); - invPlaceOrderDetailEntity.setRelId(filterInvPlaceOrderRequest.getRelId()+""); + invPlaceOrderDetailEntity.setRelId(filterInvPlaceOrderRequest.getRelId() + ""); invPlaceOrderDetailEntity.setNameCode(filterInvPlaceOrderRequest.getNameCode()); invPlaceOrderDetailEntity.setExpireDate(filterInvPlaceOrderRequest.getExpireDate()); invPlaceOrderDetailEntity.setProduceDate(filterInvPlaceOrderRequest.getProduceDate()); @@ -507,4 +511,33 @@ public class InvPlaceOrderServiceImpl implements InvPlaceOrderService { } return invPlaceOrderDetailDao.selectDetailList(filterInvPlaceOrderRequest.getOrderId()); } + + @Override + public List filterProductList(FilterInvPlaceRequest filterInvPlaceRequest) { + + List list = invPreInProductDetailDao.filterSpaceList(filterInvPlaceRequest); + List list2 = invPreProductDetailDao.filterSpaceList(filterInvPlaceRequest); + List list3 = invProductDetailDao.filterSpaceList(filterInvPlaceRequest); + + list.addAll(list2); + list.addAll(list3); + + return list; + + } + + @Override + public List filterSpaceList(FilterInvPlaceRequest filterInvPlaceRequest) { + InvWarehouseEntity invWarehouseEntity = invWarehouseDao.selectOne(new QueryWrapper().eq("code", filterInvPlaceRequest.getInvCode())); + if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_PREIN) { + List list = invPreInProductDetailDao.filterSpaceList(filterInvPlaceRequest); + return list; + } else if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_ADVANCE) { + List list = invPreProductDetailDao.filterSpaceList(filterInvPlaceRequest); + return list; + } else { + List list = invProductDetailDao.filterSpaceList(filterInvPlaceRequest); + return list; + } + } } diff --git a/src/main/java/com/glxp/api/service/inv/impl/InvPlaceServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/InvPlaceServiceImpl.java index c0b6c40a9..8240ff78b 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/InvPlaceServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/InvPlaceServiceImpl.java @@ -478,8 +478,6 @@ public class InvPlaceServiceImpl implements InvPlaceService { return invPreProductDetailDao.getInvPlaceOrderList(filterInvPlaceRequest); } else return invProductDetailDao.getInvPlaceOrderList(filterInvPlaceRequest); - - } @Override diff --git a/src/main/resources/mybatis/mapper/inv/InvPreInProductDetailDao.xml b/src/main/resources/mybatis/mapper/inv/InvPreInProductDetailDao.xml index e09f24a2e..d25a08d6a 100644 --- a/src/main/resources/mybatis/mapper/inv/InvPreInProductDetailDao.xml +++ b/src/main/resources/mybatis/mapper/inv/InvPreInProductDetailDao.xml @@ -233,4 +233,41 @@ and (invSpaceCode is null or invSpaceCode = '' ) + + diff --git a/src/main/resources/mybatis/mapper/inv/InvPreProductDetailDao.xml b/src/main/resources/mybatis/mapper/inv/InvPreProductDetailDao.xml index f23a222d4..164250cff 100644 --- a/src/main/resources/mybatis/mapper/inv/InvPreProductDetailDao.xml +++ b/src/main/resources/mybatis/mapper/inv/InvPreProductDetailDao.xml @@ -232,4 +232,39 @@ CODE = #{code} and (invSpaceCode is null or invSpaceCode = '' ) + + diff --git a/src/main/resources/mybatis/mapper/inv/invProductDetailDao.xml b/src/main/resources/mybatis/mapper/inv/invProductDetailDao.xml index 82731773f..f28d21480 100644 --- a/src/main/resources/mybatis/mapper/inv/invProductDetailDao.xml +++ b/src/main/resources/mybatis/mapper/inv/invProductDetailDao.xml @@ -314,4 +314,39 @@ CODE = #{code} and (invSpaceCode is null or invSpaceCode = '' ) + + From eb470c4c5505e2a1e6040ab8f8abb0b9ad57fd67 Mon Sep 17 00:00:00 2001 From: wj <1285151836@qq.com> Date: Wed, 10 May 2023 15:17:52 +0800 Subject: [PATCH 09/48] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/purchase/impl/PurApplyDetailImplService.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/glxp/api/service/purchase/impl/PurApplyDetailImplService.java b/src/main/java/com/glxp/api/service/purchase/impl/PurApplyDetailImplService.java index b5fc16e7f..d43ebe003 100644 --- a/src/main/java/com/glxp/api/service/purchase/impl/PurApplyDetailImplService.java +++ b/src/main/java/com/glxp/api/service/purchase/impl/PurApplyDetailImplService.java @@ -94,9 +94,12 @@ public class PurApplyDetailImplService implements PurApplyDetailService { if (null == purApplyDetailRequest) { return Collections.emptyList(); } - if (null == purApplyDetailRequest.getPage() && null != purApplyDetailRequest.getLimit()) { - PageHelper.offsetPage((purApplyDetailRequest.getPage() - 1) * purApplyDetailRequest.getLimit(), purApplyDetailRequest.getLimit()); + if (purApplyDetailRequest.getPage() == null) + purApplyDetailRequest.setPage(1); + if (purApplyDetailRequest.getLimit() == null) { + purApplyDetailRequest.setLimit(10); } + PageHelper.offsetPage((purApplyDetailRequest.getPage() - 1) * purApplyDetailRequest.getLimit(), purApplyDetailRequest.getLimit()); return purApplyDetailDao.selectPurApplyDetailList(purApplyDetailRequest); } From d83efd3e94fb9e3aadb8c3d07cf5b3905b5c8757 Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Wed, 10 May 2023 15:33:18 +0800 Subject: [PATCH 10/48] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=A2=86=E7=94=A8?= =?UTF-8?q?=E5=8D=95=20=E5=AE=A1=E6=A0=B8=E9=A2=86=E7=94=A8=E5=8D=95=20?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E9=A2=86=E7=94=A8=E5=8D=95=20=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E6=A0=B9=E6=8D=AE=E5=BE=80=E6=9D=A5=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/mybatis/mapper/inout/ReceiveDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/mybatis/mapper/inout/ReceiveDao.xml b/src/main/resources/mybatis/mapper/inout/ReceiveDao.xml index 8590a8ad9..b9e08313a 100644 --- a/src/main/resources/mybatis/mapper/inout/ReceiveDao.xml +++ b/src/main/resources/mybatis/mapper/inout/ReceiveDao.xml @@ -17,7 +17,7 @@ AND billType = #{billType} - AND ( SELECT NAME FROM auth_warehouse aw2 WHERE aw2.CODE = io.targetInvCode ) = #{corpName} + AND ( SELECT code FROM auth_warehouse aw2 WHERE aw2.CODE = io.targetInvCode ) = #{corpName} AND billNo like concat('%', #{billNo}, '%') From 4472ad04903945a934e7474bacb4151e12b5f063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Wed, 10 May 2023 16:08:00 +0800 Subject: [PATCH 11/48] =?UTF-8?q?=E5=BA=93=E5=AD=98=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=B4=A7=E6=9E=B6=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/inv/InvPlaceOrderDetailDao.xml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/main/resources/mybatis/mapper/inv/InvPlaceOrderDetailDao.xml b/src/main/resources/mybatis/mapper/inv/InvPlaceOrderDetailDao.xml index 248cdf3dc..456d92b15 100644 --- a/src/main/resources/mybatis/mapper/inv/InvPlaceOrderDetailDao.xml +++ b/src/main/resources/mybatis/mapper/inv/InvPlaceOrderDetailDao.xml @@ -6,23 +6,22 @@ diff --git a/src/main/resources/mybatis/mapper/purchase/PurOrderDetailDao.xml b/src/main/resources/mybatis/mapper/purchase/PurOrderDetailDao.xml index 7eb489ccf..0e4c4ece9 100644 --- a/src/main/resources/mybatis/mapper/purchase/PurOrderDetailDao.xml +++ b/src/main/resources/mybatis/mapper/purchase/PurOrderDetailDao.xml @@ -171,6 +171,7 @@ + and pur_order.status=3 \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/purchase/PurPlanDetailDao.xml b/src/main/resources/mybatis/mapper/purchase/PurPlanDetailDao.xml index 0d961efd8..d690e5fd5 100644 --- a/src/main/resources/mybatis/mapper/purchase/PurPlanDetailDao.xml +++ b/src/main/resources/mybatis/mapper/purchase/PurPlanDetailDao.xml @@ -171,6 +171,7 @@ + and pur_plan.status=3 \ No newline at end of file From 10ecccc02129c5f5d41ac36c7a2abf18a6360e17 Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Thu, 11 May 2023 11:01:09 +0800 Subject: [PATCH 16/48] =?UTF-8?q?=E5=A6=82=E6=9E=9C=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E7=94=A8=E6=88=B7=E5=85=B3=E8=81=94=20?= =?UTF-8?q?=E5=B0=B1=E4=B8=8D=E8=83=BD=E6=98=AF=E7=A6=81=E7=94=A8=E7=8A=B6?= =?UTF-8?q?=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/glxp/api/controller/auth/SysRoleController.java | 7 +++++++ src/main/java/com/glxp/api/dao/auth/SysUserRoleMapper.java | 3 +++ .../java/com/glxp/api/service/auth/ISysRoleService.java | 2 ++ .../com/glxp/api/service/auth/impl/SysRoleServiceImpl.java | 7 +++++-- .../resources/mybatis/mapper/auth/SysUserRoleMapper.xml | 7 +++++++ 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/auth/SysRoleController.java b/src/main/java/com/glxp/api/controller/auth/SysRoleController.java index a87b5a9dc..2947d72d9 100644 --- a/src/main/java/com/glxp/api/controller/auth/SysRoleController.java +++ b/src/main/java/com/glxp/api/controller/auth/SysRoleController.java @@ -84,6 +84,13 @@ public class SysRoleController extends BaseController { */ @PutMapping public BaseResponse edit(@Validated @RequestBody SysRole role) { + //把角色改成禁用的时候 如果存在关联 不能禁用 + if("1".equals(role.getStatus())){ + List sysUserRoles = roleService.selectUserRoleList(role.getRoleId()); + if( !sysUserRoles.isEmpty()){ + return ResultVOUtils.error(500, "角色已关联用户,不能禁用!"); + } + } roleService.checkRoleAllowed(role); roleService.checkRoleDataScope(role.getRoleId()); if (Constant.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) { diff --git a/src/main/java/com/glxp/api/dao/auth/SysUserRoleMapper.java b/src/main/java/com/glxp/api/dao/auth/SysUserRoleMapper.java index 2d3dd67ca..329f9d828 100644 --- a/src/main/java/com/glxp/api/dao/auth/SysUserRoleMapper.java +++ b/src/main/java/com/glxp/api/dao/auth/SysUserRoleMapper.java @@ -15,4 +15,7 @@ public interface SysUserRoleMapper { int insertBatch(@Param("sysUserRoles") List sysUserRoles); + List selectUserRoleList(Long roleId); + + } diff --git a/src/main/java/com/glxp/api/service/auth/ISysRoleService.java b/src/main/java/com/glxp/api/service/auth/ISysRoleService.java index c8ed50c19..e9dde350b 100644 --- a/src/main/java/com/glxp/api/service/auth/ISysRoleService.java +++ b/src/main/java/com/glxp/api/service/auth/ISysRoleService.java @@ -85,6 +85,8 @@ public interface ISysRoleService { */ void checkRoleAllowed(SysRole role); + List selectUserRoleList(Long roleId); + /** * 校验角色是否有数据权限 * diff --git a/src/main/java/com/glxp/api/service/auth/impl/SysRoleServiceImpl.java b/src/main/java/com/glxp/api/service/auth/impl/SysRoleServiceImpl.java index 2204e896d..067b75985 100644 --- a/src/main/java/com/glxp/api/service/auth/impl/SysRoleServiceImpl.java +++ b/src/main/java/com/glxp/api/service/auth/impl/SysRoleServiceImpl.java @@ -4,8 +4,6 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.github.pagehelper.PageHelper; -import com.glxp.api.common.res.BaseResponse; -import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.constant.Constant; import com.glxp.api.dao.auth.SysRoleMapper; import com.glxp.api.dao.auth.SysRoleMenuMapper; @@ -187,6 +185,11 @@ public class SysRoleServiceImpl implements ISysRoleService { } } + @Override + public List selectUserRoleList(Long roleId) { + return sysUserRoleMapper.selectUserRoleList(roleId); + } + /** * 校验角色是否有数据权限 * diff --git a/src/main/resources/mybatis/mapper/auth/SysUserRoleMapper.xml b/src/main/resources/mybatis/mapper/auth/SysUserRoleMapper.xml index 78fda4c44..fcc20ea2e 100644 --- a/src/main/resources/mybatis/mapper/auth/SysUserRoleMapper.xml +++ b/src/main/resources/mybatis/mapper/auth/SysUserRoleMapper.xml @@ -15,6 +15,13 @@ on u.id = sur.user_id and sur.role_id = #{roleId} + + DELETE From ffc363773e241dd18f24d1b36dd780f268da478e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Thu, 11 May 2023 11:56:48 +0800 Subject: [PATCH 17/48] =?UTF-8?q?=E5=8D=95=E6=8D=AE=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basic/BasicOrderPrintController.java | 38 ++++++++++++++----- .../req/basic/FilterOrderPrintRequest.java | 1 + .../api/res/inv/InvPreProductResponse.java | 2 + .../mapper/inv/InvPreInProductDetailDao.xml | 3 +- .../mapper/inv/InvPreProductDetailDao.xml | 3 +- .../mapper/inv/invProductDetailDao.xml | 3 +- 6 files changed, 35 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/basic/BasicOrderPrintController.java b/src/main/java/com/glxp/api/controller/basic/BasicOrderPrintController.java index 63d0097ac..3f7c559ac 100644 --- a/src/main/java/com/glxp/api/controller/basic/BasicOrderPrintController.java +++ b/src/main/java/com/glxp/api/controller/basic/BasicOrderPrintController.java @@ -13,6 +13,7 @@ import com.glxp.api.entity.inout.IoOrderEntity; import com.glxp.api.entity.purchase.SupCertEntity; import com.glxp.api.entity.purchase.SupManufacturerEntity; import com.glxp.api.entity.purchase.SupProductEntity; +import com.glxp.api.entity.system.SysPdfTemplateRelevanceCodeEntity; import com.glxp.api.entity.system.SystemPDFModuleEntity; import com.glxp.api.entity.system.SystemPDFTemplateEntity; import com.glxp.api.entity.system.SystemPDFTemplateRelevanceEntity; @@ -30,6 +31,7 @@ import com.glxp.api.service.inout.IoCodeService; import com.glxp.api.service.inout.IoOrderDetailBizService; import com.glxp.api.service.inout.IoOrderService; import com.glxp.api.service.system.SystemPDFModuleService; +import com.glxp.api.service.system.SystemPDFTemplateRelevanceCodeService; import com.glxp.api.service.system.SystemPDFTemplateRelevanceService; import com.glxp.api.service.system.SystemPDFTemplateService; import com.glxp.api.util.JasperUtils; @@ -71,6 +73,8 @@ public class BasicOrderPrintController { IoCodeService ioCodeService; @Value("${file_path}") private String filePath; + @Resource + SystemPDFTemplateRelevanceCodeService systemPDFTemplateRelevanceCodeService; //校验模板是否正确 @AuthRuleAnnotation("") @@ -78,9 +82,10 @@ public class BasicOrderPrintController { public BaseResponse inspectionStockOrderPDFFromTemplateFile(@RequestBody FilterOrderPrintRequest filterOrderPrintRequest) { - SystemPDFTemplateRelevanceEntity systemPDFTemplateRelevanceEntityt = systemPDFTemplateRelevanceService.selectModuleldAndAction(filterOrderPrintRequest.getModuleId(), filterOrderPrintRequest.getAction()); - if (systemPDFTemplateRelevanceEntityt != null) { - SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(systemPDFTemplateRelevanceEntityt.getTemplateId() + ""); + String name=getStatusName(filterOrderPrintRequest.getStatus()); + SysPdfTemplateRelevanceCodeEntity sysPdfTemplateRelevanceCodeEntity = systemPDFTemplateRelevanceCodeService.selectNameAndAction(name, filterOrderPrintRequest.getAction()); + if (sysPdfTemplateRelevanceCodeEntity != null) { + SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(sysPdfTemplateRelevanceCodeEntity.getTemplateId() + ""); if (systemPDFTemplateEntity == null) { return ResultVOUtils.error(999, "所属模板错误!"); } else { @@ -97,7 +102,8 @@ public class BasicOrderPrintController { @PostMapping("/udiwms/pdf/template/order/file") public void printSupCertProduction(@RequestBody FilterOrderPrintRequest filterOrderPrintRequest, HttpServletRequest request, HttpServletResponse response) throws Exception { SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(filterOrderPrintRequest.getTemplateId()); - SystemPDFTemplateRelevanceEntity systemPDFTemplateRelevanceEntityt = systemPDFTemplateRelevanceService.selectModuleldAndAction(filterOrderPrintRequest.getModuleId(), filterOrderPrintRequest.getAction()); + String name=getStatusName(filterOrderPrintRequest.getStatus()); + SysPdfTemplateRelevanceCodeEntity sysPdfTemplateRelevanceCodeEntity = systemPDFTemplateRelevanceCodeService.selectNameAndAction(name, filterOrderPrintRequest.getAction()); //打印单号标签 Map data = new HashMap<>(1); List list = new ArrayList<>(); @@ -125,8 +131,8 @@ public class BasicOrderPrintController { bizData.put("locInv", ioOrderResponse.getInvName() == null ? ' ' : ioOrderResponse.getInvName()); bizData.put("billNo", ioOrderResponse.getBillNo() == null ? ' ' : ioOrderResponse.getBillNo()); bizData.put("billdate", formatter.format(ioOrderResponse.getCreateTime())); - bizData.put("remark1", systemPDFTemplateRelevanceEntityt.getRemark1() == null ? ' ' : systemPDFTemplateRelevanceEntityt.getRemark1()); - bizData.put("remark2", systemPDFTemplateRelevanceEntityt.getRemark2() == null ? ' ' : systemPDFTemplateRelevanceEntityt.getRemark2()); + bizData.put("remark1", sysPdfTemplateRelevanceCodeEntity.getRemark1() == null ? ' ' : sysPdfTemplateRelevanceCodeEntity.getRemark1()); + bizData.put("remark2", sysPdfTemplateRelevanceCodeEntity.getRemark2() == null ? ' ' : sysPdfTemplateRelevanceCodeEntity.getRemark2()); bizData.put("productName", udiProductEntity.getCpms() == null ? ' ' : udiProductEntity.getCpms()); bizData.put("spmc", obj.getCoName() == null ? ' ' : obj.getCoName()); bizData.put("spec", obj.getSpec() == null ? ' ' : obj.getSpec()); @@ -174,8 +180,8 @@ public class BasicOrderPrintController { bizData.put("locInv", ioOrderResponse.getInvName() == null ? ' ' : ioOrderResponse.getInvName()); bizData.put("billNo", ioOrderResponse.getBillNo() == null ? ' ' : ioOrderResponse.getBillNo()); bizData.put("billdate", formatter.format(ioOrderResponse.getCreateTime())); - bizData.put("remark1", systemPDFTemplateRelevanceEntityt.getRemark1() == null ? ' ' : systemPDFTemplateRelevanceEntityt.getRemark1()); - bizData.put("remark2", systemPDFTemplateRelevanceEntityt.getRemark2() == null ? ' ' : systemPDFTemplateRelevanceEntityt.getRemark2()); + bizData.put("remark1", sysPdfTemplateRelevanceCodeEntity.getRemark1() == null ? ' ' : sysPdfTemplateRelevanceCodeEntity.getRemark1()); + bizData.put("remark2", sysPdfTemplateRelevanceCodeEntity.getRemark2() == null ? ' ' : sysPdfTemplateRelevanceCodeEntity.getRemark2()); bizData.put("productName", udiProductEntity.getCpms() == null ? ' ' : udiProductEntity.getCpms()); bizData.put("spmc", ioOrderDetailBizEntity.getCoName() == null ? ' ' : ioOrderDetailBizEntity.getCoName()); bizData.put("spec", ioOrderDetailBizEntity.getSpec() == null ? ' ' : ioOrderDetailBizEntity.getSpec()); @@ -198,7 +204,21 @@ public class BasicOrderPrintController { data.put("data", list); String param = JSON.toJSONString(data); - JasperUtils.jasperReport(request, response, param, filePath + "/pdf/template/"+systemPDFTemplateEntity.getPath(), "pdf"); + JasperUtils.jasperReport(request, response, param, systemPDFTemplateEntity.getPath(), "pdf"); + } + + public String getStatusName(Integer type){ + String name=""; + if(type==3){ + name="ScanCodeVerification"; + }else if(type==5){ + name="ScanCodeCheck"; + }else if(type==10){ + name="ScanCode"; + }else if(type==7){ + name="ScanCodeAlready"; + } + return name; } } diff --git a/src/main/java/com/glxp/api/req/basic/FilterOrderPrintRequest.java b/src/main/java/com/glxp/api/req/basic/FilterOrderPrintRequest.java index 52db1b795..bfa3de4db 100644 --- a/src/main/java/com/glxp/api/req/basic/FilterOrderPrintRequest.java +++ b/src/main/java/com/glxp/api/req/basic/FilterOrderPrintRequest.java @@ -14,5 +14,6 @@ public class FilterOrderPrintRequest { private Integer type; private String templateId; private String orderIdFk; + private Integer status; } diff --git a/src/main/java/com/glxp/api/res/inv/InvPreProductResponse.java b/src/main/java/com/glxp/api/res/inv/InvPreProductResponse.java index 49604be8c..f9cb91e56 100644 --- a/src/main/java/com/glxp/api/res/inv/InvPreProductResponse.java +++ b/src/main/java/com/glxp/api/res/inv/InvPreProductResponse.java @@ -105,4 +105,6 @@ public class InvPreProductResponse { */ private String invCode; + private String measname; + } diff --git a/src/main/resources/mybatis/mapper/inv/InvPreInProductDetailDao.xml b/src/main/resources/mybatis/mapper/inv/InvPreInProductDetailDao.xml index d25a08d6a..d45a0ff6e 100644 --- a/src/main/resources/mybatis/mapper/inv/InvPreInProductDetailDao.xml +++ b/src/main/resources/mybatis/mapper/inv/InvPreInProductDetailDao.xml @@ -224,8 +224,7 @@ - SELECT - SUM( inCount )- SUM( outCount ) + SELECT ifnull(SUM(inCount),0)-ifnull(SUM(outCount),0) FROM inv_pre_product_detail ipd WHERE diff --git a/src/main/resources/mybatis/mapper/inv/invProductDetailDao.xml b/src/main/resources/mybatis/mapper/inv/invProductDetailDao.xml index f28d21480..c5531fe10 100644 --- a/src/main/resources/mybatis/mapper/inv/invProductDetailDao.xml +++ b/src/main/resources/mybatis/mapper/inv/invProductDetailDao.xml @@ -306,8 +306,7 @@ - \ No newline at end of file + diff --git a/src/main/resources/mybatis/mapper/inv/InvPreInProductDetailDao.xml b/src/main/resources/mybatis/mapper/inv/InvPreInProductDetailDao.xml index d45a0ff6e..b36eb89dd 100644 --- a/src/main/resources/mybatis/mapper/inv/InvPreInProductDetailDao.xml +++ b/src/main/resources/mybatis/mapper/inv/InvPreInProductDetailDao.xml @@ -223,13 +223,10 @@ + + + + + diff --git a/src/main/resources/mybatis/mapper/inv/InvPreProductDetailDao.xml b/src/main/resources/mybatis/mapper/inv/InvPreProductDetailDao.xml index 7db21a72f..256bcf903 100644 --- a/src/main/resources/mybatis/mapper/inv/InvPreProductDetailDao.xml +++ b/src/main/resources/mybatis/mapper/inv/InvPreProductDetailDao.xml @@ -266,4 +266,44 @@ CODE, invSpaceCode + + + diff --git a/src/main/resources/mybatis/mapper/inv/invProductDetailDao.xml b/src/main/resources/mybatis/mapper/inv/invProductDetailDao.xml index c5531fe10..4eb909818 100644 --- a/src/main/resources/mybatis/mapper/inv/invProductDetailDao.xml +++ b/src/main/resources/mybatis/mapper/inv/invProductDetailDao.xml @@ -204,6 +204,46 @@ group by pd.code + + + update inv_product_detail set invSpaceCode = #{invSpaceCode} From 790c0d09baa87c7be097ba10d7d9dfdc54333cb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Thu, 11 May 2023 15:00:01 +0800 Subject: [PATCH 20/48] =?UTF-8?q?=E7=89=A9=E8=B5=84=E6=91=86=E6=94=BE?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/inv/impl/InvPlaceServiceImpl.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/glxp/api/service/inv/impl/InvPlaceServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/InvPlaceServiceImpl.java index 8240ff78b..db3efaf4a 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/InvPlaceServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/InvPlaceServiceImpl.java @@ -119,6 +119,13 @@ public class InvPlaceServiceImpl implements InvPlaceService { invPreInProductDetailDao.updateById(invPreInProductDetailEntity); + //如果库存为空就删了该数据 + if (invPreInProductDetailEntity != null && invPreInProductDetailEntity.getInCount() == 0 && invPreInProductDetailEntity.getOutCount() == 0 + && invPreInProductDetailEntity.getCount() == 0 && invPreInProductDetailEntity.getReCount() == 0) { + invPreInProductDetailDao.deleteById(invPreInProductDetailEntity); + } + + ew.clear(); ew.eq("code", invPlaceOrderDetailEntity.getCode()); if (bindInvSpaceRequest.getType() == 3) { @@ -127,7 +134,7 @@ public class InvPlaceServiceImpl implements InvPlaceService { ew.eq("invSpaceCode", invPlaceOrderDetailEntity.getInvSpaceCode()); } - + //拆解出来的明细有就更新没有就添加 InvPreInProductDetailEntity invPreInProductDetailEntity1 = invPreInProductDetailDao.selectOne(ew); if (invPreInProductDetailEntity1 != null) { invPreInProductDetailEntity1.setCount(invPreInProductDetailEntity1.getCount() + 1); @@ -182,6 +189,11 @@ public class InvPlaceServiceImpl implements InvPlaceService { invPreInProductDetailEntity.setReCount(invPreInProductDetailEntity.getReCount() - reCount); invPreProductDetailDao.updateById(invPreInProductDetailEntity); + //如果库存为空就删了该数据 + if (invPreInProductDetailEntity != null && invPreInProductDetailEntity.getInCount() == 0 && invPreInProductDetailEntity.getOutCount() == 0 + && invPreInProductDetailEntity.getCount() == 0 && invPreInProductDetailEntity.getReCount() == 0) { + invPreProductDetailDao.deleteById(invPreInProductDetailEntity); + } ew.clear(); ew.eq("code", invPlaceOrderDetailEntity.getCode()); @@ -242,6 +254,11 @@ public class InvPlaceServiceImpl implements InvPlaceService { invPreInProductDetailEntity.setReCount(invPreInProductDetailEntity.getReCount() - reCount); invProductDetailDao.updateById(invPreInProductDetailEntity); + //如果库存为空就删了该数据 + if (invPreInProductDetailEntity != null && invPreInProductDetailEntity.getInCount() == 0 && invPreInProductDetailEntity.getOutCount() == 0 + && invPreInProductDetailEntity.getCount() == 0 && invPreInProductDetailEntity.getReCount() == 0) { + invProductDetailDao.deleteById(invPreInProductDetailEntity); + } ew.clear(); ew.eq("code", invPlaceOrderDetailEntity.getCode()); From 38f2e7b1a62237e9d65e30e86ec1b609dbc648e2 Mon Sep 17 00:00:00 2001 From: anthonywj Date: Thu, 11 May 2023 15:06:31 +0800 Subject: [PATCH 21/48] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/glxp/api/constant/FileConstant.java | 13 +++++++++++++ .../api/controller/purchase/SupCertController.java | 9 +++++---- .../glxp/api/idc/service/impl/FileServiceImpl.java | 3 ++- .../glxp/api/idc/service/impl/IdcServiceImpl.java | 3 ++- .../com/glxp/api/upload/DownloadController.java | 3 ++- 5 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 src/main/java/com/glxp/api/constant/FileConstant.java diff --git a/src/main/java/com/glxp/api/constant/FileConstant.java b/src/main/java/com/glxp/api/constant/FileConstant.java new file mode 100644 index 000000000..5f48d88e5 --- /dev/null +++ b/src/main/java/com/glxp/api/constant/FileConstant.java @@ -0,0 +1,13 @@ +package com.glxp.api.constant; + +public class FileConstant { + + public static String CERT_FILE_PATH = ""; + + public static String INVOICE_FILE_PATH = ""; + + public static String PDF_FILE_PATH = ""; + + public static String COMMON_FILE_PATH = "register/image2/"; + +} diff --git a/src/main/java/com/glxp/api/controller/purchase/SupCertController.java b/src/main/java/com/glxp/api/controller/purchase/SupCertController.java index cc8714068..267f8b58f 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupCertController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupCertController.java @@ -12,6 +12,7 @@ import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.constant.BusinessType; import com.glxp.api.constant.ConstantStatus; +import com.glxp.api.constant.FileConstant; import com.glxp.api.entity.auth.AuthAdmin; import com.glxp.api.entity.purchase.*; import com.glxp.api.entity.system.SysPdfTemplateRelevanceStatemenEntity; @@ -306,7 +307,7 @@ public class SupCertController { @PostMapping("/sup/info/deleteCompanyCert") public BaseResponse deleteCompanyCert(@RequestBody DeleteCompanyFileRequest deleteCompanyFileRequest, BindingResult bindingResult) { boolean b = supCertService.deleteById(deleteCompanyFileRequest.getId()); - String URL = filePath + "/register/file/image2/" + deleteCompanyFileRequest.getFilePath(); + String URL = filePath + FileConstant.COMMON_FILE_PATH + deleteCompanyFileRequest.getFilePath(); File file = new File(URL); if (file.exists() && file.isFile()) { file.delete(); @@ -396,7 +397,7 @@ public class SupCertController { supData.put("status", obj.getStatus() == 0 ? "有效" : "失效"); supData.put("auditStatus", getAuditStatus(obj.getAuditStatus())); supData.put("remark", obj.getRemark() == null ? ' ' : obj.getRemark()); - supData.put("filePath", filePath + "register/image2/" + url); + supData.put("filePath", filePath + FileConstant.COMMON_FILE_PATH + url); list.add(supData); i++; } @@ -512,7 +513,7 @@ public class SupCertController { supData.put("status", obj.getStatus() == 0 ? "有效" : "失效"); supData.put("auditStatus", getAuditStatus(obj.getAuditStatus())); supData.put("remark2", obj.getRemark() == null ? ' ' : obj.getRemark()); - supData.put("filePath", filePath + "register/image2/" + url); + supData.put("filePath", filePath + FileConstant.COMMON_FILE_PATH + url); list.add(supData); i++; } @@ -578,7 +579,7 @@ public class SupCertController { supData.put("status", obj.getStatus() == 0 ? "有效" : "失效"); supData.put("auditStatus", getAuditStatus(obj.getAuditStatus())); supData.put("remark2", obj.getRemark() == null ? ' ' : obj.getRemark()); - supData.put("filePath", filePath + "register/image2/" + url); + supData.put("filePath", filePath + FileConstant.COMMON_FILE_PATH + url); list.add(supData); i++; } diff --git a/src/main/java/com/glxp/api/idc/service/impl/FileServiceImpl.java b/src/main/java/com/glxp/api/idc/service/impl/FileServiceImpl.java index 6fdfcef27..38affea5b 100644 --- a/src/main/java/com/glxp/api/idc/service/impl/FileServiceImpl.java +++ b/src/main/java/com/glxp/api/idc/service/impl/FileServiceImpl.java @@ -12,6 +12,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; +import com.glxp.api.constant.FileConstant; import org.apache.commons.lang3.StringUtils; import org.apache.tools.ant.util.DateUtils; import org.slf4j.Logger; @@ -53,7 +54,7 @@ public class FileServiceImpl implements FileService { private DbDao dbDao; @Resource private IdcService idcService; - private String imagePath = "register/image2/"; + private String imagePath = FileConstant.COMMON_FILE_PATH; String pdfPath = "pdf/template/"; @Override diff --git a/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java b/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java index 4ba7f3005..db102c6c6 100644 --- a/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java +++ b/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java @@ -17,6 +17,7 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import com.glxp.api.constant.FileConstant; import org.apache.commons.lang3.StringUtils; import org.apache.commons.text.WordUtils; import org.apache.tools.ant.util.DateUtils; @@ -85,7 +86,7 @@ public class IdcServiceImpl implements IdcService { @Resource private ScheduledDao scheduledDao; - private String imagePath = "register/image2/"; + private String imagePath = FileConstant.COMMON_FILE_PATH; /*获取拉取任务列表*/ @Override public BaseResponse taskList(HttpServletRequest request, Map params) { diff --git a/src/main/java/com/glxp/api/upload/DownloadController.java b/src/main/java/com/glxp/api/upload/DownloadController.java index 7339130cf..b6dddd183 100644 --- a/src/main/java/com/glxp/api/upload/DownloadController.java +++ b/src/main/java/com/glxp/api/upload/DownloadController.java @@ -1,5 +1,6 @@ package com.glxp.api.upload; +import com.glxp.api.constant.FileConstant; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -27,7 +28,7 @@ public class DownloadController { if (name.endsWith("pdf") || name.endsWith("doc")) { OutputStream os = null; try { - FileInputStream input = new FileInputStream(new File(filePath + "/register/file/" + type + "/" + name)); + FileInputStream input = new FileInputStream(new File(filePath + FileConstant.COMMON_FILE_PATH + name)); OutputStream out = response.getOutputStream(); byte[] b = new byte[2048]; int len; From a7f3caefe9c7618786d320b9228e767033925fb1 Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Thu, 11 May 2023 15:30:23 +0800 Subject: [PATCH 22/48] =?UTF-8?q?=E8=B5=84=E8=B4=A8=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../glxp/api/controller/purchase/SupCertController.java | 6 +++--- .../com/glxp/api/dao/system/SystemPDFTemplateDao.java | 1 - .../mybatis/mapper/system/SystemPDFTemplateDao.xml | 8 +------- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/purchase/SupCertController.java b/src/main/java/com/glxp/api/controller/purchase/SupCertController.java index 267f8b58f..33089e249 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupCertController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupCertController.java @@ -406,7 +406,7 @@ public class SupCertController { } String param = JSON.toJSONString(list); - JasperUtils.jasperReport(request, response, param, filePath + "/pdf/template/" + systemPDFTemplateEntity.getPath(), "pdf"); + JasperUtils.jasperReport(request, response, param, filePath+"pdf/template/"+systemPDFTemplateEntity.getPath(), "pdf"); } /** @@ -521,7 +521,7 @@ public class SupCertController { } String param = JSON.toJSONString(list); - JasperUtils.jasperReport(request, response, param, filePath + "/pdf/template/" + systemPDFTemplateEntity.getPath(), "pdf"); + JasperUtils.jasperReport(request, response, param, systemPDFTemplateEntity.getPath(), "pdf"); } /** @@ -587,7 +587,7 @@ public class SupCertController { } String param = JSON.toJSONString(list); - JasperUtils.jasperReport(request, response, param, filePath + "/pdf/template/" + systemPDFTemplateEntity.getPath(), "pdf"); + JasperUtils.jasperReport(request, response, param, systemPDFTemplateEntity.getPath(), "pdf"); } //首营预览文件 diff --git a/src/main/java/com/glxp/api/dao/system/SystemPDFTemplateDao.java b/src/main/java/com/glxp/api/dao/system/SystemPDFTemplateDao.java index bc84ed813..33e4e79f7 100644 --- a/src/main/java/com/glxp/api/dao/system/SystemPDFTemplateDao.java +++ b/src/main/java/com/glxp/api/dao/system/SystemPDFTemplateDao.java @@ -19,7 +19,6 @@ public interface SystemPDFTemplateDao extends BaseMapperPlus - UPDATE sys_pdf_template @@ -82,4 +76,4 @@ - \ No newline at end of file + From 8ec5a59d8524053b9ca22338e758c0e088afbd67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Thu, 11 May 2023 15:38:12 +0800 Subject: [PATCH 23/48] =?UTF-8?q?=E8=B5=84=E8=B4=A8=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/glxp/api/controller/purchase/SupCertController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/purchase/SupCertController.java b/src/main/java/com/glxp/api/controller/purchase/SupCertController.java index 33089e249..8d9b21af1 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupCertController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupCertController.java @@ -521,7 +521,7 @@ public class SupCertController { } String param = JSON.toJSONString(list); - JasperUtils.jasperReport(request, response, param, systemPDFTemplateEntity.getPath(), "pdf"); + JasperUtils.jasperReport(request, response, param, filePath+"pdf/template/"+systemPDFTemplateEntity.getPath(), "pdf"); } /** @@ -587,7 +587,7 @@ public class SupCertController { } String param = JSON.toJSONString(list); - JasperUtils.jasperReport(request, response, param, systemPDFTemplateEntity.getPath(), "pdf"); + JasperUtils.jasperReport(request, response, param, filePath+"pdf/template/"+systemPDFTemplateEntity.getPath(), "pdf"); } //首营预览文件 From 8837b12fd43ab9f3ab1df08b5350702c94642217 Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Thu, 11 May 2023 15:52:35 +0800 Subject: [PATCH 24/48] =?UTF-8?q?=E5=86=85=E9=83=A8=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/inv/InvInnerOrderPrintController.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/inv/InvInnerOrderPrintController.java b/src/main/java/com/glxp/api/controller/inv/InvInnerOrderPrintController.java index c7e8e823f..208fd2a5f 100644 --- a/src/main/java/com/glxp/api/controller/inv/InvInnerOrderPrintController.java +++ b/src/main/java/com/glxp/api/controller/inv/InvInnerOrderPrintController.java @@ -9,10 +9,9 @@ import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.constant.BusinessType; import com.glxp.api.entity.inout.IoOrderEntity; import com.glxp.api.entity.inv.InnerOrderEntity; -import com.glxp.api.entity.inv.InvInnerOrderPrintEntity; import com.glxp.api.entity.inv.InvInnerOrderPdfTempEntity; +import com.glxp.api.entity.inv.InvInnerOrderPrintEntity; import com.glxp.api.entity.system.SysPdfTemplateRelevanceLabelEntity; -import com.glxp.api.entity.system.SystemPDFModuleEntity; import com.glxp.api.entity.system.SystemPDFTemplateEntity; import com.glxp.api.req.inout.InspectionPDFTemplateRequest; import com.glxp.api.req.inv.*; @@ -40,7 +39,10 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.File; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; @RestController public class InvInnerOrderPrintController { @@ -184,7 +186,7 @@ public class InvInnerOrderPrintController { } else { Map data = new HashMap(); data.put("data", printEntities); - JasperUtils.jasperReport(request, response, data, filePath + "/pdf/template/"+systemPDFTemplateEntity.getPath(), "pdf"); + JasperUtils.jasperReport(request, response, data, systemPDFTemplateEntity.getPath(), "pdf"); } From be5f16b38d6881433c9284b6db50083162a83e9a Mon Sep 17 00:00:00 2001 From: anthonywj Date: Thu, 11 May 2023 16:00:24 +0800 Subject: [PATCH 25/48] =?UTF-8?q?=E5=BA=93=E5=AD=98=E8=B4=A7=E4=BD=8D?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/idc/service/impl/IdcServiceImpl.java | 142 +++++++++--------- .../glxp/api/service/sync/HeartService.java | 7 +- .../mapper/inv/InvPreInProductDetailDao.xml | 65 ++++---- .../mapper/inv/InvPreProductDetailDao.xml | 106 ++++++------- .../mapper/inv/invProductDetailDao.xml | 70 ++++----- 5 files changed, 187 insertions(+), 203 deletions(-) diff --git a/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java b/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java index db102c6c6..46a948ca5 100644 --- a/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java +++ b/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java @@ -87,6 +87,7 @@ public class IdcServiceImpl implements IdcService { private ScheduledDao scheduledDao; private String imagePath = FileConstant.COMMON_FILE_PATH; + /*获取拉取任务列表*/ @Override public BaseResponse taskList(HttpServletRequest request, Map params) { @@ -206,11 +207,11 @@ public class IdcServiceImpl implements IdcService { private void fetchFailFile(String host) { - Map map = new HashMap(); + Map map = new HashMap(); map.put("sql", "select * from idc_file where createTime> list = dbDao.list(map); - for(int i=0;i> list = dbDao.list(map); + for (int i = 0; i < list.size(); i++) { + signleDownloadFile(host, list.get(i).get("filePath").toString()); } } @@ -230,7 +231,7 @@ public class IdcServiceImpl implements IdcService { String[] syncTables = TableUtils.syncTables(); for (int i = 0; i < syncTables.length; i++) { String[] tnames = syncTables[i].split("/"); - boolean sync = (StringUtils.isEmpty(tnames[0])&&StringUtils.isEmpty(tnames[1])) || + boolean sync = (StringUtils.isEmpty(tnames[0]) && StringUtils.isEmpty(tnames[1])) || (!StringUtils.isEmpty(tnames[0]) && map != null && map.get(tnames[0]) != null && map.get(tnames[0]).toString().equals("1")); saveIdcLog("---", "", map.get(tnames[0]) + syncTables[i], 0, 0); if (sync) { @@ -245,21 +246,20 @@ public class IdcServiceImpl implements IdcService { /*上传失败重新上传*/ private void asyncFailTask(String host) { - try - { + try { String filePathSlash = filePath.substring(filePath.length() - 1).equals("/") ? "" : "/"; String sql = "select * from basic_export_status where status='1' and receiveStatus='0' where updateTime map = new HashMap(); + Map map = new HashMap(); map.put("sql", sql); - List> list = dbDao.list(map); + List> list = dbDao.list(map); ArrayList files = new ArrayList<>(); - for(int i=0;i dataList = JSONObject.parseArray(JSON.toJSONString(object.get("data")), Map.class); for (int m = 0; m < dataList.size(); m++) { - if(object.get("filePathColumn")!=null&&!StringUtils.isEmpty(object.get("filePathColumn").toString())&& - dataList.get(m).get(object.get("filePathColumn").toString()) !=null ) { + if (object.get("filePathColumn") != null && !StringUtils.isEmpty(object.get("filePathColumn").toString()) && + dataList.get(m).get(object.get("filePathColumn").toString()) != null) { String fileNames = dataList.get(m).get(object.get("filePathColumn").toString()).toString(); String[] str = fileNames.split(","); for (int r = 0; r < str.length; r++) { @@ -267,14 +267,14 @@ public class IdcServiceImpl implements IdcService { files.add(filePath + filePathSlash + imagePath + str[r]); } } - for(int k=0;k<30;k++) { - if(dataList.get(k).get("tableName"+k) == null) + for (int k = 0; k < 30; k++) { + if (dataList.get(k).get("tableName" + k) == null) break; - if(dataList.get(k).get("data"+k)!=null && dataList.get(k).get("filePathColumn"+k)!=null) { - List childList = JSONObject.parseArray(JSON.toJSONString(dataList.get(i).get("data"+k)), Map.class); - for(int x =0 ;x childList = JSONObject.parseArray(JSON.toJSONString(dataList.get(i).get("data" + k)), Map.class); + for (int x = 0; x < childList.size(); x++) { + if (childList.get(x).get(dataList.get(k).get("filePathColumn" + k).toString()) != null) { + String[] str = childList.get(x).get(dataList.get(k).get("filePathColumn" + k).toString()).toString().split(","); for (int s = 0; s < str.length; s++) { if (!StringUtils.isEmpty(str[s]) && FileUtils.isFileExist(filePath + filePathSlash + imagePath + str[s])) files.add(filePath + filePathSlash + imagePath + str[s]); @@ -293,7 +293,7 @@ public class IdcServiceImpl implements IdcService { if (IDCUtils.isJson(result)) { JSONObject res = JSON.parseObject(result); if (res.getInteger("code") == 20000) { - executeSql("update basic_export_status set receiveStatus='1',endTime=now() where id='"+list.get(i).get("id")+"'"); + executeSql("update basic_export_status set receiveStatus='1',endTime=now() where id='" + list.get(i).get("id") + "'"); saveIdcLog(object.getString("messageType"), list.get(i).get("id").toString(), object.getString("tableName") + ">reUpload->success", 0, 0); } else { saveIdcLog(object.getString("messageType"), list.get(i).get("id").toString(), object.getString("tableName") + ">reUpload->fail", 0, 0); @@ -308,42 +308,42 @@ public class IdcServiceImpl implements IdcService { } /*数据删除同步*/ - private void asyncDelete(String tname,boolean isUpload,String syncIp) { + private void asyncDelete(String tname, boolean isUpload, String syncIp) { String[] tnames = tname.split("/"); - String lastUpdateTime = getUpdateTime(tnames[2] + "." + tnames[0]+"."+tnames[1]+".delete"); + String lastUpdateTime = getUpdateTime(tnames[2] + "." + tnames[0] + "." + tnames[1] + ".delete"); Date nowUpdateTime = new Date(); - String where = "tableName='"+tnames[2].toLowerCase()+"' and updateTime between cast('"+lastUpdateTime+"' as datetime) "+ - " and cast('"+DateUtil.formatDate(nowUpdateTime, "yyyy-MM-dd HH:mm:ss")+"' as datetime)"; - Map count = new HashMap(); - count.put("sql", "select count(*) from idc_delete where "+where); + String where = "tableName='" + tnames[2].toLowerCase() + "' and updateTime between cast('" + lastUpdateTime + "' as datetime) " + + " and cast('" + DateUtil.formatDate(nowUpdateTime, "yyyy-MM-dd HH:mm:ss") + "' as datetime)"; + Map count = new HashMap(); + count.put("sql", "select count(*) from idc_delete where " + where); int total = dbDao.count(count); int limit = 50; if (total > 0) { boolean success = true; for (int i = 0; i < Math.ceil(total / limit) + 1; i++) { Date startTime = new Date(); - Map map = new HashMap(); + Map map = new HashMap(); map.put("sql", "select * from idc_delete"); map.put("sqlWhere", where); map.put("limit", limit); map.put("page", i * limit); - List> list = dbDao.list(map); - if(list!=null&&map.size()>0) { - List> data = new ArrayList<>(); - for(int k=0;i> list = dbDao.list(map); + if (list != null && map.size() > 0) { + List> data = new ArrayList<>(); + for (int k = 0; i < list.size(); k++) { String line = list.get(k).get("uniqueValue").toString(); JSONObject obj = JSON.parseObject(line); String uniqueColumn = ""; - for(String key : obj.keySet()){ - uniqueColumn += uniqueColumn.length()>0 ? ","+key : key; + for (String key : obj.keySet()) { + uniqueColumn += uniqueColumn.length() > 0 ? "," + key : key; } obj.put("uniqueColumn", uniqueColumn); obj.put("operateMode", "D"); data.add(obj); } - Map msg = new HashMap(); + Map msg = new HashMap(); msg.put("messageId", CustomUtil.getId()); - msg.put("messageType", tnames[9]+"(删除)"); + msg.put("messageType", tnames[9] + "(删除)"); msg.put("apiCode", "common"); msg.put("tableName", DBAUtils.tableAliasName(tnames[2])); msg.put("sendTime", new Date()); @@ -374,7 +374,7 @@ public class IdcServiceImpl implements IdcService { } else { saveIdcLog(tnames[9], "", tnames[2] + ">success(delete)", i * limit, total); } - syncAddTaskStatus(msg, isUpload ? 1 : 0, true, startTime, isUpload,success); + syncAddTaskStatus(msg, isUpload ? 1 : 0, true, startTime, isUpload, success); } } } @@ -409,7 +409,7 @@ public class IdcServiceImpl implements IdcService { try { String[] tnames = t.split("/"); - String lastUpdateTime = getUpdateTime(tnames[2] + "." + tnames[0]+"."+tnames[1]); + String lastUpdateTime = getUpdateTime(tnames[2] + "." + tnames[0] + "." + tnames[1]); Date nowUpdateTime = new Date(); // if (!StringUtils.isEmpty(tnames[0])) { @@ -425,7 +425,7 @@ public class IdcServiceImpl implements IdcService { if (!StringUtils.isEmpty(updateTimeColumn)) { - sqlWhere += " " + updateTimeColumn + " between cast('" + lastUpdateTime + "' as datetime) and cast('"+DateUtil.formatDate(nowUpdateTime, "yyyy-MM-dd HH:mm:ss")+"' as datetime)"; + sqlWhere += " " + updateTimeColumn + " between cast('" + lastUpdateTime + "' as datetime) and cast('" + DateUtil.formatDate(nowUpdateTime, "yyyy-MM-dd HH:mm:ss") + "' as datetime)"; //sqlWhere += " and not exists (select fkId from idc_record where type='" + tnames[2] + "' and fkId=" + tnames[2] + "." + keyColumn + " and createTime>date_sub(now(),interval 15 MINUTE))"; } else { sqlWhere = "not exists (select fkId from idc_record where type='" + tnames[2] + "' and fkId=" + tnames[2] + "." + keyColumn + ")"; @@ -455,7 +455,7 @@ public class IdcServiceImpl implements IdcService { if (sync) { result = syncMasterData(map, isUpload, syncIp); if (result) { - setUpdateTime(tnames[2] + "." + tnames[0]+"."+tnames[1], DateUtil.formatDate(nowUpdateTime, "yyyy-MM-dd HH:mm:ss")); + setUpdateTime(tnames[2] + "." + tnames[0] + "." + tnames[1], DateUtil.formatDate(nowUpdateTime, "yyyy-MM-dd HH:mm:ss")); } } //} @@ -493,11 +493,11 @@ public class IdcServiceImpl implements IdcService { } else { success = false; } - syncAddTaskStatus(json.getJSONObject("data"), 3, true, startTime, true,success); + syncAddTaskStatus(json.getJSONObject("data"), 3, true, startTime, true, success); } else { if (json.get("code") != null && json.get("data") != null) { //logger.info("res1-->"+JSON.toJSONString(json)); - syncAddTaskStatus(json.getJSONObject("data"), 0, true, startTime, true,success); + syncAddTaskStatus(json.getJSONObject("data"), 0, true, startTime, true, success); analyMiddle(host, json.getJSONObject("data"), files, false, false); } } @@ -553,7 +553,7 @@ public class IdcServiceImpl implements IdcService { IDCUtils.createDirectory(filePath + filePathSlash + datePath + "/"); if (!FileUtils.makeDirectory(backFilePath + backFileSlash + datePath)) IDCUtils.createDirectory(filePath + backFileSlash + datePath + "/"); - if(!FileUtils.makeDirectory(filePath + filePathSlash + imagePath)) + if (!FileUtils.makeDirectory(filePath + filePathSlash + imagePath)) IDCUtils.createDirectory(filePath + filePathSlash + imagePath); FileUtils.SaveFileAs(content, fileName); FileUtils.SaveFileAs(content, backFileName); @@ -585,7 +585,7 @@ public class IdcServiceImpl implements IdcService { boolean success = false; if (isLastLevel()) { success = analyMiddle("", json, files, true, true); - syncAddTaskStatus(json, 3, true, startTime, true,success); + syncAddTaskStatus(json, 3, true, startTime, true, success); if (!success) { return ResultVOUtils.error(9000, "解析失败"); @@ -596,11 +596,11 @@ public class IdcServiceImpl implements IdcService { String host = getNextHost(); String result = relay(request.getHeader("reqNo"), content, saveFiles, host); if (IDCUtils.isJson(result)) { - syncAddTaskStatus(json, 2, true, startTime, true,true); + syncAddTaskStatus(json, 2, true, startTime, true, true); BaseResponse object = JSON.parseObject(result, BaseResponse.class); return object; } else { - syncAddTaskStatus(json, 2, true, startTime, false,false); + syncAddTaskStatus(json, 2, true, startTime, false, false); return ResultVOUtils.error(9000, "转发失败"); } @@ -630,7 +630,7 @@ public class IdcServiceImpl implements IdcService { public void downloadFile(String fileName, HttpServletResponse response) { OutputStream os; String filePathSlash = filePath.substring(filePath.length() - 1).equals("/") ? "" : fileName.substring(0, 1).equals("/") ? "" : "/"; - String sourceFileName = filePath +filePathSlash+imagePath +fileName; + String sourceFileName = filePath + filePathSlash + imagePath + fileName; try { if (FileUtils.isFileExist(sourceFileName)) { byte[] bytes = FileUtils.readFileByBytes(sourceFileName); @@ -639,7 +639,7 @@ public class IdcServiceImpl implements IdcService { os.flush(); os.close(); } else { - logger.error("file not exists:"+sourceFileName); + logger.error("file not exists:" + sourceFileName); } } catch (IOException e) { // TODO Auto-generated catch block @@ -718,7 +718,7 @@ public class IdcServiceImpl implements IdcService { Map whereParams = new HashMap(); whereParams.put("sqlWhere", params.get("sqlWhere")); - String dataWhere = params.get("dataWhere")!=null ? params.get("dataWhere").toString() : ""; + String dataWhere = params.get("dataWhere") != null ? params.get("dataWhere").toString() : ""; Map map = new HashMap(); String where = DBAUtils.convertWhere(column, whereParams, dataWhere); sql += !StringUtils.isEmpty(where) ? " where " + where : ""; @@ -827,7 +827,7 @@ public class IdcServiceImpl implements IdcService { } saveIdcLog(messageType, "", tableName + ">success", i * limit, total); } - syncAddTaskStatus(data, isUpload ? 1 : 0, true, startTime, isUpload,success); + syncAddTaskStatus(data, isUpload ? 1 : 0, true, startTime, isUpload, success); } } } @@ -839,7 +839,7 @@ public class IdcServiceImpl implements IdcService { /*增加同步任务状态*/ private void syncAddTaskStatus(Map json, int scheduleType, boolean success, Date startTime, - boolean isEnd,boolean isReceive) { + boolean isEnd, boolean isReceive) { try { String content = JSON.toJSONString(json); String datePath = DateUtil.formatDate(new Date(), "yyyy-MM-dd"); @@ -866,7 +866,7 @@ public class IdcServiceImpl implements IdcService { map.put("status", success ? "1" : "0"); map.put("receiveStatus", isReceive ? "1" : "0"); map.put("startTime", startTime != null ? startTime : new Date()); - if(isReceive) + if (isReceive) map.put("endTime", new Date()); map.put("updateTime", new Date()); map.put("remark", json.get("messageType") + ": " + json.get("total") + "条"); @@ -928,7 +928,7 @@ public class IdcServiceImpl implements IdcService { for (int i = 0; i < list.size(); i++) { if (!StringUtils.isEmpty(filePathColumn)) { files[i] = list.get(i).get(filePathColumn) != null ? list.get(i).get(filePathColumn).toString() : ""; - logger.info("file-->"+files[i]); + logger.info("file-->" + files[i]); } for (int z = 0; z < 30; z++) { if (list.get(i).get("data" + z) != null) { @@ -960,7 +960,7 @@ public class IdcServiceImpl implements IdcService { String[] keyColumn = new String[30]; String[] keyDataType = new String[30]; List> columnList = dbDao.listColumnsMysql(tName); - Map column = getColumn(tName); + Map column = getColumn(tName); boolean result = false; int key = 0; int col = 0; @@ -968,7 +968,7 @@ public class IdcServiceImpl implements IdcService { if (col > 0) sql += ","; columnList.get(i).put("attrName", columnList.get(i).get("columnName")); - sql += "`"+columnList.get(i).get("columnName").toString()+"`"; + sql += "`" + columnList.get(i).get("columnName").toString() + "`"; col++; if (uniqueColumn != null && columnList.get(i).get("columnKey") != null && ("," + uniqueColumn + ",").contains("," + columnList.get(i).get("columnName") + ",")) { keyColumn[key] = columnList.get(i).get("columnName").toString(); @@ -998,13 +998,13 @@ public class IdcServiceImpl implements IdcService { } if ("A,D,U".contains(operateMode)) { - if(operateMode.equals("D")&&list.get(i).get("uniqueColumn")!=null) { + if (operateMode.equals("D") && list.get(i).get("uniqueColumn") != null) { String[] ucs = list.get(i).get("uniqueColumn").toString().split(","); - for(String str:ucs) { - Map map = (Map) column.get(str); + for (String str : ucs) { + Map map = (Map) column.get(str); String dataType = map.get("dataType").toString(); updateWhere += !StringUtils.isEmpty(updateWhere) ? " and " : " "; - updateWhere += str +" = "+(dataType.equals("C") ? "'" : "") + list.get(i).get(str) + (dataType.equals("C") ? "'" : ""); + updateWhere += str + " = " + (dataType.equals("C") ? "'" : "") + list.get(i).get(str) + (dataType.equals("C") ? "'" : ""); } } else { for (int z = 0; z < keyColumn.length; z++) { @@ -1166,7 +1166,7 @@ public class IdcServiceImpl implements IdcService { @Override public boolean signleDownloadFile(String syncIp, String fileName) { String filePathSlash = filePath.substring(filePath.length() - 1).equals("/") ? "" : "/"; - if(!FileUtils.makeDirectory(filePath + filePathSlash + imagePath)) + if (!FileUtils.makeDirectory(filePath + filePathSlash + imagePath)) IDCUtils.createDirectory(filePath + filePathSlash + imagePath); OkHttpClient client = new OkHttpClient().newBuilder() .build(); @@ -1183,13 +1183,13 @@ public class IdcServiceImpl implements IdcService { int total = 0; try { Response result = client.newCall(request).execute(); - String msg = result!=null ? result.message().length()>200 ? result.message().substring(0,200) : result.message() : ""; + String msg = result != null ? result.message().length() > 200 ? result.message().substring(0, 200) : result.message() : ""; - if (result!=null&&result.isSuccessful()&&MediaType.parse("application/force-download").equals(result.body().contentType())) { + if (result != null && result.isSuccessful() && MediaType.parse("application/force-download").equals(result.body().contentType())) { try (InputStream inputStream = result.body().byteStream()) { - FileOutputStream outputStream = new FileOutputStream(filePath + filePathSlash + imagePath+fileName); + FileOutputStream outputStream = new FileOutputStream(filePath + filePathSlash + imagePath + fileName); byte b[] = new byte[1024]; @@ -1202,18 +1202,17 @@ public class IdcServiceImpl implements IdcService { outputStream.flush(); outputStream.close(); - if(!(total>0)) { - new File(filePath + filePathSlash + imagePath+fileName).delete(); - executeSql("delete from idc_file where filePath='"+fileName+"'"); + if (!(total > 0)) { + new File(filePath + filePathSlash + imagePath + fileName).delete(); + executeSql("delete from idc_file where filePath='" + fileName + "'"); } } catch (Exception e) { - - + e.printStackTrace(); } } - if(!(total>0)) { - String sql = "replace idc_file (filePath,createTime,msg) values ('"+fileName+"',now(),'"+msg+"')"; + if (!(total > 0)) { + String sql = "replace idc_file (filePath,createTime,msg) values ('" + fileName + "',now(),'" + msg + "')"; executeSql(sql); } @@ -1221,7 +1220,7 @@ public class IdcServiceImpl implements IdcService { // TODO Auto-generated catch block e.printStackTrace(); } - return (total>0); + return (total > 0); } // @Override // public boolean signleDownloadFile(String syncIp, String fileName) { @@ -1357,8 +1356,6 @@ public class IdcServiceImpl implements IdcService { } - - /*把列数据转Map*/ private Map getColumn(String tableName) { Map map = new HashMap(); @@ -1465,6 +1462,7 @@ public class IdcServiceImpl implements IdcService { } } + private void writeFile(byte[] file, String filePath, String fileName) throws Exception { File targetFile = new File(filePath); if (!targetFile.exists()) { diff --git a/src/main/java/com/glxp/api/service/sync/HeartService.java b/src/main/java/com/glxp/api/service/sync/HeartService.java index 19323a654..9164be85d 100644 --- a/src/main/java/com/glxp/api/service/sync/HeartService.java +++ b/src/main/java/com/glxp/api/service/sync/HeartService.java @@ -104,6 +104,8 @@ public class HeartService { @Resource IoOrderInvoiceService orderInvoiceService; + @Resource + IoOrderInvoiceMapper ioOrderInvoiceMapper; private final ApplicationContext applicationContext; //上传最近更新扫码单据 @@ -1396,6 +1398,7 @@ public class HeartService { String fileFullPath = writeFile(filePrefix, NEW_ALL_ORDER, response.getData()); basicDownloadStatusEntity.setCacheFilePath(fileFullPath); } catch (IOException e) { + e.printStackTrace(); throw new RuntimeException(e); } @@ -1625,8 +1628,6 @@ public class HeartService { private final IoCodeLostMapper ioCodeLostMapper; private final IoCodeRelMapper ioCodeRelMapper; - @Resource - private final IoOrderInvoiceMapper ioOrderInvoiceMapper; /** * 设置嵌套事物 @@ -1902,7 +1903,7 @@ public class HeartService { List orderInvoiceEntities = syncDataResponse.getOrderInvoiceEntities(); for (IoOrderInvoiceEntity orderInvoiceEntity : orderInvoiceEntities) { if (orderInvoiceEntity.getOrderIdFk().equals(orderEntity.getBillNo())) { - orderInvoiceService.insertInvoice(orderInvoiceEntity); + ioOrderInvoiceMapper.insertOrUpdate(orderInvoiceEntity); } } } diff --git a/src/main/resources/mybatis/mapper/inv/InvPreInProductDetailDao.xml b/src/main/resources/mybatis/mapper/inv/InvPreInProductDetailDao.xml index b36eb89dd..b0dc8be5a 100644 --- a/src/main/resources/mybatis/mapper/inv/InvPreInProductDetailDao.xml +++ b/src/main/resources/mybatis/mapper/inv/InvPreInProductDetailDao.xml @@ -230,40 +230,37 @@ @@ -272,22 +269,22 @@ pd.code, pd.relId, pd.batchNo, - pd.produceDate productionDate, + pd.produceDate productionDate, pd.expireDate, bp.ggxh, - bp.cpmctymc productName, + bp.cpmctymc productName, bp.zczbhhzbapzbh, bp.ylqxzcrbarmc, bp.nameCode, bp.manufactory, pd.invSpaceCode, pd.invCode, - ad.name deptName, - aw.name invName, - sp.name invSpaceName, - sum(pd.inCount) as inCount, - sum(pd.outCount) as outCount, - sum(pd.reCount) as reCount + ad.name deptName, + aw.name invName, + sp.name invSpaceName, + ifnull(sum(pd.inCount), 0) as inCount, + ifnull(sum(pd.outCount), 0) as outCount, + pd.inCount - pd.outCount as reCount from inv_prein_product_detail pd left join basic_udirel bu on pd.relId = bu.id left join basic_products bp on bp.uuid = bu.uuid diff --git a/src/main/resources/mybatis/mapper/inv/InvPreProductDetailDao.xml b/src/main/resources/mybatis/mapper/inv/InvPreProductDetailDao.xml index 256bcf903..80e857adf 100644 --- a/src/main/resources/mybatis/mapper/inv/InvPreProductDetailDao.xml +++ b/src/main/resources/mybatis/mapper/inv/InvPreProductDetailDao.xml @@ -223,37 +223,32 @@ From e25899a6ae40eae3c101d16d0bbab55763ba98e9 Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Thu, 11 May 2023 16:01:25 +0800 Subject: [PATCH 26/48] =?UTF-8?q?=E5=86=85=E9=83=A8=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../glxp/api/controller/inv/InvInnerOrderPrintController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/glxp/api/controller/inv/InvInnerOrderPrintController.java b/src/main/java/com/glxp/api/controller/inv/InvInnerOrderPrintController.java index 208fd2a5f..307894371 100644 --- a/src/main/java/com/glxp/api/controller/inv/InvInnerOrderPrintController.java +++ b/src/main/java/com/glxp/api/controller/inv/InvInnerOrderPrintController.java @@ -186,7 +186,7 @@ public class InvInnerOrderPrintController { } else { Map data = new HashMap(); data.put("data", printEntities); - JasperUtils.jasperReport(request, response, data, systemPDFTemplateEntity.getPath(), "pdf"); + JasperUtils.jasperReport(request, response, data, filePath + "/pdf/template/"+systemPDFTemplateEntity.getPath(), "pdf"); } From f9080d08b8ed0c61432a6f1751e931808cb8cbba Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Thu, 11 May 2023 16:16:25 +0800 Subject: [PATCH 27/48] =?UTF-8?q?=E6=89=93=E5=8D=B0=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SystemPDFTemplateRelevanceCodeServiceImpl.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/com/glxp/api/service/system/impl/SystemPDFTemplateRelevanceCodeServiceImpl.java b/src/main/java/com/glxp/api/service/system/impl/SystemPDFTemplateRelevanceCodeServiceImpl.java index aaf3b556a..6b16e27d4 100644 --- a/src/main/java/com/glxp/api/service/system/impl/SystemPDFTemplateRelevanceCodeServiceImpl.java +++ b/src/main/java/com/glxp/api/service/system/impl/SystemPDFTemplateRelevanceCodeServiceImpl.java @@ -2,6 +2,7 @@ package com.glxp.api.service.system.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.github.pagehelper.PageHelper; import com.glxp.api.dao.system.SysPdfTemplateRelevanceCodeDao; import com.glxp.api.entity.system.SysPdfTemplateRelevanceCodeEntity; import com.glxp.api.req.system.FilterPdfTemplateRelevanceRequest; @@ -10,6 +11,7 @@ import com.glxp.api.service.system.SystemPDFTemplateRelevanceCodeService; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.util.Collections; import java.util.Date; import java.util.List; @@ -34,6 +36,13 @@ public class SystemPDFTemplateRelevanceCodeServiceImpl extends ServiceImpl filterList(FilterPdfTemplateRelevanceRequest systemPDFModuleRequest) { + if (systemPDFModuleRequest == null) { + return Collections.emptyList(); + } + if (systemPDFModuleRequest.getPage() != null) { + int offset = (systemPDFModuleRequest.getPage() - 1) * systemPDFModuleRequest.getLimit(); + PageHelper.offsetPage(offset, systemPDFModuleRequest.getLimit()); + } return sysPdfTemplateRelevanceCodeDao.filterList(systemPDFModuleRequest); } From 6abd1137a82980c401f3226c6a29908b8c001819 Mon Sep 17 00:00:00 2001 From: 1178634255 <1178634255@qq.com> Date: Thu, 11 May 2023 17:26:23 +0800 Subject: [PATCH 28/48] =?UTF-8?q?1=E3=80=81=E4=B8=9A=E5=8A=A1=E6=B5=81?= =?UTF-8?q?=E8=BD=AC=E8=AE=BE=E7=BD=AE=E4=BA=86=E2=80=98=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E7=94=B3=E8=B4=AD=E2=80=99=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90?= =?UTF-8?q?=E2=80=98=E9=87=87=E8=B4=AD=E8=AE=A1=E5=88=92=E2=80=99=EF=BC=8C?= =?UTF-8?q?=E6=97=A0=E8=BF=99=E4=B8=AA=E9=97=AE=E9=A2=98=20=E7=94=B3?= =?UTF-8?q?=E8=B4=AD=E5=8D=95=E6=8D=AE=E5=AE=A1=E6=A0=B8=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E2=80=98=E7=B3=BB=E7=BB=9F=E7=B9=81=E5=BF=99=E2=80=99=EF=BC=8C?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E6=98=AF=E6=95=B0=E6=8D=AE=E5=BA=93=E5=A4=9A?= =?UTF-8?q?=E5=8A=A0=E4=BA=86=E5=87=A0=E6=9D=A1=E4=B8=80=E6=A0=B7=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../glxp/api/controller/purchase/IoPurChangeService.java | 6 ++++++ .../glxp/api/controller/purchase/PurApplyController.java | 1 + src/main/resources/application-dev.yml | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/purchase/IoPurChangeService.java b/src/main/java/com/glxp/api/controller/purchase/IoPurChangeService.java index 2b3157389..a3f02c130 100644 --- a/src/main/java/com/glxp/api/controller/purchase/IoPurChangeService.java +++ b/src/main/java/com/glxp/api/controller/purchase/IoPurChangeService.java @@ -120,12 +120,16 @@ public class IoPurChangeService { BasicBusTypeChangeEntity basicBusTypeChangeEntity = new BasicBusTypeChangeEntity(); //查询申购详情 List purApplyDetailEntityList = purApplyDetailService.findByOrderId(purApplyEntity.getId() + ""); + System.out.println("//---------------------------------判断申购为已审核就生成计划单-------------------------------------------//"); //---------------------------------判断申购为已审核就生成计划单-------------------------------------------// PurPlanEntity purPlanEntity = new PurPlanEntity(); List purPlanDetailEntityList = new ArrayList<>(); if (purApplyEntity.getStatus() == 3) { + basicBusTypeChangeEntity = basicBusTypeChangeService.selectByOriginAction("CPSG"); + if (basicBusTypeChangeEntity != null && StrUtil.isNotEmpty(basicBusTypeChangeEntity.getTargetBusAction()) && basicBusTypeChangeEntity.isEnable() == true) { + purPlanEntity.setBillNo(gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.JH_ORDER, "yyyyMMdd"))); purPlanEntity.setBillDate(purApplyEntity.getBillDate()); purPlanEntity.setStatus(basicBusTypeChangeEntity.getBusAuditStatus()); @@ -145,6 +149,7 @@ public class IoPurChangeService { //插入计划主表 purPlanService.insert(purPlanEntity); //用stream流复制list + System.out.println("111111111111111111111111111我要进来咯666666666666666++++++++++++++++"); purPlanDetailEntityList = purApplyDetailEntityList.stream().map(e -> { PurPlanDetailEntity d = new PurPlanDetailEntity(); d.setOrderIdFk(purPlanEntity.getId() + ""); @@ -153,6 +158,7 @@ public class IoPurChangeService { d.setCount(e.getCount()); d.setSupId(e.getSupId()); d.setZczbhhzbapzbh(e.getZczbhhzbapzbh()); + System.out.println("ddddddddddddddddddddddddddddddd"+d); return d; }).collect(Collectors.toList()); purPlanDetailService.insertPurPlanDetailEntity(purPlanDetailEntityList); diff --git a/src/main/java/com/glxp/api/controller/purchase/PurApplyController.java b/src/main/java/com/glxp/api/controller/purchase/PurApplyController.java index fbca70550..7b5d49678 100644 --- a/src/main/java/com/glxp/api/controller/purchase/PurApplyController.java +++ b/src/main/java/com/glxp/api/controller/purchase/PurApplyController.java @@ -164,6 +164,7 @@ public class PurApplyController { purApplyService.update(purApplyEntity); if (purApplyRequest.getStatus() == 3) { + // generateDocument(purApplyEntity); purChangeService.purApplyChange(purApplyEntity); } diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 7e59ac974..b8a8be397 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -4,9 +4,9 @@ server: spring: datasource: driver-class-name: com.p6spy.engine.spy.P6SpyDriver - jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_wms?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_wms_0510?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true username: root - password: 123456 + password: root hikari: connection-timeout: 60000 maximum-pool-size: 20 From 7a19bbe32fd54f91fe3db4fa396ec3ab1efc9148 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Thu, 11 May 2023 17:58:43 +0800 Subject: [PATCH 29/48] =?UTF-8?q?=E7=89=A9=E8=B5=84=E6=91=86=E6=94=BE?= =?UTF-8?q?=E4=B8=8B=E6=9E=B6bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/inv/impl/InvPlaceServiceImpl.java | 64 +++++++++++-------- 1 file changed, 38 insertions(+), 26 deletions(-) diff --git a/src/main/java/com/glxp/api/service/inv/impl/InvPlaceServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/InvPlaceServiceImpl.java index 429770096..d6b34aa12 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/InvPlaceServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/InvPlaceServiceImpl.java @@ -121,7 +121,7 @@ public class InvPlaceServiceImpl implements InvPlaceService { //如果库存为空就删了该数据 - if (invPreInProductDetailEntity != null && invPreInProductDetailEntity.getInCount() == 0 && invPreInProductDetailEntity.getOutCount() == 0 + if (invPreInProductDetailEntity != null && invPreInProductDetailEntity.getInCount() == 0 && (invPreInProductDetailEntity.getOutCount() == null || invPreInProductDetailEntity.getOutCount() == 0) && invPreInProductDetailEntity.getCount() == 0 && invPreInProductDetailEntity.getReCount() == 0) { invPreInProductDetailDao.deleteById(invPreInProductDetailEntity); } @@ -191,7 +191,7 @@ public class InvPlaceServiceImpl implements InvPlaceService { invPreProductDetailDao.updateById(invPreInProductDetailEntity); //如果库存为空就删了该数据 - if (invPreInProductDetailEntity != null && invPreInProductDetailEntity.getInCount() == 0 && invPreInProductDetailEntity.getOutCount() == 0 + if (invPreInProductDetailEntity != null && invPreInProductDetailEntity.getInCount() == 0 && (invPreInProductDetailEntity.getOutCount() == null || invPreInProductDetailEntity.getOutCount() == 0) && invPreInProductDetailEntity.getCount() == 0 && invPreInProductDetailEntity.getReCount() == 0) { invPreProductDetailDao.deleteById(invPreInProductDetailEntity); } @@ -257,7 +257,7 @@ public class InvPlaceServiceImpl implements InvPlaceService { invProductDetailDao.updateById(invPreInProductDetailEntity); //如果库存为空就删了该数据 - if (invPreInProductDetailEntity != null && invPreInProductDetailEntity.getInCount() == 0 && invPreInProductDetailEntity.getOutCount() == 0 + if (invPreInProductDetailEntity != null && invPreInProductDetailEntity.getInCount() == 0 && (invPreInProductDetailEntity.getOutCount() == null || invPreInProductDetailEntity.getOutCount() == 0) && invPreInProductDetailEntity.getCount() == 0 && invPreInProductDetailEntity.getReCount() == 0) { invProductDetailDao.deleteById(invPreInProductDetailEntity); } @@ -598,7 +598,7 @@ public class InvPlaceServiceImpl implements InvPlaceService { ew.select("count"); ew.last("limit 1"); InvPreInProductDetailEntity invPreInProductDetailEntity = invPreInProductDetailDao.selectOne(ew); - if (invPreInProductDetailEntity.getCount() <= 0) { + if (invPreInProductDetailEntity==null || invPreInProductDetailEntity.getCount() <= 0) { return "该产品没存在该货架上!"; } if (StrUtil.isNotBlank(bindInvSpaceRequest.getOrderId())) { @@ -621,7 +621,7 @@ public class InvPlaceServiceImpl implements InvPlaceService { ew.select("count"); ew.last("limit 1"); InvPreProductDetailEntity invPreProductDetailEntity = invPreProductDetailDao.selectOne(ew); - if (invPreProductDetailEntity.getCount() <= 0) { + if (invPreProductDetailEntity==null || invPreProductDetailEntity.getCount() <= 0) { return "该产品没存在该货架上!"; } if (StrUtil.isNotBlank(bindInvSpaceRequest.getOrderId())) { @@ -644,7 +644,7 @@ public class InvPlaceServiceImpl implements InvPlaceService { ew.select("count"); ew.last("limit 1"); InvProductDetailEntity invProductDetailEntity = invProductDetailDao.selectOne(ew); - if (invProductDetailEntity.getCount() <= 0) { + if (invProductDetailEntity==null || invProductDetailEntity.getCount() <= 0) { return "该产品没存在该货架上!"; } if (StrUtil.isNotBlank(bindInvSpaceRequest.getOrderId())) { @@ -761,6 +761,16 @@ public class InvPlaceServiceImpl implements InvPlaceService { invPreInProductDetailEntity.setOutCount(0); invPreInProductDetailDao.insert(invPreInProductDetailEntity); } + //如果库存为空就删了该数据 + ew.clear(); + ew.eq("code", invPlaceOrderDetailEntity.getCode()); + ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); + ew.last("limit 1"); + invPreInProductDetailEntity = invPreInProductDetailDao.selectOne(ew); + if (invPreInProductDetailEntity != null && invPreInProductDetailEntity.getInCount() == 0 && invPreInProductDetailEntity.getOutCount() == 0 + && invPreInProductDetailEntity.getCount() == 0 && invPreInProductDetailEntity.getReCount() == 0) { + invPreInProductDetailDao.deleteById(invPreInProductDetailEntity); + } } } } @@ -788,16 +798,6 @@ public class InvPlaceServiceImpl implements InvPlaceService { invPreProductDetailEntity.setReCount(invPreProductDetailEntity.getReCount() - reCount); invPreProductDetailDao.updateById(invPreProductDetailEntity); - //如果库存为空就删了该数据 - ew.clear(); - ew.eq("code", invPlaceOrderDetailEntity.getCode()); - ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); - ew.last("limit 1"); - invPreProductDetailEntity = invPreProductDetailDao.selectOne(ew); - if (invPreProductDetailEntity != null && invPreProductDetailEntity.getInCount() == 0 && invPreProductDetailEntity.getOutCount() == 0 - && invPreProductDetailEntity.getCount() == 0 && invPreProductDetailEntity.getReCount() == 0) { - invPreProductDetailDao.deleteById(invPreProductDetailEntity); - } //如果有存在数据就加没有就新建 @@ -826,6 +826,16 @@ public class InvPlaceServiceImpl implements InvPlaceService { invPreProductDetailEntity.setOutCount(0); invPreProductDetailDao.insert(invPreProductDetailEntity); } + //如果库存为空就删了该数据 + ew.clear(); + ew.eq("code", invPlaceOrderDetailEntity.getCode()); + ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); + ew.last("limit 1"); + invPreProductDetailEntity = invPreProductDetailDao.selectOne(ew); + if (invPreProductDetailEntity != null && invPreProductDetailEntity.getInCount() == 0 && invPreProductDetailEntity.getOutCount() == 0 + && invPreProductDetailEntity.getCount() == 0 && invPreProductDetailEntity.getReCount() == 0) { + invPreProductDetailDao.deleteById(invPreProductDetailEntity); + } } } } @@ -854,16 +864,6 @@ public class InvPlaceServiceImpl implements InvPlaceService { invProductDetailEntity.setReCount(invProductDetailEntity.getReCount() - reCount); invProductDetailDao.updateById(invProductDetailEntity); - //如果库存为空就删了该数据 - ew.clear(); - ew.eq("code", invPlaceOrderDetailEntity.getCode()); - ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); - ew.last("limit 1"); - invProductDetailEntity = invProductDetailDao.selectOne(ew); - if (invProductDetailEntity != null && invProductDetailEntity.getInCount() == 0 && invProductDetailEntity.getOutCount() == 0 - && invProductDetailEntity.getCount() == 0 && invProductDetailEntity.getReCount() == 0) { - invProductDetailDao.deleteById(invProductDetailEntity); - } //如果有存在数据就加没有就新建 @@ -892,6 +892,18 @@ public class InvPlaceServiceImpl implements InvPlaceService { invProductDetailEntity.setOutCount(0); invProductDetailDao.insert(invProductDetailEntity); } + + + //如果库存为空就删了该数据 + ew.clear(); + ew.eq("code", invPlaceOrderDetailEntity.getCode()); + ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); + ew.last("limit 1"); + invProductDetailEntity = invProductDetailDao.selectOne(ew); + if (invProductDetailEntity != null && invProductDetailEntity.getInCount() == 0 && invProductDetailEntity.getOutCount() == 0 + && invProductDetailEntity.getCount() == 0 && invProductDetailEntity.getReCount() == 0) { + invProductDetailDao.deleteById(invProductDetailEntity); + } } } } From db3e3bd2cad54b955489a58a4b81e13960044730 Mon Sep 17 00:00:00 2001 From: anthonywj Date: Fri, 12 May 2023 09:19:22 +0800 Subject: [PATCH 30/48] =?UTF-8?q?=E7=9B=B8=E5=85=B3=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/glxp/api/entity/basic/BasicBussinessTypeEntity.java | 2 +- .../java/com/glxp/api/req/basic/BussinessTypeSaveRequest.java | 2 +- .../java/com/glxp/api/res/basic/BasicBussinessTypeResponse.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/glxp/api/entity/basic/BasicBussinessTypeEntity.java b/src/main/java/com/glxp/api/entity/basic/BasicBussinessTypeEntity.java index 1cb8ed369..e0cd68eec 100644 --- a/src/main/java/com/glxp/api/entity/basic/BasicBussinessTypeEntity.java +++ b/src/main/java/com/glxp/api/entity/basic/BasicBussinessTypeEntity.java @@ -193,7 +193,7 @@ public class BasicBussinessTypeEntity { * 允许科室多次使用出库 */ @TableField(value = "useDyCount") - private boolean useDyCount; + private int useDyCount; /** * 到期提示 diff --git a/src/main/java/com/glxp/api/req/basic/BussinessTypeSaveRequest.java b/src/main/java/com/glxp/api/req/basic/BussinessTypeSaveRequest.java index 882419664..c51498c1c 100644 --- a/src/main/java/com/glxp/api/req/basic/BussinessTypeSaveRequest.java +++ b/src/main/java/com/glxp/api/req/basic/BussinessTypeSaveRequest.java @@ -165,7 +165,7 @@ public class BussinessTypeSaveRequest { /** * 允许科室多次使用出库 */ - private Boolean useDyCount; + private Integer useDyCount; /** * 到期提示 diff --git a/src/main/java/com/glxp/api/res/basic/BasicBussinessTypeResponse.java b/src/main/java/com/glxp/api/res/basic/BasicBussinessTypeResponse.java index 587d993eb..43d545e7f 100644 --- a/src/main/java/com/glxp/api/res/basic/BasicBussinessTypeResponse.java +++ b/src/main/java/com/glxp/api/res/basic/BasicBussinessTypeResponse.java @@ -75,7 +75,7 @@ public class BasicBussinessTypeResponse { private int checkBalance; private boolean secCheckBalance; - private boolean useDyCount; + private int useDyCount; private boolean expireTip; From f22fc931f249c379565ade99d65aa539241ac5f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Fri, 12 May 2023 10:41:40 +0800 Subject: [PATCH 31/48] =?UTF-8?q?inv=5Fuser=5Fproduct,inv=5Fuser=5Fproduct?= =?UTF-8?q?=5Fdetail=E8=A1=A8=E5=88=9D=E5=A7=8B=E5=8C=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dao/inv/InvUserProductDetailMapper.java | 16 ++ .../api/dao/inv/InvUserProductMapper.java | 16 ++ .../glxp/api/entity/inv/InvUserProduct.java | 145 ++++++++++++++++++ .../api/entity/inv/InvUserProductDetail.java | 135 ++++++++++++++++ .../impl/InvUserProductDetailServiceImpl.java | 17 ++ .../inv/impl/InvUserProductServiceImpl.java | 18 +++ .../mapper/inv/InvUserProductDetailMapper.xml | 40 +++++ .../mapper/inv/InvUserProductMapper.xml | 42 +++++ 8 files changed, 429 insertions(+) create mode 100644 src/main/java/com/glxp/api/dao/inv/InvUserProductDetailMapper.java create mode 100644 src/main/java/com/glxp/api/dao/inv/InvUserProductMapper.java create mode 100644 src/main/java/com/glxp/api/entity/inv/InvUserProduct.java create mode 100644 src/main/java/com/glxp/api/entity/inv/InvUserProductDetail.java create mode 100644 src/main/java/com/glxp/api/service/inv/impl/InvUserProductDetailServiceImpl.java create mode 100644 src/main/java/com/glxp/api/service/inv/impl/InvUserProductServiceImpl.java create mode 100644 src/main/resources/mybatis/mapper/inv/InvUserProductDetailMapper.xml create mode 100644 src/main/resources/mybatis/mapper/inv/InvUserProductMapper.xml diff --git a/src/main/java/com/glxp/api/dao/inv/InvUserProductDetailMapper.java b/src/main/java/com/glxp/api/dao/inv/InvUserProductDetailMapper.java new file mode 100644 index 000000000..d5beddee6 --- /dev/null +++ b/src/main/java/com/glxp/api/dao/inv/InvUserProductDetailMapper.java @@ -0,0 +1,16 @@ +package com.glxp.api.dao.inv; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.glxp.api.entity.inv.InvUserProductDetail; + +/** +* @author Lenovo +* @description 针对表【inv_user_product_detail(用户库存详情表)】的数据库操作Mapper +* @createDate 2023-05-12 10:19:43 +* @Entity com.glxp.api.entity.InvUserProductDetail +*/ +public interface InvUserProductDetailMapper extends BaseMapper { + + +} diff --git a/src/main/java/com/glxp/api/dao/inv/InvUserProductMapper.java b/src/main/java/com/glxp/api/dao/inv/InvUserProductMapper.java new file mode 100644 index 000000000..743965f2d --- /dev/null +++ b/src/main/java/com/glxp/api/dao/inv/InvUserProductMapper.java @@ -0,0 +1,16 @@ +package com.glxp.api.dao.inv; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.glxp.api.entity.inv.InvUserProduct; + +/** +* @author Lenovo +* @description 针对表【inv_user_product(用户库存表)】的数据库操作Mapper +* @createDate 2023-05-12 10:19:43 +* @Entity com.glxp.api.entity.InvUserProduct +*/ +public interface InvUserProductMapper extends BaseMapper { + + +} diff --git a/src/main/java/com/glxp/api/entity/inv/InvUserProduct.java b/src/main/java/com/glxp/api/entity/inv/InvUserProduct.java new file mode 100644 index 000000000..fee401783 --- /dev/null +++ b/src/main/java/com/glxp/api/entity/inv/InvUserProduct.java @@ -0,0 +1,145 @@ +package com.glxp.api.entity.inv; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 用户库存表 + * @TableName inv_user_product + */ +@TableName(value ="inv_user_product") +@Data +public class InvUserProduct{ + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 耗材字典ID + */ + @TableField(value = "relIdFk") + private Long relIdFk; + + /** + * 最小销售标识 + */ + @TableField(value = "nameCode") + private String nameCode; + + /** + * 批次号 + */ + @TableField(value = "batchNo") + private String batchNo; + + /** + * 生产日期 + */ + @TableField(value = "productionDate") + private String productionDate; + + /** + * 失效日期 + */ + @TableField(value = "expireDate") + private String expireDate; + + /** + * 入库数量 + */ + @TableField(value = "inCount") + private Integer inCount; + + /** + * 出库数量 + */ + @TableField(value = "outCount") + private int outCount; + + /** + * 实际数量 + */ + @TableField(value = "reCount") + private int reCount; + + /** + * 客户ID + */ + @TableField(value = "customerId") + private String customerId; + + /** + * 供应商ID + */ + @TableField(value = "supId") + private String supId; + + /** + * 部门编码 + */ + @TableField(value = "deptCode") + private String deptCode; + + /** + * 仓库编码 + */ + @TableField(value = "invCode") + private String invCode; + + /** + * 货位编码 + */ + @TableField(value = "invSpaceCode") + private String invSpaceCode; + + /** + * 创建时间 + */ + @TableField(value = "createTime") + private Date createTime; + + + /** + * 更新时间 + */ + @TableField(value = "updateTime") + private Date updateTime; + + /** + * + */ + private Integer nowStock; + + /** + * + */ + private Integer frozenCount; + + /** + * + */ + private Integer planInCount; + + /** + * + */ + private Integer planOutCount; + + /** + * + */ + private Integer onWayCount; + + /** + * + */ + private Integer availableStock; + + +} \ No newline at end of file diff --git a/src/main/java/com/glxp/api/entity/inv/InvUserProductDetail.java b/src/main/java/com/glxp/api/entity/inv/InvUserProductDetail.java new file mode 100644 index 000000000..19137bc41 --- /dev/null +++ b/src/main/java/com/glxp/api/entity/inv/InvUserProductDetail.java @@ -0,0 +1,135 @@ +package com.glxp.api.entity.inv; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 用户库存详情表 + * @TableName inv_user_product_detail + */ +@TableName(value ="inv_user_product_detail") +@Data +public class InvUserProductDetail{ + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * UDI码 + */ + @TableField(value = "code") + private String code; + + /** + * 订单号外键 + */ + @TableField(value = "orderId") + private String orderId; + + /** + * 耗材字典ID + */ + @TableField(value = "relId") + private Long relId; + + /** + * 最小销售标识 + */ + @TableField(value = "nameCode") + private String nameCode; + + /** + * 批次号 + */ + @TableField(value = "batchNo") + private String batchNo; + + /** + * 生产日期 + */ + @TableField(value = "produceDate") + private String produceDate; + + /** + * 失效日期 + */ + @TableField(value = "expireDate") + private String expireDate; + + /** + * 序列号 + */ + @TableField(value = "serialNo") + private String serialNo; + + /** + * 供应商 + */ + @TableField(value = "supId") + private String supId; + + /** + * 扫码数量 + */ + @TableField(value = "`count`") + private Integer count; + + /** + * 实际数量 + */ + @TableField(value = "reCount") + private Integer reCount; + + + @TableField(value = "inCount") + private Integer inCount; + + + @TableField(value = "outCount") + private Integer outCount; + + /** + * 部门编码 + */ + @TableField(value = "deptCode") + private String deptCode; + + /** + * 仓库编码 + */ + @TableField(value = "invCode") + private String invCode; + + /** + * 货位编码 + */ + @TableField(value = "invSpaceCode") + private String invSpaceCode; + + /** + * 采购类型 + */ + @TableField(value = "purchaseType") + private Integer purchaseType; + + /** + * 更新时间 + */ + @TableField(value = "updateTime") + private Date updateTime; + + @TableField(value = "mainAction") + private String mainAction; + @TableField(value = "action") + private String action; + + + + +} \ No newline at end of file diff --git a/src/main/java/com/glxp/api/service/inv/impl/InvUserProductDetailServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/InvUserProductDetailServiceImpl.java new file mode 100644 index 000000000..e73487506 --- /dev/null +++ b/src/main/java/com/glxp/api/service/inv/impl/InvUserProductDetailServiceImpl.java @@ -0,0 +1,17 @@ +package com.glxp.api.service.inv.impl; + + +import com.glxp.api.dao.inv.InvUserProductDetailMapper; +import com.glxp.api.entity.inv.InvUserProductDetail; +import com.glxp.api.service.inv.InvUserProductDetailService; +import org.springframework.stereotype.Service; + +/** +* @author Lenovo +* @description 针对表【inv_user_product_detail(用户库存详情表)】的数据库操作Service实现 +* @createDate 2023-05-12 10:19:43 +*/ +@Service +public class InvUserProductDetailServiceImpl implements InvUserProductDetailService{ + +} diff --git a/src/main/java/com/glxp/api/service/inv/impl/InvUserProductServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/InvUserProductServiceImpl.java new file mode 100644 index 000000000..571474c29 --- /dev/null +++ b/src/main/java/com/glxp/api/service/inv/impl/InvUserProductServiceImpl.java @@ -0,0 +1,18 @@ +package com.glxp.api.service.inv.impl; + + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.glxp.api.dao.inv.InvUserProductMapper; +import com.glxp.api.entity.inv.InvUserProduct; +import com.glxp.api.service.inv.InvUserProductService; +import org.springframework.stereotype.Service; + +/** +* @author Lenovo +* @description 针对表【inv_user_product(用户库存表)】的数据库操作Service实现 +* @createDate 2023-05-12 10:19:43 +*/ +@Service +public class InvUserProductServiceImpl implements InvUserProductService{ + +} diff --git a/src/main/resources/mybatis/mapper/inv/InvUserProductDetailMapper.xml b/src/main/resources/mybatis/mapper/inv/InvUserProductDetailMapper.xml new file mode 100644 index 000000000..5ce19766e --- /dev/null +++ b/src/main/resources/mybatis/mapper/inv/InvUserProductDetailMapper.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id,code,mainAction, + action,orderId,relId, + nameCode,batchNo,produceDate, + expireDate,serialNo,supId, + count,reCount,deptCode, + invCode,invSpaceCode,purchaseType, + updateTime,inCount,outCount + + diff --git a/src/main/resources/mybatis/mapper/inv/InvUserProductMapper.xml b/src/main/resources/mybatis/mapper/inv/InvUserProductMapper.xml new file mode 100644 index 000000000..807a59cf0 --- /dev/null +++ b/src/main/resources/mybatis/mapper/inv/InvUserProductMapper.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id,relIdFk,nameCode, + batchNo,productionDate,expireDate, + inCount,outCount,reCount, + customerId,supId,deptCode, + invCode,invSpaceCode,createTime, + updateTime,nowStock,frozenCount, + planInCount,planOutCount,onWayCount, + availableStock + + From 92e2a0fe8917414b6495826048757e2290d99d68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Fri, 12 May 2023 11:10:03 +0800 Subject: [PATCH 32/48] =?UTF-8?q?inv=5Fuser=5Fproduct,inv=5Fuser=5Fproduct?= =?UTF-8?q?=5Fdetail=E8=A1=A8=E5=88=9D=E5=A7=8B=E5=8C=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inv/InvUserProductController.java | 55 +++++++++++++++++++ .../inv/InvUserProductDetailController.java | 17 ++++++ ...ductMapper.java => InvUserProductDao.java} | 5 +- ...pper.java => InvUserProductDetailDao.java} | 5 +- ...l.java => InvUserProductDetailEntity.java} | 2 +- ...Product.java => InvUserProductEntity.java} | 2 +- .../impl/InvUserProductDetailServiceImpl.java | 39 ++++++++++--- .../inv/impl/InvUserProductServiceImpl.java | 40 +++++++++++--- ...cHospTypeDao.xml => InvUserProductDao.xml} | 0 ...nvoiceMapper.xml => InvUserProductDao.xml} | 0 ...uctDetailDao.xml => InvUserProductDao.xml} | 0 .../mapper/inv/InvUserProductDetailMapper.xml | 34 +----------- .../mapper/inv/InvUserProductMapper.xml | 37 +------------ ...nuHelpMapper.xml => InvUserProductDao.xml} | 0 14 files changed, 144 insertions(+), 92 deletions(-) create mode 100644 src/main/java/com/glxp/api/controller/inv/InvUserProductController.java create mode 100644 src/main/java/com/glxp/api/controller/inv/InvUserProductDetailController.java rename src/main/java/com/glxp/api/dao/inv/{InvUserProductMapper.java => InvUserProductDao.java} (58%) rename src/main/java/com/glxp/api/dao/inv/{InvUserProductDetailMapper.java => InvUserProductDetailDao.java} (56%) rename src/main/java/com/glxp/api/entity/inv/{InvUserProductDetail.java => InvUserProductDetailEntity.java} (98%) rename src/main/java/com/glxp/api/entity/inv/{InvUserProduct.java => InvUserProductEntity.java} (98%) rename src/main/resources/mybatis/mapper/basic/{BasicHospTypeDao.xml => InvUserProductDao.xml} (100%) rename src/main/resources/mybatis/mapper/inout/{IoOrderInvoiceMapper.xml => InvUserProductDao.xml} (100%) rename src/main/resources/mybatis/mapper/inv/{InvPreProductDetailDao.xml => InvUserProductDao.xml} (100%) rename src/main/resources/mybatis/mapper/system/{SysMenuHelpMapper.xml => InvUserProductDao.xml} (100%) diff --git a/src/main/java/com/glxp/api/controller/inv/InvUserProductController.java b/src/main/java/com/glxp/api/controller/inv/InvUserProductController.java new file mode 100644 index 000000000..05792e6b3 --- /dev/null +++ b/src/main/java/com/glxp/api/controller/inv/InvUserProductController.java @@ -0,0 +1,55 @@ +package com.glxp.api.controller.inv; + +import cn.hutool.core.util.StrUtil; +import com.glxp.api.annotation.Log; +import com.glxp.api.common.enums.ResultEnum; +import com.glxp.api.common.res.BaseResponse; +import com.glxp.api.common.util.ResultVOUtils; +import com.glxp.api.constant.BusinessType; +import com.glxp.api.controller.BaseController; +import com.glxp.api.entity.inv.InvProductDetailEntity; +import com.glxp.api.entity.inv.InvProductEntity; +import com.glxp.api.entity.inv.InvUserProductEntity; +import com.glxp.api.req.inv.FilterInvProductDetailRequest; +import com.glxp.api.req.system.DeleteRequest; +import com.glxp.api.service.inv.InvProductDetailService; +import com.glxp.api.service.inv.InvUserProductService; +import groovy.util.logging.Slf4j; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + +/** + * 用户库存查询接口 + */ +@Slf4j +@RestController +public class InvUserProductController extends BaseController { + + @Resource + private InvUserProductService invUserProductService; + @Resource + private InvProductDetailService invProductDetailServicel; + + +// /** +// * 添加库存 +// * +// * @param invUserProductEntity +// * @return +// */ +// @PostMapping("/spms/inv/user/product/add") +// @Log(title = "用户库存查询", businessType = BusinessType.INSERT) +// public BaseResponse addInvUserProduct(@RequestBody InvUserProductEntity invUserProductEntity) { +// +// invUserProductService. +// +// +// } + + + +} diff --git a/src/main/java/com/glxp/api/controller/inv/InvUserProductDetailController.java b/src/main/java/com/glxp/api/controller/inv/InvUserProductDetailController.java new file mode 100644 index 000000000..1484650d8 --- /dev/null +++ b/src/main/java/com/glxp/api/controller/inv/InvUserProductDetailController.java @@ -0,0 +1,17 @@ +package com.glxp.api.controller.inv; + +import com.glxp.api.controller.BaseController; +import groovy.util.logging.Slf4j; +import org.springframework.web.bind.annotation.RestController; + +/** + * 用户库存查询接口 + */ +@Slf4j +@RestController +public class InvUserProductDetailController{ + + + + +} diff --git a/src/main/java/com/glxp/api/dao/inv/InvUserProductMapper.java b/src/main/java/com/glxp/api/dao/inv/InvUserProductDao.java similarity index 58% rename from src/main/java/com/glxp/api/dao/inv/InvUserProductMapper.java rename to src/main/java/com/glxp/api/dao/inv/InvUserProductDao.java index 743965f2d..7212a8b8a 100644 --- a/src/main/java/com/glxp/api/dao/inv/InvUserProductMapper.java +++ b/src/main/java/com/glxp/api/dao/inv/InvUserProductDao.java @@ -2,15 +2,14 @@ package com.glxp.api.dao.inv; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.glxp.api.entity.inv.InvUserProduct; +import com.glxp.api.entity.inv.InvUserProductEntity; /** * @author Lenovo * @description 针对表【inv_user_product(用户库存表)】的数据库操作Mapper * @createDate 2023-05-12 10:19:43 -* @Entity com.glxp.api.entity.InvUserProduct */ -public interface InvUserProductMapper extends BaseMapper { +public interface InvUserProductDao extends BaseMapper { } diff --git a/src/main/java/com/glxp/api/dao/inv/InvUserProductDetailMapper.java b/src/main/java/com/glxp/api/dao/inv/InvUserProductDetailDao.java similarity index 56% rename from src/main/java/com/glxp/api/dao/inv/InvUserProductDetailMapper.java rename to src/main/java/com/glxp/api/dao/inv/InvUserProductDetailDao.java index d5beddee6..f1f02e967 100644 --- a/src/main/java/com/glxp/api/dao/inv/InvUserProductDetailMapper.java +++ b/src/main/java/com/glxp/api/dao/inv/InvUserProductDetailDao.java @@ -2,15 +2,14 @@ package com.glxp.api.dao.inv; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.glxp.api.entity.inv.InvUserProductDetail; +import com.glxp.api.entity.inv.InvUserProductDetailEntity; /** * @author Lenovo * @description 针对表【inv_user_product_detail(用户库存详情表)】的数据库操作Mapper * @createDate 2023-05-12 10:19:43 -* @Entity com.glxp.api.entity.InvUserProductDetail */ -public interface InvUserProductDetailMapper extends BaseMapper { +public interface InvUserProductDetailDao extends BaseMapper { } diff --git a/src/main/java/com/glxp/api/entity/inv/InvUserProductDetail.java b/src/main/java/com/glxp/api/entity/inv/InvUserProductDetailEntity.java similarity index 98% rename from src/main/java/com/glxp/api/entity/inv/InvUserProductDetail.java rename to src/main/java/com/glxp/api/entity/inv/InvUserProductDetailEntity.java index 19137bc41..59434006c 100644 --- a/src/main/java/com/glxp/api/entity/inv/InvUserProductDetail.java +++ b/src/main/java/com/glxp/api/entity/inv/InvUserProductDetailEntity.java @@ -15,7 +15,7 @@ import java.util.Date; */ @TableName(value ="inv_user_product_detail") @Data -public class InvUserProductDetail{ +public class InvUserProductDetailEntity { @TableId(value = "id", type = IdType.AUTO) private Integer id; diff --git a/src/main/java/com/glxp/api/entity/inv/InvUserProduct.java b/src/main/java/com/glxp/api/entity/inv/InvUserProductEntity.java similarity index 98% rename from src/main/java/com/glxp/api/entity/inv/InvUserProduct.java rename to src/main/java/com/glxp/api/entity/inv/InvUserProductEntity.java index fee401783..a52aa9872 100644 --- a/src/main/java/com/glxp/api/entity/inv/InvUserProduct.java +++ b/src/main/java/com/glxp/api/entity/inv/InvUserProductEntity.java @@ -15,7 +15,7 @@ import java.util.Date; */ @TableName(value ="inv_user_product") @Data -public class InvUserProduct{ +public class InvUserProductEntity { @TableId(value = "id", type = IdType.AUTO) private Integer id; diff --git a/src/main/java/com/glxp/api/service/inv/impl/InvUserProductDetailServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/InvUserProductDetailServiceImpl.java index e73487506..fede624fe 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/InvUserProductDetailServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/InvUserProductDetailServiceImpl.java @@ -1,17 +1,42 @@ package com.glxp.api.service.inv.impl; -import com.glxp.api.dao.inv.InvUserProductDetailMapper; -import com.glxp.api.entity.inv.InvUserProductDetail; +import com.glxp.api.dao.inv.InvUserProductDetailDao; +import com.glxp.api.entity.inv.InvUserProductDetailEntity; import com.glxp.api.service.inv.InvUserProductDetailService; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.List; + /** -* @author Lenovo -* @description 针对表【inv_user_product_detail(用户库存详情表)】的数据库操作Service实现 -* @createDate 2023-05-12 10:19:43 -*/ + * @author Lenovo + * @description 针对表【inv_user_product_detail(用户库存详情表)】的数据库操作Service实现 + * @createDate 2023-05-12 10:19:43 + */ @Service -public class InvUserProductDetailServiceImpl implements InvUserProductDetailService{ +public class InvUserProductDetailServiceImpl implements InvUserProductDetailService { + + @Resource + InvUserProductDetailDao invUserProductDetailDao; + + @Override + public List filterInvUserProductDetailList(InvUserProductDetailEntity invUserProductDetailEntity) { + return null; + } + + @Override + public Boolean addInvUserProductDetail(InvUserProductDetailEntity invUserProductDetailEntity) { + return invUserProductDetailDao.insert(invUserProductDetailEntity) == 1 ? true : false; + } + + @Override + public Boolean updateInvUserProductDetail(InvUserProductDetailEntity invUserProductDetailEntity) { + return invUserProductDetailDao.updateById(invUserProductDetailEntity) == 1 ? true : false; + } + @Override + public Boolean delectInvUserProductDetail(InvUserProductDetailEntity invUserProductDetailEntity) { + return invUserProductDetailDao.deleteById(invUserProductDetailEntity) == 1 ? true : false; + } } diff --git a/src/main/java/com/glxp/api/service/inv/impl/InvUserProductServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/InvUserProductServiceImpl.java index 571474c29..78cc0dfc8 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/InvUserProductServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/InvUserProductServiceImpl.java @@ -1,18 +1,42 @@ package com.glxp.api.service.inv.impl; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.glxp.api.dao.inv.InvUserProductMapper; -import com.glxp.api.entity.inv.InvUserProduct; +import com.glxp.api.dao.inv.InvUserProductDao; +import com.glxp.api.entity.inv.InvUserProductEntity; import com.glxp.api.service.inv.InvUserProductService; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.List; + /** -* @author Lenovo -* @description 针对表【inv_user_product(用户库存表)】的数据库操作Service实现 -* @createDate 2023-05-12 10:19:43 -*/ + * @author Lenovo + * @description 针对表【inv_user_product(用户库存表)】的数据库操作Service实现 + * @createDate 2023-05-12 10:19:43 + */ @Service -public class InvUserProductServiceImpl implements InvUserProductService{ +public class InvUserProductServiceImpl implements InvUserProductService { + + @Resource + InvUserProductDao invUserProductDao; + + @Override + public List filterInvUserProductList(InvUserProductEntity invUserProductEntity) { + return null; + } + + @Override + public Boolean addInvUserProduct(InvUserProductEntity invUserProductEntity) { + return invUserProductDao.insert(invUserProductEntity) == 1 ? true : false; + } + + @Override + public Boolean updateInvUserProduct(InvUserProductEntity invUserProductEntity) { + return invUserProductDao.updateById(invUserProductEntity) == 1 ? true : false; + } + @Override + public Boolean delectInvUserProduct(InvUserProductEntity invUserProductEntity) { + return invUserProductDao.deleteById(invUserProductEntity) == 1 ? true : false; + } } diff --git a/src/main/resources/mybatis/mapper/basic/BasicHospTypeDao.xml b/src/main/resources/mybatis/mapper/basic/InvUserProductDao.xml similarity index 100% rename from src/main/resources/mybatis/mapper/basic/BasicHospTypeDao.xml rename to src/main/resources/mybatis/mapper/basic/InvUserProductDao.xml diff --git a/src/main/resources/mybatis/mapper/inout/IoOrderInvoiceMapper.xml b/src/main/resources/mybatis/mapper/inout/InvUserProductDao.xml similarity index 100% rename from src/main/resources/mybatis/mapper/inout/IoOrderInvoiceMapper.xml rename to src/main/resources/mybatis/mapper/inout/InvUserProductDao.xml diff --git a/src/main/resources/mybatis/mapper/inv/InvPreProductDetailDao.xml b/src/main/resources/mybatis/mapper/inv/InvUserProductDao.xml similarity index 100% rename from src/main/resources/mybatis/mapper/inv/InvPreProductDetailDao.xml rename to src/main/resources/mybatis/mapper/inv/InvUserProductDao.xml diff --git a/src/main/resources/mybatis/mapper/inv/InvUserProductDetailMapper.xml b/src/main/resources/mybatis/mapper/inv/InvUserProductDetailMapper.xml index 5ce19766e..a00ae93fb 100644 --- a/src/main/resources/mybatis/mapper/inv/InvUserProductDetailMapper.xml +++ b/src/main/resources/mybatis/mapper/inv/InvUserProductDetailMapper.xml @@ -2,39 +2,7 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - id,code,mainAction, - action,orderId,relId, - nameCode,batchNo,produceDate, - expireDate,serialNo,supId, - count,reCount,deptCode, - invCode,invSpaceCode,purchaseType, - updateTime,inCount,outCount - diff --git a/src/main/resources/mybatis/mapper/inv/InvUserProductMapper.xml b/src/main/resources/mybatis/mapper/inv/InvUserProductMapper.xml index 807a59cf0..d5ccd853f 100644 --- a/src/main/resources/mybatis/mapper/inv/InvUserProductMapper.xml +++ b/src/main/resources/mybatis/mapper/inv/InvUserProductMapper.xml @@ -2,41 +2,6 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - id,relIdFk,nameCode, - batchNo,productionDate,expireDate, - inCount,outCount,reCount, - customerId,supId,deptCode, - invCode,invSpaceCode,createTime, - updateTime,nowStock,frozenCount, - planInCount,planOutCount,onWayCount, - availableStock - diff --git a/src/main/resources/mybatis/mapper/system/SysMenuHelpMapper.xml b/src/main/resources/mybatis/mapper/system/InvUserProductDao.xml similarity index 100% rename from src/main/resources/mybatis/mapper/system/SysMenuHelpMapper.xml rename to src/main/resources/mybatis/mapper/system/InvUserProductDao.xml From cc736af2861418dac35ce62f5d7d69900d97b320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Fri, 12 May 2023 11:27:44 +0800 Subject: [PATCH 33/48] =?UTF-8?q?inv=5Fuser=5Fproduct,inv=5Fuser=5Fproduct?= =?UTF-8?q?=5Fdetail=E8=A1=A8=E5=88=9D=E5=A7=8B=E5=8C=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inv/InvUserProductDetailService.java | 24 ++++++++++++++++++ .../service/inv/InvUserProductService.java | 25 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 src/main/java/com/glxp/api/service/inv/InvUserProductDetailService.java create mode 100644 src/main/java/com/glxp/api/service/inv/InvUserProductService.java diff --git a/src/main/java/com/glxp/api/service/inv/InvUserProductDetailService.java b/src/main/java/com/glxp/api/service/inv/InvUserProductDetailService.java new file mode 100644 index 000000000..b53cb7258 --- /dev/null +++ b/src/main/java/com/glxp/api/service/inv/InvUserProductDetailService.java @@ -0,0 +1,24 @@ +package com.glxp.api.service.inv; + + +import com.glxp.api.entity.inv.InvUserProductDetailEntity; + + +import java.util.List; + +/** +* @author Lenovo +* @description 针对表【inv_user_product_detail(用户库存详情表)】的数据库操作Service +* @createDate 2023-05-12 10:19:43 +*/ +public interface InvUserProductDetailService{ + + List filterInvUserProductDetailList(InvUserProductDetailEntity invUserProductDetailEntity); + + Boolean addInvUserProductDetail(InvUserProductDetailEntity invUserProductDetailEntity); + + Boolean updateInvUserProductDetail(InvUserProductDetailEntity invUserProductDetailEntity); + + Boolean delectInvUserProductDetail(InvUserProductDetailEntity invUserProductDetailEntity); + +} diff --git a/src/main/java/com/glxp/api/service/inv/InvUserProductService.java b/src/main/java/com/glxp/api/service/inv/InvUserProductService.java new file mode 100644 index 000000000..dca979be3 --- /dev/null +++ b/src/main/java/com/glxp/api/service/inv/InvUserProductService.java @@ -0,0 +1,25 @@ +package com.glxp.api.service.inv; + + +import com.glxp.api.common.res.BaseResponse; +import com.glxp.api.entity.inv.InvUserProductEntity; + +import java.util.List; + +/** +* @author Lenovo +* @description 针对表【inv_user_product(用户库存表)】的数据库操作Service +* @createDate 2023-05-12 10:19:43 +*/ +public interface InvUserProductService{ + + List filterInvUserProductList(InvUserProductEntity invUserProductEntity); + + Boolean addInvUserProduct(InvUserProductEntity invUserProductEntity); + + Boolean updateInvUserProduct(InvUserProductEntity invUserProductEntity); + + Boolean delectInvUserProduct(InvUserProductEntity invUserProductEntity); + + +} From 75f346c7a788407788c8ab58306619d3439b865f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Fri, 12 May 2023 14:25:31 +0800 Subject: [PATCH 34/48] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=BA=93=E5=AD=98?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/dao/inv/InvUserProductDetailDao.java | 3 +- .../glxp/api/entity/inv/InvProductEntity.java | 1 + .../api/entity/inv/InvUserProductEntity.java | 7 + .../api/service/inout/IoGenInvService.java | 184 ++++++++++++++++++ .../inv/InvUserProductDetailService.java | 2 + .../service/inv/InvUserProductService.java | 3 + .../impl/InvUserProductDetailServiceImpl.java | 5 + .../inv/impl/InvUserProductServiceImpl.java | 10 + 8 files changed, 214 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/glxp/api/dao/inv/InvUserProductDetailDao.java b/src/main/java/com/glxp/api/dao/inv/InvUserProductDetailDao.java index f1f02e967..882c9a250 100644 --- a/src/main/java/com/glxp/api/dao/inv/InvUserProductDetailDao.java +++ b/src/main/java/com/glxp/api/dao/inv/InvUserProductDetailDao.java @@ -2,6 +2,7 @@ package com.glxp.api.dao.inv; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.glxp.api.dao.BaseMapperPlus; import com.glxp.api.entity.inv.InvUserProductDetailEntity; /** @@ -9,7 +10,7 @@ import com.glxp.api.entity.inv.InvUserProductDetailEntity; * @description 针对表【inv_user_product_detail(用户库存详情表)】的数据库操作Mapper * @createDate 2023-05-12 10:19:43 */ -public interface InvUserProductDetailDao extends BaseMapper { +public interface InvUserProductDetailDao extends BaseMapperPlus { } diff --git a/src/main/java/com/glxp/api/entity/inv/InvProductEntity.java b/src/main/java/com/glxp/api/entity/inv/InvProductEntity.java index 8c2b9504e..75c99f7ac 100644 --- a/src/main/java/com/glxp/api/entity/inv/InvProductEntity.java +++ b/src/main/java/com/glxp/api/entity/inv/InvProductEntity.java @@ -105,4 +105,5 @@ public class InvProductEntity { @TableField(value = "updateTime") private Date updateTime; + } diff --git a/src/main/java/com/glxp/api/entity/inv/InvUserProductEntity.java b/src/main/java/com/glxp/api/entity/inv/InvUserProductEntity.java index a52aa9872..0291023a8 100644 --- a/src/main/java/com/glxp/api/entity/inv/InvUserProductEntity.java +++ b/src/main/java/com/glxp/api/entity/inv/InvUserProductEntity.java @@ -142,4 +142,11 @@ public class InvUserProductEntity { private Integer availableStock; + @TableField(value = "type") + private Integer type; + + @TableField(value = "userId") + private String userId; + + } \ No newline at end of file diff --git a/src/main/java/com/glxp/api/service/inout/IoGenInvService.java b/src/main/java/com/glxp/api/service/inout/IoGenInvService.java index 92b7fdc53..553903ad8 100644 --- a/src/main/java/com/glxp/api/service/inout/IoGenInvService.java +++ b/src/main/java/com/glxp/api/service/inout/IoGenInvService.java @@ -52,6 +52,10 @@ public class IoGenInvService { IoCodeService codeService; @Resource IBasicBusTypePreService basicBusTypePreService; + @Resource + InvUserProductService invUserProductService; + @Resource + InvUserProductDetailService invUserProductDetailService; @Resource @@ -122,6 +126,64 @@ public class IoGenInvService { } + //生成用户普通库存 + public void genNorInvUser(String orderId) { + IoOrderEntity orderEntity = orderService.findByBillNo(orderId); + List orderDetailResultEntities = orderDetailResultService.findByOrderId(orderId); + List codeEnttities = codeService.findByOrderId(orderId); + + //生成库存产品表 + for (IoOrderDetailResultEntity orderDetailResultEntity : orderDetailResultEntities) { + InvUserProductEntity invUserProductEntity = invUserProductService.selectByUnique(orderDetailResultEntity.getBindRlFk(), orderDetailResultEntity.getBatchNo(), orderDetailResultEntity.getSupId(), orderEntity.getDeptCode(), orderEntity.getInvCode(),orderEntity.getCreateUser(),ConstantStatus.ACTION_TYPE_NORMAL); + if (invUserProductEntity == null) { + invUserProductEntity = new InvUserProductEntity(); + invUserProductEntity.setRelIdFk(orderDetailResultEntity.getBindRlFk()); + invUserProductEntity.setNameCode(orderDetailResultEntity.getNameCode()); + invUserProductEntity.setBatchNo(orderDetailResultEntity.getBatchNo()); + invUserProductEntity.setProductionDate(orderDetailResultEntity.getProductDate()); + invUserProductEntity.setExpireDate(orderDetailResultEntity.getExpireDate()); + invUserProductEntity.setInCount(0); + invUserProductEntity.setType(ConstantStatus.ACTION_TYPE_NORMAL); + invUserProductEntity.setOutCount(0); + invUserProductEntity.setSupId(orderDetailResultEntity.getSupId()); + invUserProductEntity.setDeptCode(orderEntity.getDeptCode()); + invUserProductEntity.setInvCode(orderEntity.getInvCode()); + invUserProductEntity.setCreateTime(new Date()); + invUserProductEntity.setUpdateTime(new Date()); + invUserProductService.addInvUserProduct(invUserProductEntity); + } + + if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { + invUserProductEntity.setOutCount(invUserProductEntity.getOutCount() + orderDetailResultEntity.getReCount()); + } else if (orderEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { + invUserProductEntity.setInCount(invUserProductEntity.getInCount() + orderDetailResultEntity.getReCount()); + } + invUserProductEntity.setReCount(invUserProductEntity.getInCount() - invUserProductEntity.getOutCount()); + invUserProductEntity.setUpdateTime(new Date()); + invUserProductService.updateInvUserProduct(invUserProductEntity); + } + + //生成库存码详情 + List invUserProductDetailEntityList = new ArrayList<>(); + for (IoCodeEntity codeEntity : codeEnttities) { + InvUserProductDetailEntity invUserProductDetailEntity = new InvUserProductDetailEntity(); + BeanUtils.copyProperties(codeEntity, invUserProductDetailEntity); + invUserProductDetailEntity.setRelId(codeEntity.getRelId()); + invUserProductDetailEntity.setUpdateTime(new Date()); + invUserProductDetailEntity.setId(null); + invUserProductDetailEntity.setInvSpaceCode(codeEntity.getWarehouseCode()); + invUserProductDetailEntity.setPurchaseType(ConstantStatus.PRUCHASE_COMMON); + if (invUserProductDetailEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { + invUserProductDetailEntity.setInCount(invUserProductDetailEntity.getReCount()); + } else if (invUserProductDetailEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { + invUserProductDetailEntity.setOutCount(invUserProductDetailEntity.getReCount()); + } + invUserProductDetailEntityList.add(invUserProductDetailEntity); + } + + invUserProductDetailService.addInvUserProductDetailList(invUserProductDetailEntityList); + } + @Resource InvPreProductService invPreProductService; @@ -189,6 +251,67 @@ public class IoGenInvService { } + //生成用户寄售库存 + public void genUserPreInv(String orderId) { + IoOrderEntity orderEntity = orderService.findByBillNo(orderId); + List orderDetailResultEntities = orderDetailResultService.findByOrderId(orderId); + List codeEnttities = codeService.findByOrderId(orderId); + + //生成库存产品表 + for (IoOrderDetailResultEntity orderDetailResultEntity : orderDetailResultEntities) { + InvUserProductEntity invUserProductEntity = invUserProductService.selectByUnique(orderDetailResultEntity.getBindRlFk(), orderDetailResultEntity.getBatchNo(), orderDetailResultEntity.getSupId(), orderEntity.getDeptCode(), orderEntity.getInvCode(),orderEntity.getCreateUser(),ConstantStatus.ACTION_TYPE_PREIN); + if (invUserProductEntity == null) { + invUserProductEntity = new InvUserProductEntity(); + invUserProductEntity.setRelIdFk(orderDetailResultEntity.getBindRlFk()); + invUserProductEntity.setNameCode(orderDetailResultEntity.getNameCode()); + invUserProductEntity.setBatchNo(orderDetailResultEntity.getBatchNo()); + invUserProductEntity.setProductionDate(orderDetailResultEntity.getProductDate()); + invUserProductEntity.setExpireDate(orderDetailResultEntity.getExpireDate()); + invUserProductEntity.setInCount(0); + invUserProductEntity.setType(ConstantStatus.ACTION_TYPE_PREIN); + invUserProductEntity.setOutCount(0); + invUserProductEntity.setSupId(orderDetailResultEntity.getSupId()); + invUserProductEntity.setDeptCode(orderEntity.getDeptCode()); + invUserProductEntity.setInvCode(orderEntity.getInvCode()); + invUserProductEntity.setCreateTime(new Date()); + invUserProductEntity.setUpdateTime(new Date()); + invUserProductService.addInvUserProduct(invUserProductEntity); + } + + if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { + invUserProductEntity.setOutCount(invUserProductEntity.getOutCount() + orderDetailResultEntity.getReCount()); + } else if (orderEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { + invUserProductEntity.setInCount(invUserProductEntity.getInCount() + orderDetailResultEntity.getReCount()); + } + invUserProductEntity.setReCount(invUserProductEntity.getInCount() - invUserProductEntity.getOutCount()); + invUserProductEntity.setUpdateTime(new Date()); + invUserProductService.updateInvUserProduct(invUserProductEntity); + } + + //生成库存码详情 + List invUserProductDetailEntityList = new ArrayList<>(); + for (IoCodeEntity codeEntity : codeEnttities) { + InvUserProductDetailEntity invUserProductDetailEntity = new InvUserProductDetailEntity(); + BeanUtils.copyProperties(codeEntity, invUserProductDetailEntity); + invUserProductDetailEntity.setRelId(codeEntity.getRelId()); + invUserProductDetailEntity.setUpdateTime(new Date()); + invUserProductDetailEntity.setId(null); + invUserProductDetailEntity.setInvSpaceCode(codeEntity.getWarehouseCode()); + invUserProductDetailEntity.setPurchaseType(ConstantStatus.PRUCHASE_COMMON); + if (invUserProductDetailEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { + invUserProductDetailEntity.setInCount(invUserProductDetailEntity.getReCount()); + } else if (invUserProductDetailEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { + invUserProductDetailEntity.setOutCount(invUserProductDetailEntity.getReCount()); + } + invUserProductDetailEntityList.add(invUserProductDetailEntity); + } + + invUserProductDetailService.addInvUserProductDetailList(invUserProductDetailEntityList); + + } + + + @Resource InvPreinProductService invPreinProductService; @@ -272,5 +395,66 @@ public class IoGenInvService { } + //生成用户预验收库存 + public void genUserPreInInv(String orderId) { + + + IoOrderEntity orderEntity = orderService.findByBillNo(orderId); + List orderDetailResultEntities = orderDetailResultService.findByOrderId(orderId); + List codeEnttities = codeService.findByOrderId(orderId); + //生成库存产品表 + for (IoOrderDetailResultEntity orderDetailResultEntity : orderDetailResultEntities) { + InvUserProductEntity invUserProductEntity = invUserProductService.selectByUnique(orderDetailResultEntity.getBindRlFk(), orderDetailResultEntity.getBatchNo(), orderDetailResultEntity.getSupId(), orderEntity.getDeptCode(), orderEntity.getInvCode(),orderEntity.getCreateUser(),ConstantStatus.ACTION_TYPE_ADVANCE); + if (invUserProductEntity == null) { + invUserProductEntity = new InvUserProductEntity(); + invUserProductEntity.setRelIdFk(orderDetailResultEntity.getBindRlFk()); + invUserProductEntity.setNameCode(orderDetailResultEntity.getNameCode()); + invUserProductEntity.setBatchNo(orderDetailResultEntity.getBatchNo()); + invUserProductEntity.setProductionDate(orderDetailResultEntity.getProductDate()); + invUserProductEntity.setExpireDate(orderDetailResultEntity.getExpireDate()); + invUserProductEntity.setInCount(0); + invUserProductEntity.setType(ConstantStatus.ACTION_TYPE_ADVANCE); + invUserProductEntity.setOutCount(0); + invUserProductEntity.setSupId(orderDetailResultEntity.getSupId()); + invUserProductEntity.setDeptCode(orderEntity.getDeptCode()); + invUserProductEntity.setInvCode(orderEntity.getInvCode()); + invUserProductEntity.setCreateTime(new Date()); + invUserProductEntity.setUpdateTime(new Date()); + invUserProductService.addInvUserProduct(invUserProductEntity); + } + + if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { + invUserProductEntity.setOutCount(invUserProductEntity.getOutCount() + orderDetailResultEntity.getReCount()); + } else if (orderEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { + invUserProductEntity.setInCount(invUserProductEntity.getInCount() + orderDetailResultEntity.getReCount()); + } + invUserProductEntity.setReCount(invUserProductEntity.getInCount() - invUserProductEntity.getOutCount()); + invUserProductEntity.setUpdateTime(new Date()); + invUserProductService.updateInvUserProduct(invUserProductEntity); + } + + //生成库存码详情 + List invUserProductDetailEntityList = new ArrayList<>(); + for (IoCodeEntity codeEntity : codeEnttities) { + InvUserProductDetailEntity invUserProductDetailEntity = new InvUserProductDetailEntity(); + BeanUtils.copyProperties(codeEntity, invUserProductDetailEntity); + invUserProductDetailEntity.setRelId(codeEntity.getRelId()); + invUserProductDetailEntity.setUpdateTime(new Date()); + invUserProductDetailEntity.setId(null); + invUserProductDetailEntity.setInvSpaceCode(codeEntity.getWarehouseCode()); + invUserProductDetailEntity.setPurchaseType(ConstantStatus.PRUCHASE_COMMON); + if (invUserProductDetailEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { + invUserProductDetailEntity.setInCount(invUserProductDetailEntity.getReCount()); + } else if (invUserProductDetailEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { + invUserProductDetailEntity.setOutCount(invUserProductDetailEntity.getReCount()); + } + invUserProductDetailEntityList.add(invUserProductDetailEntity); + } + + invUserProductDetailService.addInvUserProductDetailList(invUserProductDetailEntityList); + + + } + } diff --git a/src/main/java/com/glxp/api/service/inv/InvUserProductDetailService.java b/src/main/java/com/glxp/api/service/inv/InvUserProductDetailService.java index b53cb7258..a1f59a3d6 100644 --- a/src/main/java/com/glxp/api/service/inv/InvUserProductDetailService.java +++ b/src/main/java/com/glxp/api/service/inv/InvUserProductDetailService.java @@ -17,6 +17,8 @@ public interface InvUserProductDetailService{ Boolean addInvUserProductDetail(InvUserProductDetailEntity invUserProductDetailEntity); + Boolean addInvUserProductDetailList(List invUserProductDetailEntityList); + Boolean updateInvUserProductDetail(InvUserProductDetailEntity invUserProductDetailEntity); Boolean delectInvUserProductDetail(InvUserProductDetailEntity invUserProductDetailEntity); diff --git a/src/main/java/com/glxp/api/service/inv/InvUserProductService.java b/src/main/java/com/glxp/api/service/inv/InvUserProductService.java index dca979be3..c7989b3b6 100644 --- a/src/main/java/com/glxp/api/service/inv/InvUserProductService.java +++ b/src/main/java/com/glxp/api/service/inv/InvUserProductService.java @@ -2,6 +2,7 @@ package com.glxp.api.service.inv; import com.glxp.api.common.res.BaseResponse; +import com.glxp.api.entity.inv.InvProductEntity; import com.glxp.api.entity.inv.InvUserProductEntity; import java.util.List; @@ -21,5 +22,7 @@ public interface InvUserProductService{ Boolean delectInvUserProduct(InvUserProductEntity invUserProductEntity); + InvUserProductEntity selectByUnique(Long relId, String batchNo, String supId, String deptCode, String invCode,String userId,Integer type); + } diff --git a/src/main/java/com/glxp/api/service/inv/impl/InvUserProductDetailServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/InvUserProductDetailServiceImpl.java index fede624fe..750b9a40e 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/InvUserProductDetailServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/InvUserProductDetailServiceImpl.java @@ -30,6 +30,11 @@ public class InvUserProductDetailServiceImpl implements InvUserProductDetailServ return invUserProductDetailDao.insert(invUserProductDetailEntity) == 1 ? true : false; } + @Override + public Boolean addInvUserProductDetailList(List invUserProductDetailEntityList) { + return invUserProductDetailDao.insertBatch(invUserProductDetailEntityList); + } + @Override public Boolean updateInvUserProductDetail(InvUserProductDetailEntity invUserProductDetailEntity) { return invUserProductDetailDao.updateById(invUserProductDetailEntity) == 1 ? true : false; diff --git a/src/main/java/com/glxp/api/service/inv/impl/InvUserProductServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/InvUserProductServiceImpl.java index 78cc0dfc8..248cf0a06 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/InvUserProductServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/InvUserProductServiceImpl.java @@ -1,7 +1,10 @@ package com.glxp.api.service.inv.impl; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.glxp.api.dao.inv.InvUserProductDao; +import com.glxp.api.entity.inv.InvProductEntity; import com.glxp.api.entity.inv.InvUserProductEntity; import com.glxp.api.service.inv.InvUserProductService; import org.springframework.stereotype.Service; @@ -39,4 +42,11 @@ public class InvUserProductServiceImpl implements InvUserProductService { public Boolean delectInvUserProduct(InvUserProductEntity invUserProductEntity) { return invUserProductDao.deleteById(invUserProductEntity) == 1 ? true : false; } + + @Override + public InvUserProductEntity selectByUnique(Long relId, String batchNo, String supId, String deptCode, String invCode,String userId,Integer type) { + return invUserProductDao.selectOne(new QueryWrapper().eq("relIdFk", relId).eq(StrUtil.isNotEmpty(batchNo), "batchNo", batchNo) + .isNull(StrUtil.isEmpty(batchNo), "batchNo").eq("supId", supId).eq("deptCode", deptCode) + .eq("invCode", invCode).eq("userId",userId).eq("type",type)); + } } From 7b3f63f85d64af9713cf3a012199baef07c26a5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Fri, 12 May 2023 17:11:16 +0800 Subject: [PATCH 35/48] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=BA=93=E5=AD=98?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inv/impl/InvPlaceOrderServiceImpl.java | 2 +- .../service/inv/impl/InvPlaceServiceImpl.java | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/glxp/api/service/inv/impl/InvPlaceOrderServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/InvPlaceOrderServiceImpl.java index 37b909ada..d59bbaa82 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/InvPlaceOrderServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/InvPlaceOrderServiceImpl.java @@ -189,7 +189,7 @@ public class InvPlaceOrderServiceImpl implements InvPlaceOrderService { InvPlaceOrderEntity orderEntity = new InvPlaceOrderEntity(); orderEntity.setId(IdUtil.getSnowflakeNextId()); orderEntity.setRecordId(recordId); - orderEntity.setType(1); + orderEntity.setType(3); // orderEntity.setOrderId(addInvPlaceOrderRequest.getOrderId()); orderEntity.setCreateUser(userId); orderEntity.setCreateTime(new Date()); diff --git a/src/main/java/com/glxp/api/service/inv/impl/InvPlaceServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/InvPlaceServiceImpl.java index d6b34aa12..8269df22d 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/InvPlaceServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/InvPlaceServiceImpl.java @@ -510,6 +510,9 @@ public class InvPlaceServiceImpl implements InvPlaceService { ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); InvPreInProductDetailEntity invPreInProductDetailEntity = invPreInProductDetailDao.selectOne(ew); count = invPreInProductDetailEntity.getInCount(); + if (invPreInProductDetailEntity == null) { + return "该产品库存不足!"; + } } else { count = invPreInProductDetailDao.getInventoryQuantity(bindInvSpaceRequest.getCode()); } @@ -535,6 +538,9 @@ public class InvPlaceServiceImpl implements InvPlaceService { ew.eq("code", bindInvSpaceRequest.getCode()); ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); InvPreProductDetailEntity invPreProductDetailEntity = invPreProductDetailDao.selectOne(ew); + if (invPreProductDetailEntity == null) { + return "该产品库存不足!"; + } count = invPreProductDetailEntity.getInCount(); } else { count = invPreProductDetailDao.getInventoryQuantity(bindInvSpaceRequest.getCode()); @@ -562,6 +568,9 @@ public class InvPlaceServiceImpl implements InvPlaceService { ew.eq("code", bindInvSpaceRequest.getCode()); ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); InvProductDetailEntity invProductDetailEntity = invProductDetailDao.selectOne(ew); + if (invProductDetailEntity == null) { + return "该产品库存不足!"; + } count = invProductDetailEntity.getInCount(); } else { count = invProductDetailDao.getInventoryQuantity(bindInvSpaceRequest.getCode()); @@ -729,7 +738,7 @@ public class InvPlaceServiceImpl implements InvPlaceService { ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); ew.last("limit 1"); invPreInProductDetailEntity = invPreInProductDetailDao.selectOne(ew); - if (invPreInProductDetailEntity != null && invPreInProductDetailEntity.getInCount() == 0 && invPreInProductDetailEntity.getOutCount() == 0 + if (invPreInProductDetailEntity != null && invPreInProductDetailEntity.getInCount() == 0 && (invPreInProductDetailEntity.getOutCount() == null || invPreInProductDetailEntity.getOutCount() == 0) && invPreInProductDetailEntity.getCount() == 0 && invPreInProductDetailEntity.getReCount() == 0) { invPreInProductDetailDao.deleteById(invPreInProductDetailEntity); } @@ -767,7 +776,7 @@ public class InvPlaceServiceImpl implements InvPlaceService { ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); ew.last("limit 1"); invPreInProductDetailEntity = invPreInProductDetailDao.selectOne(ew); - if (invPreInProductDetailEntity != null && invPreInProductDetailEntity.getInCount() == 0 && invPreInProductDetailEntity.getOutCount() == 0 + if (invPreInProductDetailEntity != null && invPreInProductDetailEntity.getInCount() == 0 && (invPreInProductDetailEntity.getOutCount() == null || invPreInProductDetailEntity.getOutCount() == 0) && invPreInProductDetailEntity.getCount() == 0 && invPreInProductDetailEntity.getReCount() == 0) { invPreInProductDetailDao.deleteById(invPreInProductDetailEntity); } @@ -832,7 +841,7 @@ public class InvPlaceServiceImpl implements InvPlaceService { ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); ew.last("limit 1"); invPreProductDetailEntity = invPreProductDetailDao.selectOne(ew); - if (invPreProductDetailEntity != null && invPreProductDetailEntity.getInCount() == 0 && invPreProductDetailEntity.getOutCount() == 0 + if (invPreProductDetailEntity != null && invPreProductDetailEntity.getInCount() == 0 && (invPreProductDetailEntity.getOutCount() == null || invPreProductDetailEntity.getOutCount() == 0) && invPreProductDetailEntity.getCount() == 0 && invPreProductDetailEntity.getReCount() == 0) { invPreProductDetailDao.deleteById(invPreProductDetailEntity); } @@ -900,7 +909,7 @@ public class InvPlaceServiceImpl implements InvPlaceService { ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode()); ew.last("limit 1"); invProductDetailEntity = invProductDetailDao.selectOne(ew); - if (invProductDetailEntity != null && invProductDetailEntity.getInCount() == 0 && invProductDetailEntity.getOutCount() == 0 + if (invProductDetailEntity != null && invProductDetailEntity.getInCount() == 0 && (invProductDetailEntity.getOutCount() == null || invProductDetailEntity.getOutCount() == 0) && invProductDetailEntity.getCount() == 0 && invProductDetailEntity.getReCount() == 0) { invProductDetailDao.deleteById(invProductDetailEntity); } From 385b9075ac127b4a85862220b5d7116d3fe74b7c Mon Sep 17 00:00:00 2001 From: anthonywj Date: Fri, 12 May 2023 21:19:01 +0800 Subject: [PATCH 36/48] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inout/IoCodeTempController.java | 17 +++++++++++++++- .../inout/IoOrderDetailBizController.java | 3 +++ .../inout/IoOrderReviewController.java | 9 +++------ .../system/SysParamConfigController.java | 3 +++ .../api/service/inout/IoAddInoutService.java | 1 - .../service/inout/IoChangeInoutService.java | 5 +++++ .../service/inout/IoCheckInoutService.java | 20 +++++++++++-------- .../api/service/inout/IoGenInvService.java | 1 + .../inout/impl/IoOrderServiceImpl.java | 20 +++++++++---------- .../purchase/impl/PurOrderServiceImpl.java | 3 +++ .../mapper/purchase/PurOrderDetailDao.xml | 8 ++++---- 11 files changed, 60 insertions(+), 30 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java b/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java index d273d21e0..8d87f11a7 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java @@ -1219,10 +1219,25 @@ public class IoCodeTempController extends BaseController { } } if (codeTempEntity.getMyCount() <= 0) { - return ResultVOUtils.error(500, "数量不能小于0"); + return ResultVOUtils.error(500, "数量需要大于0"); } + + IoCodeTempEntity tempEntity = codeTempService.selectById(codeTempEntity.getId()); codeTempEntity.setReCount(codeTempEntity.getMyCount() * udiCalCountUtil.getActCount(codeTempEntity.getNameCode())); + int count = tempEntity.getCount() - codeTempEntity.getCount(); + + //更新扫码详情 + IoOrderDetailCodeEntity orderDetailCodeEntity = ioOrderDetailCodeService.findByUnique(codeTempEntity.getOrderId(), codeTempEntity.getRelId(), codeTempEntity.getBatchNo()); + if (orderDetailCodeEntity != null) { + //扫码数量-1 + int orderCount = orderDetailCodeEntity.getCount(); + orderDetailCodeEntity.setCount(orderCount - count); + orderDetailCodeEntity.setReCount(orderDetailCodeEntity.getCount() * udiCalCountUtil.getActCount(codeTempEntity.getNameCode())); + ioOrderDetailCodeService.update(orderDetailCodeEntity); + } int b = codeTempService.updateById(codeTempEntity); + + if (b > 0) return ResultVOUtils.success("修改成功"); else return ResultVOUtils.error(500, "修改失败!"); diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java index a64b72d80..225d616aa 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java @@ -427,6 +427,9 @@ public class IoOrderDetailBizController extends BaseController { purOrderEntity = purOrderService.selectById(purOrderEntity.getId()); List purOrderDetailEntities = purOrderDetailService.findByOrderId(purOrderEntity.getId() + ""); BasicBusTypeChangeEntity basicBusTypeChangeEntity = basicBusTypeChangeService.selectByOriginAction(purOrderEntity.getBillType()); + if (basicBusTypeChangeEntity == null) { + return ResultVOUtils.error(500, "采购订单未配置转换单据类型!"); + } BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(basicBusTypeChangeEntity.getTargetAction()); AuthAdmin authAdmin = getUser(); diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderReviewController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderReviewController.java index e0c505218..886fb55c6 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderReviewController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderReviewController.java @@ -36,10 +36,7 @@ import com.glxp.api.service.basic.IBasicBussinessTypeService; import com.glxp.api.service.inout.*; import com.glxp.api.service.sync.HeartService; import com.glxp.api.service.system.SystemParamConfigService; -import com.glxp.api.util.CustomUtil; -import com.glxp.api.util.GennerOrderUtils; -import com.glxp.api.util.OrderNoTypeBean; -import com.glxp.api.util.RedisUtil; +import com.glxp.api.util.*; import com.glxp.api.util.udi.UdiCalCountUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.BindingResult; @@ -354,11 +351,11 @@ public class IoOrderReviewController extends BaseController { for (IoCodeEntity checkOrderCodesBean : codesList) { if (checkOrderCodesBean.getCode().toUpperCase(Locale.ROOT).equals(code.toUpperCase(Locale.ROOT))) { if (checkOrderCodesBean.getStatus() == Constant.DB_CHECK_ED - && checkOrderCodesBean.getMyCount() == checkOrderCodesBean.getScanCount()) { + && IntUtil.value(checkOrderCodesBean.getReCount()) == checkOrderCodesBean.getScanCount()) { return Constant.CHECK_REPEAT; } int curCount = checkOrderCodesBean.getScanCount() + calCountUtil.getActCount(checkOrderCodesBean.getNameCode()); - if (curCount == checkOrderCodesBean.getMyCount()) { + if (curCount == IntUtil.value(checkOrderCodesBean.getReCount())) { checkOrderCodesBean.setStatus(Constant.DB_CHECK_ED); } checkOrderCodesBean.setScanCount(curCount); diff --git a/src/main/java/com/glxp/api/controller/system/SysParamConfigController.java b/src/main/java/com/glxp/api/controller/system/SysParamConfigController.java index 8b298d5d6..fdc181594 100644 --- a/src/main/java/com/glxp/api/controller/system/SysParamConfigController.java +++ b/src/main/java/com/glxp/api/controller/system/SysParamConfigController.java @@ -26,6 +26,7 @@ import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import javax.validation.Valid; +import java.util.Comparator; import java.util.List; import java.util.stream.Collectors; @@ -186,6 +187,8 @@ public class SysParamConfigController { filterParamConfigRequest.setParamType(2); filterParamConfigRequest.setParamStatus(1); List systemParamConfigEntities = systemParamConfigService.queryPage(filterParamConfigRequest); + systemParamConfigEntities = systemParamConfigEntities.stream().sorted(Comparator.comparing(SystemParamConfigEntity::getParamKey)) + .collect(Collectors.toList()); ProductRemarkSetEntity productRemarkSetEntity = new ProductRemarkSetEntity(); if (CollUtil.isNotEmpty(systemParamConfigEntities) && systemParamConfigEntities.size() == 8) { diff --git a/src/main/java/com/glxp/api/service/inout/IoAddInoutService.java b/src/main/java/com/glxp/api/service/inout/IoAddInoutService.java index 9d52b75b7..1717a55f4 100644 --- a/src/main/java/com/glxp/api/service/inout/IoAddInoutService.java +++ b/src/main/java/com/glxp/api/service/inout/IoAddInoutService.java @@ -313,7 +313,6 @@ public class IoAddInoutService { List ioOrderDetailCodeEntities = orderDetailCodeDao.selectList(new QueryWrapper().select("id", "count", "reCount", "bindRlFk", "batchNo").eq("orderIdFk", orderEntity.getBillNo())); UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectSupGroupById(codeTempEntity.getRelId(), codeTempEntity.getSupId()); -// UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectGroupById(codeTempEntity.getRelId()); if (CollUtil.isEmpty(ioOrderDetailCodeEntities)) { orderDetailCodeService.insert(buildEntity(orderEntity, codeTempEntity, udiRelevanceResponse)); } else { diff --git a/src/main/java/com/glxp/api/service/inout/IoChangeInoutService.java b/src/main/java/com/glxp/api/service/inout/IoChangeInoutService.java index 042809d2c..4edc166ab 100644 --- a/src/main/java/com/glxp/api/service/inout/IoChangeInoutService.java +++ b/src/main/java/com/glxp/api/service/inout/IoChangeInoutService.java @@ -257,6 +257,11 @@ public class IoChangeInoutService { codeTempEntities.add(codeTempEntity); } codeTempService.insertBatch(codeTempEntities); + +// 生成业务单 + + + if (isGenInovice) { //生成发票信息 List invoiceEntities = ioOrderInvoiceService.findByBillNo(orderEntity.getBillNo()); diff --git a/src/main/java/com/glxp/api/service/inout/IoCheckInoutService.java b/src/main/java/com/glxp/api/service/inout/IoCheckInoutService.java index 34127e5b7..7d6c8858f 100644 --- a/src/main/java/com/glxp/api/service/inout/IoCheckInoutService.java +++ b/src/main/java/com/glxp/api/service/inout/IoCheckInoutService.java @@ -285,16 +285,20 @@ public class IoCheckInoutService { if (orderEntity.getFromType() != ConstantStatus.FROM_UDISP) { orderDetailBizService.deleteByOrderId(orderEntity.getBillNo()); orderDetailResultService.deleteByOrderId(orderEntity.getBillNo()); + if (!orderDetailBizService.isExit(orderEntity.getBillNo())) { + orderDetailCodeEntities.forEach(orderDetailCodeEntity -> + { + //生成业务单据 + IoOrderDetailBizEntity orderDetailBizEntity = new IoOrderDetailBizEntity(); + BeanUtils.copyProperties(orderDetailCodeEntity, orderDetailBizEntity); + orderDetailBizEntity.setCount(orderDetailCodeEntity.getReCount()); + orderDetailBizEntity.setId(null); + orderDetailBizService.insert(orderDetailBizEntity); + }); + + } orderDetailCodeEntities.forEach(orderDetailCodeEntity -> { - //生成业务单据 - IoOrderDetailBizEntity orderDetailBizEntity = new IoOrderDetailBizEntity(); - BeanUtils.copyProperties(orderDetailCodeEntity, orderDetailBizEntity); - orderDetailBizEntity.setCount(orderDetailCodeEntity.getReCount()); - orderDetailBizEntity.setId(null); - orderDetailBizService.insert(orderDetailBizEntity); - - //生成单据结果 IoOrderDetailResultEntity orderDetailResultEntity = new IoOrderDetailResultEntity(); BeanUtils.copyProperties(orderDetailCodeEntity, orderDetailResultEntity); diff --git a/src/main/java/com/glxp/api/service/inout/IoGenInvService.java b/src/main/java/com/glxp/api/service/inout/IoGenInvService.java index 553903ad8..c35f1b330 100644 --- a/src/main/java/com/glxp/api/service/inout/IoGenInvService.java +++ b/src/main/java/com/glxp/api/service/inout/IoGenInvService.java @@ -185,6 +185,7 @@ public class IoGenInvService { } + @Resource InvPreProductService invPreProductService; @Resource diff --git a/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java b/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java index 8d0d264ca..f3a13da72 100644 --- a/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java @@ -299,7 +299,7 @@ public class IoOrderServiceImpl implements IoOrderService { //查询条码 IoOrderEntity orderEntity = findByBillNo(billNo); if (orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_AUDITED - || orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_CHECK_SUCCESS) { + || orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_CHECK_SUCCESS || orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_CHECK_REW) { //更新正式表 IoCodeEntity ioCodeEntity = codeService.findByUnique(billNo, code); if (ioCodeEntity.getMyCount() > 1) { @@ -331,12 +331,12 @@ public class IoOrderServiceImpl implements IoOrderService { InvPreInProductDetailEntity invProductDetailEntity = invPreinProductDetailService.selectByCode(billNo, code); int count = invProductDetailEntity.getCount() - 1; + int reCount = udiCalCountUtil.getActCount(invProductDetailEntity.getNameCode()); if (count == 0) { invPreinProductDetailService.deleteById(invProductDetailEntity.getId() + ""); } else { //更新详情表 invProductDetailEntity.setCount(count); - int reCount = udiCalCountUtil.getActCount(invProductDetailEntity.getNameCode()); invProductDetailEntity.setReCount(invProductDetailEntity.getReCount() - reCount); invPreinProductDetailService.update(invProductDetailEntity); } @@ -344,10 +344,10 @@ public class IoOrderServiceImpl implements IoOrderService { InvPreinProductEntity invProductEntity = invPreinProductService.selectByUnique(invProductDetailEntity.getRelId(), invProductDetailEntity.getBatchNo(), invProductDetailEntity.getSupId(), invProductDetailEntity.getDeptCode(), invProductDetailEntity.getInvCode()); if (invProductEntity != null) { if (ConstantType.TYPE_PUT.equals(invProductDetailEntity.getMainAction())) { - int inCount = invProductEntity.getInCount() - invProductDetailEntity.getReCount(); + int inCount = invProductEntity.getInCount() - reCount; invProductEntity.setInCount(inCount); } else if (ConstantType.TYPE_OUT.equals(invProductDetailEntity.getMainAction())) { - int outCount = invProductEntity.getOutCount() - invProductDetailEntity.getReCount(); + int outCount = invProductEntity.getOutCount() - reCount; invProductEntity.setOutCount(outCount); } invProductEntity.setReCount(invProductEntity.getInCount() - invProductEntity.getOutCount()); @@ -357,12 +357,12 @@ public class IoOrderServiceImpl implements IoOrderService { } else if (basicBussinessTypeEntity.getActionType() == ConstantStatus.ACTION_TYPE_ADVANCE) { //寄售库存 InvPreProductDetailEntity invProductDetailEntity = invPreProductDetailService.selectByCode(billNo, code); int count = invProductDetailEntity.getCount() - 1; + int reCount = udiCalCountUtil.getActCount(invProductDetailEntity.getNameCode()); if (count == 0) { invPreProductService.deleteById(invProductDetailEntity.getId()); } else { //更新详情表 invProductDetailEntity.setCount(count); - int reCount = udiCalCountUtil.getActCount(invProductDetailEntity.getNameCode()); invProductDetailEntity.setReCount(invProductDetailEntity.getReCount() - reCount); invPreProductDetailService.update(invProductDetailEntity); } @@ -370,10 +370,10 @@ public class IoOrderServiceImpl implements IoOrderService { InvPreProductEntity invProductEntity = invPreProductService.selectByUnique(invProductDetailEntity.getRelId(), invProductDetailEntity.getBatchNo(), invProductDetailEntity.getSupId(), invProductDetailEntity.getDeptCode(), invProductDetailEntity.getInvCode()); if (invProductEntity != null) { if (ConstantType.TYPE_PUT.equals(invProductDetailEntity.getMainAction())) { - int inCount = invProductEntity.getInCount() - invProductDetailEntity.getReCount(); + int inCount = invProductEntity.getInCount() - reCount; invProductEntity.setInCount(inCount); } else if (ConstantType.TYPE_OUT.equals(invProductDetailEntity.getMainAction())) { - int outCount = invProductEntity.getOutCount() - invProductDetailEntity.getReCount(); + int outCount = invProductEntity.getOutCount() - reCount; invProductEntity.setOutCount(outCount); } invProductEntity.setReCount(invProductEntity.getInCount() - invProductEntity.getOutCount()); @@ -382,12 +382,12 @@ public class IoOrderServiceImpl implements IoOrderService { } else { //普通库存 InvProductDetailEntity invProductDetailEntity = invProductDetailService.selectByCode(billNo, code); int count = invProductDetailEntity.getCount() - 1; + int reCount = udiCalCountUtil.getActCount(invProductDetailEntity.getNameCode()); if (count == 0) { invProductDetailService.deleteById(invProductDetailEntity.getId()); } else { //更新详情表 invProductDetailEntity.setCount(count); - int reCount = udiCalCountUtil.getActCount(invProductDetailEntity.getNameCode()); invProductDetailEntity.setReCount(invProductDetailEntity.getReCount() - reCount); invProductDetailService.update(invProductDetailEntity); } @@ -395,10 +395,10 @@ public class IoOrderServiceImpl implements IoOrderService { InvProductEntity invProductEntity = invProductService.selectByUnique(invProductDetailEntity.getRelId(), invProductDetailEntity.getBatchNo(), invProductDetailEntity.getSupId(), invProductDetailEntity.getDeptCode(), invProductDetailEntity.getInvCode()); if (invProductEntity != null) { if (ConstantType.TYPE_PUT.equals(invProductDetailEntity.getMainAction())) { - int inCount = invProductEntity.getInCount() - invProductDetailEntity.getReCount(); + int inCount = invProductEntity.getInCount() - reCount; invProductEntity.setInCount(inCount); } else if (ConstantType.TYPE_OUT.equals(invProductDetailEntity.getMainAction())) { - int outCount = invProductEntity.getOutCount() - invProductDetailEntity.getReCount(); + int outCount = invProductEntity.getOutCount() - reCount; invProductEntity.setOutCount(outCount); } invProductEntity.setReCount(invProductEntity.getInCount() - invProductEntity.getOutCount()); diff --git a/src/main/java/com/glxp/api/service/purchase/impl/PurOrderServiceImpl.java b/src/main/java/com/glxp/api/service/purchase/impl/PurOrderServiceImpl.java index d5195b1c5..b21e07a65 100644 --- a/src/main/java/com/glxp/api/service/purchase/impl/PurOrderServiceImpl.java +++ b/src/main/java/com/glxp/api/service/purchase/impl/PurOrderServiceImpl.java @@ -1,6 +1,7 @@ package com.glxp.api.service.purchase.impl; import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.IdUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.github.pagehelper.PageHelper; @@ -64,6 +65,8 @@ public class PurOrderServiceImpl implements PurOrderService { @Override public Boolean insert(PurOrderEntity purOrderEntity) { + if (purOrderEntity.getId() == null) + purOrderEntity.setId(IdUtil.getSnowflakeNextId()); return purOrderDao.insert(purOrderEntity) > 0 ? true : false; } diff --git a/src/main/resources/mybatis/mapper/purchase/PurOrderDetailDao.xml b/src/main/resources/mybatis/mapper/purchase/PurOrderDetailDao.xml index 0e4c4ece9..fcab2bda2 100644 --- a/src/main/resources/mybatis/mapper/purchase/PurOrderDetailDao.xml +++ b/src/main/resources/mybatis/mapper/purchase/PurOrderDetailDao.xml @@ -48,9 +48,9 @@ basic_corp.`name` supName FROM pur_order_detail - INNER JOIN basic_udirel ON pur_order_detail.productId = basic_udirel.id - INNER JOIN basic_products ON basic_udirel.uuid = basic_products.uuid - INNER JOIN basic_corp ON pur_order_detail.supId = basic_corp.erpId + left JOIN basic_udirel ON pur_order_detail.productId = basic_udirel.id + left JOIN basic_products ON basic_udirel.uuid = basic_products.uuid + left JOIN basic_corp ON pur_order_detail.supId = basic_corp.erpId AND orderIdFk = #{orderIdFk} @@ -174,4 +174,4 @@ and pur_order.status=3 - \ No newline at end of file + From 1fa526349234f99a50b60b6029c88aba233e28f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Mon, 15 May 2023 14:32:25 +0800 Subject: [PATCH 37/48] =?UTF-8?q?=E5=BA=93=E5=AD=98=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E6=89=93=E5=8D=B0=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inout/IoOrderDetailResultController.java | 123 +++++++++++++++++- .../inout/FilterOrderDetailResultRequest.java | 3 + 2 files changed, 123 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailResultController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailResultController.java index 8328cff81..78d23e851 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailResultController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailResultController.java @@ -2,30 +2,49 @@ package com.glxp.api.controller.inout; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; import com.github.pagehelper.PageInfo; import com.glxp.api.annotation.AuthRuleAnnotation; import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.constant.ConstantType; +import com.glxp.api.constant.FileConstant; import com.glxp.api.controller.BaseController; import com.glxp.api.entity.basic.BasicBussinessTypeEntity; import com.glxp.api.entity.inout.IoOrderDetailBizEntity; import com.glxp.api.entity.inout.IoOrderDetailCodeEntity; import com.glxp.api.entity.inout.IoOrderEntity; -import com.glxp.api.req.inout.FilterCodeRequest; -import com.glxp.api.req.inout.FilterOrderDetailResultRequest; -import com.glxp.api.req.inout.FilterOrderRequest; +import com.glxp.api.entity.system.SysPdfTemplateRelevanceCodeEntity; +import com.glxp.api.entity.system.SysPdfTemplateRelevanceStatemenEntity; +import com.glxp.api.entity.system.SystemPDFTemplateEntity; +import com.glxp.api.req.basic.FilterOrderPrintRequest; +import com.glxp.api.req.inout.*; +import com.glxp.api.req.purchase.purPlanPrintRequest; import com.glxp.api.res.inout.IoCodeResponse; import com.glxp.api.res.inout.IoOrderDetailResultResponse; import com.glxp.api.service.basic.IBasicBussinessTypeService; import com.glxp.api.service.inout.*; +import com.glxp.api.service.system.SystemPDFModuleService; +import com.glxp.api.service.system.SystemPDFTemplateService; +import com.glxp.api.util.JasperUtils; +import net.sf.jasperreports.engine.JRException; +import org.springframework.beans.factory.annotation.Value; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * 单据扫码明细查询接口 @@ -40,6 +59,12 @@ public class IoOrderDetailResultController extends BaseController { IBasicBussinessTypeService basicBussinessTypeService; @Resource IoCodeService codeService; + @Resource + private SystemPDFTemplateService systemPDFTemplateService; + @Resource + private SystemPDFModuleService systemPDFModuleService; + @Value("${file_path}") + private String filePath; /** * 查询单据扫码明细列表 @@ -135,5 +160,97 @@ public class IoOrderDetailResultController extends BaseController { return ResultVOUtils.success(orderDetailBizEntities); } + //校验模板是否正确 + @AuthRuleAnnotation("") + @PostMapping("/udiwms/pdf/template/order/result/file") + public BaseResponse inspectionStockOrderPDFFromTemplateFile(@RequestBody InspectionPDFTemplateRequest inspectionPDFTemplateRequest) { + + //查询模板文件是否存在 + SysPdfTemplateRelevanceStatemenEntity sysPdfTemplateRelevanceStatemenEntity = systemPDFModuleService.selectByStatemenId(inspectionPDFTemplateRequest.getId()); + if (null == sysPdfTemplateRelevanceStatemenEntity) { + return ResultVOUtils.error(ResultEnum.DATA_NOT, "所属模块错误"); + } + + SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(String.valueOf(sysPdfTemplateRelevanceStatemenEntity.getTemplateId())); + if (null == systemPDFTemplateEntity) { + return ResultVOUtils.error(ResultEnum.DATA_NOT, "模板错误"); + } + return ResultVOUtils.success(sysPdfTemplateRelevanceStatemenEntity.getTemplateId()); + } + + + /** + * 出入库明细打印 + * + * @param filterOrderDetailResultRequest + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udiwms/inout/resultDetail/filterOrderPrint") + public BaseResponse filterOrderPrint(@RequestBody FilterOrderDetailResultRequest filterOrderDetailResultRequest, HttpServletRequest request, HttpServletResponse response) throws JRException, IOException { + List ioOrderDetailResultResponseList=new ArrayList<>(); + SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(filterOrderDetailResultRequest.getTemplateId()); + //打印单号标签 + Map data = new HashMap<>(1); + List list = new ArrayList<>(); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");//定义新的日期格式 + + //按选入打印 + if(filterOrderDetailResultRequest.getList() != null && filterOrderDetailResultRequest.getList().size()>0){ + ioOrderDetailResultResponseList =filterOrderDetailResultRequest.getList(); + }else{ + //按查询打印 + FilterOrderRequest filterOrderRequest = new FilterOrderRequest(); + filterOrderRequest.setVueType(filterOrderDetailResultRequest.getActionType()); + List actions = orderService.setActions(filterOrderRequest); + if (CollUtil.isEmpty(actions)) { + return ResultVOUtils.success(""); + } + filterOrderDetailResultRequest.setActions(actions); + ioOrderDetailResultResponseList = orderDetailResultService.filterOrderList(filterOrderDetailResultRequest); + for (IoOrderDetailResultResponse orderDetailResultResponse : ioOrderDetailResultResponseList) { + if (orderDetailResultResponse.getMainAction().equals(ConstantType.TYPE_OUT)) { + orderDetailResultResponse.setOutCount(orderDetailResultResponse.getReCount()); + orderDetailResultResponse.setInCount(0); + } else { + orderDetailResultResponse.setOutCount(0); + orderDetailResultResponse.setInCount(orderDetailResultResponse.getReCount()); + } + } + } + int i=1; + for (IoOrderDetailResultResponse ioOrderDetailResultResponse : ioOrderDetailResultResponseList) { + //组装数据 + Map ioOrderDetailResultData = new HashMap<>(); + ioOrderDetailResultData.put("index", String.valueOf(i)); + ioOrderDetailResultData.put("nameCode", ioOrderDetailResultResponse.getNameCode() == null ? ' ' : ioOrderDetailResultResponse.getNameCode()); + ioOrderDetailResultData.put("batchNo", ioOrderDetailResultResponse.getBatchNo() == null ? ' ' : ioOrderDetailResultResponse.getBatchNo()); + ioOrderDetailResultData.put("productDate", ioOrderDetailResultResponse.getProductDate() == null ? ' ' : ioOrderDetailResultResponse.getProductDate()); + ioOrderDetailResultData.put("expireDate", ioOrderDetailResultResponse.getExpireDate() == null ? ' ' : ioOrderDetailResultResponse.getExpireDate()); + ioOrderDetailResultData.put("coName", ioOrderDetailResultResponse.getCoName() == null ? ' ' : ioOrderDetailResultResponse.getCoName()); + ioOrderDetailResultData.put("certCode", ioOrderDetailResultResponse.getCertCode() == null ? ' ' : ioOrderDetailResultResponse.getCertCode()); + ioOrderDetailResultData.put("ylqxzcrbarmc", ioOrderDetailResultResponse.getYlqxzcrbarmc() == null ? ' ' : ioOrderDetailResultResponse.getYlqxzcrbarmc()); + ioOrderDetailResultData.put("manufacturer", ioOrderDetailResultResponse.getManufacturer() == null ? ' ' : ioOrderDetailResultResponse.getManufacturer()); + ioOrderDetailResultData.put("measname", ioOrderDetailResultResponse.getMeasname() == null ? ' ' : ioOrderDetailResultResponse.getMeasname()); + ioOrderDetailResultData.put("spec", ioOrderDetailResultResponse.getSpec() == null ? ' ' : ioOrderDetailResultResponse.getSpec()); + ioOrderDetailResultData.put("price", ioOrderDetailResultResponse.getPrice() == null ? ' ' : ioOrderDetailResultResponse.getPrice()); + ioOrderDetailResultData.put("count", ioOrderDetailResultResponse.getCount()); + ioOrderDetailResultData.put("reCount",ioOrderDetailResultResponse.getReCount()); + ioOrderDetailResultData.put("inCount", ioOrderDetailResultResponse.getInCount()); + ioOrderDetailResultData.put("acceptCount", ioOrderDetailResultResponse.getAcceptCount()); + ioOrderDetailResultData.put("fromCorpName", ioOrderDetailResultResponse.getFromCorpName() == null ? ' ' : ioOrderDetailResultResponse.getFromCorpName()); + ioOrderDetailResultData.put("billTypeName", ioOrderDetailResultResponse.getBillTypeName() == null ? ' ' : ioOrderDetailResultResponse.getBillTypeName()); + ioOrderDetailResultData.put("mainAction", ioOrderDetailResultResponse.getMainAction() == null ? ' ' : ioOrderDetailResultResponse.getMainAction()); + ioOrderDetailResultData.put("auditTime", ioOrderDetailResultResponse.getAuditTime() == null ? ' ' : formatter.format(ioOrderDetailResultResponse.getAuditTime())); + list.add(ioOrderDetailResultData); + i++; + } + + String param = JSON.toJSONString(list); + JasperUtils.jasperReport(request, response, param, filePath+"pdf/template/"+systemPDFTemplateEntity.getPath(), "pdf"); + return ResultVOUtils.success(); + } + + } diff --git a/src/main/java/com/glxp/api/req/inout/FilterOrderDetailResultRequest.java b/src/main/java/com/glxp/api/req/inout/FilterOrderDetailResultRequest.java index 700c315c0..208f0af26 100644 --- a/src/main/java/com/glxp/api/req/inout/FilterOrderDetailResultRequest.java +++ b/src/main/java/com/glxp/api/req/inout/FilterOrderDetailResultRequest.java @@ -1,5 +1,6 @@ package com.glxp.api.req.inout; +import com.glxp.api.res.inout.IoOrderDetailResultResponse; import com.glxp.api.util.page.ListPageRequest; import lombok.Data; @@ -45,5 +46,7 @@ public class FilterOrderDetailResultRequest extends ListPageRequest { private String actionType; private String manufacturer; private String zczbhhzbapzbh; + private String templateId; private List actions; + private List list; } From 0c3aa052fb89a5408cc85ca06a92f64424307b13 Mon Sep 17 00:00:00 2001 From: wj <1285151836@qq.com> Date: Mon, 15 May 2023 14:50:24 +0800 Subject: [PATCH 38/48] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/glxp/api/common/enums/ResultEnum.java | 2 +- src/main/java/com/glxp/api/common/util/ResultVOUtils.java | 2 +- src/main/java/com/glxp/api/config/Knife4jConfiguration.java | 6 ++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/glxp/api/common/enums/ResultEnum.java b/src/main/java/com/glxp/api/common/enums/ResultEnum.java index 7889eef6c..f19fc0ed6 100644 --- a/src/main/java/com/glxp/api/common/enums/ResultEnum.java +++ b/src/main/java/com/glxp/api/common/enums/ResultEnum.java @@ -8,7 +8,7 @@ import lombok.Getter; @Getter public enum ResultEnum { - SUCCESS(0, "success"), + SUCCESS(20000, "success"), NOT_NETWORK(1, "系统繁忙,请稍后再试。"), LOGIN_VERIFY_FALL(2, "登录失效"), PARAM_VERIFY_FALL(3, "参数验证错误"), diff --git a/src/main/java/com/glxp/api/common/util/ResultVOUtils.java b/src/main/java/com/glxp/api/common/util/ResultVOUtils.java index f9d6a1f72..2f89f2866 100644 --- a/src/main/java/com/glxp/api/common/util/ResultVOUtils.java +++ b/src/main/java/com/glxp/api/common/util/ResultVOUtils.java @@ -21,7 +21,7 @@ public class ResultVOUtils { */ public static BaseResponse success(Object data) { BaseResponse baseResponse = new BaseResponse<>(); - baseResponse.setCode(20000); + baseResponse.setCode(ResultEnum.SUCCESS.getCode()); baseResponse.setMessage("success"); baseResponse.setData(data); return baseResponse; diff --git a/src/main/java/com/glxp/api/config/Knife4jConfiguration.java b/src/main/java/com/glxp/api/config/Knife4jConfiguration.java index 3b7d48c1c..6a4958f5c 100644 --- a/src/main/java/com/glxp/api/config/Knife4jConfiguration.java +++ b/src/main/java/com/glxp/api/config/Knife4jConfiguration.java @@ -1,9 +1,9 @@ package com.glxp.api.config; -import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.PathSelectors; import springfox.documentation.builders.RequestHandlerSelectors; @@ -11,12 +11,11 @@ import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; +@Profile({"dev","test"}) @Configuration @EnableSwagger2WebMvc public class Knife4jConfiguration { - @Value("${knife4j.enable:false}") - private boolean enable; @Bean(value = "defaultApi2") public Docket defaultApi2() { @@ -26,7 +25,6 @@ public class Knife4jConfiguration { .description("UDI管理系统后台 - APIS") .version("1.0") .build()) - .enable(enable) .select() //这里指定Controller扫描包路径 .apis(RequestHandlerSelectors.basePackage("com.glxp.api.controller")) From fd5aca89d9bb2ccd20bc677486e6dccb066b5b92 Mon Sep 17 00:00:00 2001 From: wj <1285151836@qq.com> Date: Mon, 15 May 2023 14:51:14 +0800 Subject: [PATCH 39/48] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/glxp/api/config/Knife4jConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/glxp/api/config/Knife4jConfiguration.java b/src/main/java/com/glxp/api/config/Knife4jConfiguration.java index 6a4958f5c..e90d2ce85 100644 --- a/src/main/java/com/glxp/api/config/Knife4jConfiguration.java +++ b/src/main/java/com/glxp/api/config/Knife4jConfiguration.java @@ -1,6 +1,7 @@ package com.glxp.api.config; +import com.glxp.api.common.enums.ResultEnum; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; @@ -16,7 +17,6 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; @EnableSwagger2WebMvc public class Knife4jConfiguration { - @Bean(value = "defaultApi2") public Docket defaultApi2() { Docket docket = new Docket(DocumentationType.SWAGGER_2) From b517963a084849f8437bbbb7e4d70e919f913273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Mon, 15 May 2023 15:33:07 +0800 Subject: [PATCH 40/48] =?UTF-8?q?=E5=86=85=E9=83=A8=E7=A0=81=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E6=89=93=E5=8D=B0=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inv/InvInnerOrderPrintController.java | 105 ++++++++++++++++-- 1 file changed, 98 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/inv/InvInnerOrderPrintController.java b/src/main/java/com/glxp/api/controller/inv/InvInnerOrderPrintController.java index 307894371..9e281291e 100644 --- a/src/main/java/com/glxp/api/controller/inv/InvInnerOrderPrintController.java +++ b/src/main/java/com/glxp/api/controller/inv/InvInnerOrderPrintController.java @@ -1,5 +1,6 @@ package com.glxp.api.controller.inv; +import com.alibaba.fastjson.JSON; import com.github.pagehelper.PageInfo; import com.glxp.api.annotation.AuthRuleAnnotation; import com.glxp.api.annotation.Log; @@ -12,6 +13,7 @@ import com.glxp.api.entity.inv.InnerOrderEntity; import com.glxp.api.entity.inv.InvInnerOrderPdfTempEntity; import com.glxp.api.entity.inv.InvInnerOrderPrintEntity; import com.glxp.api.entity.system.SysPdfTemplateRelevanceLabelEntity; +import com.glxp.api.entity.system.SysPdfTemplateRelevanceStatemenEntity; import com.glxp.api.entity.system.SystemPDFTemplateEntity; import com.glxp.api.req.inout.InspectionPDFTemplateRequest; import com.glxp.api.req.inv.*; @@ -186,34 +188,34 @@ public class InvInnerOrderPrintController { } else { Map data = new HashMap(); data.put("data", printEntities); - JasperUtils.jasperReport(request, response, data, filePath + "/pdf/template/"+systemPDFTemplateEntity.getPath(), "pdf"); + JasperUtils.jasperReport(request, response, data, filePath + "/pdf/template/" + systemPDFTemplateEntity.getPath(), "pdf"); } - String orderId=""; + String orderId = ""; for (InnerOrderPrintResponse InnerOrderPrintResponse : mStockPrintEntities) { InvInnerOrderPrintEntity innerOrderPrintEntity = new InvInnerOrderPrintEntity(); innerOrderPrintEntity.setStatus(1); innerOrderPrintEntity.setId(InnerOrderPrintResponse.getId()); invInnerOrderPrintService.updateOrder(innerOrderPrintEntity); - orderId=InnerOrderPrintResponse.getId()+""; + orderId = InnerOrderPrintResponse.getId() + ""; } //查询订单id - InvInnerOrderPrintEntity innerOrderPrintEntity=invInnerOrderPrintService.selectById(orderId); + InvInnerOrderPrintEntity innerOrderPrintEntity = invInnerOrderPrintService.selectById(orderId); //更新内部码状态 - InnerOrderEntity innerOrderEntity=innerOrderService.findByRecordKey(innerOrderPrintEntity.getOrderIdFk()); - if(innerOrderEntity!=null){ + InnerOrderEntity innerOrderEntity = innerOrderService.findByRecordKey(innerOrderPrintEntity.getOrderIdFk()); + if (innerOrderEntity != null) { innerOrderEntity.setGenStatus(2); innerOrderEntity.setId(innerOrderEntity.getId()); innerOrderService.update(innerOrderEntity); } - IoOrderEntity ioOrderEntity=new IoOrderEntity(); + IoOrderEntity ioOrderEntity = new IoOrderEntity(); ioOrderEntity.setInCodeStatus(1); ioOrderEntity.setBillNo(innerOrderPrintEntity.getOrderIdFk()); ioOrderService.updateByBillNo(ioOrderEntity); @@ -221,6 +223,95 @@ public class InvInnerOrderPrintController { } + + //-----------打印码 + @AuthRuleAnnotation("") + @PostMapping("/udiwms/pdf/template/inspection/stock/qrcode/text/statement/file") + public BaseResponse inspectionStockQRCodeTextPDFFromTemplateStatementFile( + @RequestBody InspectionPDFTemplateRequest inspectionPDFTemplateRequest) throws Exception { + + //查询模板文件是否存在 + SysPdfTemplateRelevanceStatemenEntity sysPdfTemplateRelevanceStatemenEntity = systemPDFModuleService.selectByStatemenId(inspectionPDFTemplateRequest.getLabelId()+""); + if (null == sysPdfTemplateRelevanceStatemenEntity) { + return ResultVOUtils.error(ResultEnum.DATA_NOT, "所属模块错误"); + } + + SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(String.valueOf(sysPdfTemplateRelevanceStatemenEntity.getTemplateId())); + if (null == systemPDFTemplateEntity) { + return ResultVOUtils.error(ResultEnum.DATA_NOT, "模板错误"); + } + return ResultVOUtils.success(sysPdfTemplateRelevanceStatemenEntity.getTemplateId()); + } + + @AuthRuleAnnotation("") + @PostMapping("/udiwms/pdf/template/stock/qrcode/text/statement/file") + public BaseResponse stockQRCodeTextPDFFromTemplateStatementFile( + @RequestBody InnerOrderQRCodeTextPDFTemplateRequest stockQRCodeTextPDFTemplateRequest, + HttpServletRequest request, HttpServletResponse response) throws Exception { + + SysPdfTemplateRelevanceStatemenEntity sysPdfTemplateRelevanceStatemenEntity = systemPDFModuleService.selectByStatemenId(stockQRCodeTextPDFTemplateRequest.getLabelId()+""); + if (sysPdfTemplateRelevanceStatemenEntity == null) return ResultVOUtils.error(500, "未找到单据模板模块设置,请检查"); + + SystemPDFTemplateEntity systemPDFTemplateEntity = + systemPDFTemplateService.selectById(String.valueOf(sysPdfTemplateRelevanceStatemenEntity.getTemplateId())); + if (systemPDFTemplateEntity == null) return ResultVOUtils.error(ResultEnum.DATA_NOT, "模板错误"); + + List printEntities = new ArrayList<>(); + List mStockPrintEntities = new ArrayList<>(); + FilterinnerOrderprintRequest filterinnerOrderprintRequest = new FilterinnerOrderprintRequest(); + if (stockQRCodeTextPDFTemplateRequest.getOrderId() != null) { + filterinnerOrderprintRequest.setSOrderId(stockQRCodeTextPDFTemplateRequest.getOrderId()); + } else { + filterinnerOrderprintRequest.setId(stockQRCodeTextPDFTemplateRequest.getQueryId()); + } + List stockPrintEntities = invInnerOrderPrintService.filterJoinInnerPrint(filterinnerOrderprintRequest); + if (stockPrintEntities != null && stockPrintEntities.size() > 0) { + mStockPrintEntities.addAll(stockPrintEntities); + } + for (InnerOrderPrintResponse InnerOrderPrintResponse : mStockPrintEntities) { + PdfPrintCountEntity pdfPrintCount = getCount(stockQRCodeTextPDFTemplateRequest.getCountList(), InnerOrderPrintResponse); + if (pdfPrintCount != null && pdfPrintCount.getRowCount() > 0) { + for (int i = 0; i < pdfPrintCount.getRowCount(); i++) { + InnerOrderPrintResponse clone = new InnerOrderPrintResponse(); + BeanUtils.copyProperties(InnerOrderPrintResponse, clone); + printEntities.add(clone); + } + } else { + printEntities.add(InnerOrderPrintResponse); + } + } + + + String param = JSON.toJSONString(printEntities); + JasperUtils.jasperReport(request, response, param, filePath + "/pdf/template/" + systemPDFTemplateEntity.getPath(), "pdf"); + + String orderId = ""; + for (InnerOrderPrintResponse InnerOrderPrintResponse : mStockPrintEntities) { + InvInnerOrderPrintEntity innerOrderPrintEntity = new InvInnerOrderPrintEntity(); + innerOrderPrintEntity.setStatus(1); + innerOrderPrintEntity.setId(InnerOrderPrintResponse.getId()); + invInnerOrderPrintService.updateOrder(innerOrderPrintEntity); + orderId = InnerOrderPrintResponse.getId() + ""; + } + + //查询订单id + InvInnerOrderPrintEntity innerOrderPrintEntity = invInnerOrderPrintService.selectById(orderId); + //更新内部码状态 + InnerOrderEntity innerOrderEntity = innerOrderService.findByRecordKey(innerOrderPrintEntity.getOrderIdFk()); + if (innerOrderEntity != null) { + innerOrderEntity.setGenStatus(2); + innerOrderEntity.setId(innerOrderEntity.getId()); + innerOrderService.update(innerOrderEntity); + } + IoOrderEntity ioOrderEntity = new IoOrderEntity(); + ioOrderEntity.setInCodeStatus(1); + ioOrderEntity.setBillNo(innerOrderPrintEntity.getOrderIdFk()); + ioOrderService.updateByBillNo(ioOrderEntity); + return null; + + } + + public PdfPrintCountEntity getCount(List countList, InnerOrderPrintResponse InnerOrderPrintResponse) { for (PdfPrintCountEntity pdfPrintCount : countList) { if (pdfPrintCount.getQueryId().equals(InnerOrderPrintResponse.getId() + "")) { From d166dd09d79ec809d931802bb17acf8390f02149 Mon Sep 17 00:00:00 2001 From: anthonywj Date: Mon, 15 May 2023 16:28:11 +0800 Subject: [PATCH 41/48] =?UTF-8?q?=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=8C=89=E4=BE=9B=E5=BA=94=E5=95=86=E5=88=9B=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/entity/purchase/PurOrderEntity.java | 3 + .../api/res/purchase/PurOrderResponse.java | 2 + .../mybatis/mapper/purchase/PurOrderDao.xml | 184 +++++++++--------- 3 files changed, 99 insertions(+), 90 deletions(-) diff --git a/src/main/java/com/glxp/api/entity/purchase/PurOrderEntity.java b/src/main/java/com/glxp/api/entity/purchase/PurOrderEntity.java index 1c725d34c..573a981c9 100644 --- a/src/main/java/com/glxp/api/entity/purchase/PurOrderEntity.java +++ b/src/main/java/com/glxp/api/entity/purchase/PurOrderEntity.java @@ -132,6 +132,9 @@ public class PurOrderEntity { @TableField(value = "emergency") private Integer emergency; + @TableField(value = "supId") + private String supId; + /** * 是否已生成采购计划 */ diff --git a/src/main/java/com/glxp/api/res/purchase/PurOrderResponse.java b/src/main/java/com/glxp/api/res/purchase/PurOrderResponse.java index 1e3ce05c6..01be33715 100644 --- a/src/main/java/com/glxp/api/res/purchase/PurOrderResponse.java +++ b/src/main/java/com/glxp/api/res/purchase/PurOrderResponse.java @@ -73,4 +73,6 @@ public class PurOrderResponse { private String auditUserName; private Integer emergency; private Date arrivalTime; + private String supId; + private String supName; } diff --git a/src/main/resources/mybatis/mapper/purchase/PurOrderDao.xml b/src/main/resources/mybatis/mapper/purchase/PurOrderDao.xml index 7501b5a37..2679e956b 100644 --- a/src/main/resources/mybatis/mapper/purchase/PurOrderDao.xml +++ b/src/main/resources/mybatis/mapper/purchase/PurOrderDao.xml @@ -1,97 +1,101 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - id, billNo, billDate, `status`, billType, remark, invCode, deptCode, `createUser`, - createTime, auditUser, auditTime, auditRemark, updateTime, updateUser, applyCreateUser, - applyAuditUser, applyRemark, applyBillNo, stockOrderNo - + + + + + + + + + + + + + + + + + + + + + + + + + + + id, billNo, billDate, `status`, billType, remark, invCode, deptCode, `createUser`, + createTime, auditUser, auditTime, auditRemark, updateTime, updateUser, applyCreateUser, + applyAuditUser, applyRemark, applyBillNo, stockOrderNo + - - + From 4b917f22fdd13f4e036d98f21f13196302477654 Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Mon, 15 May 2023 17:59:20 +0800 Subject: [PATCH 42/48] =?UTF-8?q?=E5=86=B7=E9=93=BE=E6=8A=A5=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inout/IoOrderDetailBizController.java | 21 ++++++++++++++++++- .../entity/inout/IoOrderDetailBizEntity.java | 9 ++++++++ .../res/inout/IoOrderDetailBizResponse.java | 5 +++++ src/main/resources/schemas/schema_v2.1.sql | 6 ++++++ 4 files changed, 40 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java index 225d616aa..1c09557ad 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java @@ -591,11 +591,30 @@ public class IoOrderDetailBizController extends BaseController { @PostMapping("/udiwms/inout/biz/updateById") @Log(title = "发票管理", businessType = BusinessType.UPDATE) public BaseResponse deleteById(@RequestBody IoOrderInvoiceRequest ioOrderInvoiceRequest) { - + IoOrderEntity orderEntity = orderService.findByBillNo(ioOrderInvoiceRequest.getOrderIdFk()); + if (orderEntity != null) { + orderEntity.setUpdateTime(new Date()); + orderService.update(orderEntity); + } return ResultVOUtils.success(ioOrderInvoiceService.updateByInvId(ioOrderInvoiceRequest)); } + @PostMapping("/udiwms/inout/bizDetail/updateById") + @Log(title = "发票管理", businessType = BusinessType.UPDATE) + public BaseResponse updateBizById(@RequestBody IoOrderDetailBizEntity ioOrderDetailBizEntity) { + IoOrderEntity orderEntity = orderService.findByBillNo(ioOrderDetailBizEntity.getOrderIdFk()); + if (orderEntity != null) { + orderEntity.setUpdateTime(new Date()); + orderService.update(orderEntity); + } + ioOrderDetailBizEntity.setCheckFileName(ioOrderDetailBizEntity.getFilePath()); + ioOrderDetailBizEntity.setCheckColdFileName(ioOrderDetailBizEntity.getColdFilePath()); + boolean b = orderDetailBizService.updateOrderDetailBiz(ioOrderDetailBizEntity); + return ResultVOUtils.success("修改成功!"); + } + + @PostMapping("/udiwms/inout/biz/insertInvoice") @Log(title = "发票管理", businessType = BusinessType.INSERT) diff --git a/src/main/java/com/glxp/api/entity/inout/IoOrderDetailBizEntity.java b/src/main/java/com/glxp/api/entity/inout/IoOrderDetailBizEntity.java index e0ad1e9b4..79128e31d 100644 --- a/src/main/java/com/glxp/api/entity/inout/IoOrderDetailBizEntity.java +++ b/src/main/java/com/glxp/api/entity/inout/IoOrderDetailBizEntity.java @@ -179,12 +179,21 @@ public class IoOrderDetailBizEntity { @TableField(value = "filePath") private String filePath; + @TableField(value = "coldFilePath") + private String coldFilePath; + /** * 检验报告名称 */ @TableField(value = "checkFileName") private String checkFileName; + /** + * 冷链报告名称 + */ + @TableField(value = "checkColdFileName") + private String checkColdFileName; + @TableField(exist = false) private boolean checkSuccess; diff --git a/src/main/java/com/glxp/api/res/inout/IoOrderDetailBizResponse.java b/src/main/java/com/glxp/api/res/inout/IoOrderDetailBizResponse.java index cee26d94e..8f79efd2a 100644 --- a/src/main/java/com/glxp/api/res/inout/IoOrderDetailBizResponse.java +++ b/src/main/java/com/glxp/api/res/inout/IoOrderDetailBizResponse.java @@ -167,6 +167,11 @@ public class IoOrderDetailBizResponse { private boolean regStatus; + private String coldFilePath; + + private String checkColdFileName; + + diff --git a/src/main/resources/schemas/schema_v2.1.sql b/src/main/resources/schemas/schema_v2.1.sql index c0d242e0c..a08100bc1 100644 --- a/src/main/resources/schemas/schema_v2.1.sql +++ b/src/main/resources/schemas/schema_v2.1.sql @@ -37,6 +37,12 @@ CALL Pro_Temp_ColumnWork('thr_system_bus_api', 'thirdBuyName', 'varchar(255) ', CALL Pro_Temp_ColumnWork('io_order_detail_biz', 'bindRlIds', 'varchar(255) ', 1); CALL Pro_Temp_ColumnWork('io_order_detail_biz', 'checkFileName', 'varchar(255) ', 1); + + +CALL Pro_Temp_ColumnWork('io_order_detail_biz', 'coldFilePath', 'varchar(255)', 1); + +CALL Pro_Temp_ColumnWork('io_order_detail_biz', 'checkColdFileName', 'varchar(255)', 1); + CALL Pro_Temp_ColumnWork('io_order_invoice', 'bizIdFk', 'int ', 1); CALL Pro_Temp_ColumnWork('thr_products', 'updateUser', 'varchar(255) ', 1); From aaff1b1d7f3a31b80c72043285e224f2a4faa16a Mon Sep 17 00:00:00 2001 From: anthonywj Date: Mon, 15 May 2023 20:45:19 +0800 Subject: [PATCH 43/48] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E7=B9=81=E5=BF=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inout/IoOrderInvoiceController.java | 2 +- .../mapper/inout/InvUserProductDao.xml | 9 +++-- .../mapper/inout/IoOrderDetailBizDao.xml | 34 ++++++++++--------- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderInvoiceController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderInvoiceController.java index 3a4e50908..a22eed8d1 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderInvoiceController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderInvoiceController.java @@ -39,7 +39,7 @@ public class IoOrderInvoiceController { @AuthRuleAnnotation("") @PostMapping("/udiwms/inout/order/refrshInvoice") @Log(title = "发票", businessType = BusinessType.INSERT) - public BaseResponse addBizProduct(@RequestBody RefreshInoiceRequest refreshInoiceRequest) { + public BaseResponse refrshInvoice(@RequestBody RefreshInoiceRequest refreshInoiceRequest) { BaseResponse baseResponse = spGetHttpClient.getIoOrderInvoices(refreshInoiceRequest); if (baseResponse.getCode() == 20000) { RefreshInoiceResponse refreshInoiceResponse = baseResponse.getData(); diff --git a/src/main/resources/mybatis/mapper/inout/InvUserProductDao.xml b/src/main/resources/mybatis/mapper/inout/InvUserProductDao.xml index 2984b40cd..45072669e 100644 --- a/src/main/resources/mybatis/mapper/inout/InvUserProductDao.xml +++ b/src/main/resources/mybatis/mapper/inout/InvUserProductDao.xml @@ -13,11 +13,11 @@ diff --git a/src/main/resources/mybatis/mapper/inout/IoOrderDetailBizDao.xml b/src/main/resources/mybatis/mapper/inout/IoOrderDetailBizDao.xml index bc473e0ab..3519d3172 100644 --- a/src/main/resources/mybatis/mapper/inout/IoOrderDetailBizDao.xml +++ b/src/main/resources/mybatis/mapper/inout/IoOrderDetailBizDao.xml @@ -4,8 +4,8 @@ - + select * + from io_order_invoice + where id = #{id} - SELECT ic.*, - (select cpmctymc from basic_products where basic_products.uuid = bu.uuid) cpmctymc, - (select ggxh from basic_products where basic_products.uuid = bu.uuid) ggxh + bp.cpmctymc, + bp.ggxh FROM io_order_invoice ic - LEFT JOIN basic_udirel bu ON bu.id = ic.bindRlFk - LEFT JOIN basic_products bp ON bu.uuid = bp.uuid + LEFT JOIN basic_udirel bu ON bu.id = ic.bindRlFk + LEFT JOIN basic_products bp ON bu.uuid = bp.uuid AND ic.orderIdFk = #{orderIdFk} @@ -77,13 +79,13 @@ AND (ic.batchNo is null or ic.batchNo = '') - GROUP BY ic.id