From e4864f67e456549cab8680074cc513a61d92498b Mon Sep 17 00:00:00 2001 From: anthonywj Date: Tue, 9 May 2023 09:05:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E6=8D=AE=E8=AF=A6=E6=83=85=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E9=9B=AA=E8=8A=B1ID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inout/IoOrderDetailBizController.java | 39 +++++++++---------- .../entity/inout/IoOrderDetailBizEntity.java | 8 ++-- .../entity/inout/IoOrderDetailCodeEntity.java | 4 +- .../entity/inout/IoOrderInvoiceEntity.java | 4 +- .../api/req/inout/BizBindUpdateRequest.java | 2 +- .../api/req/inout/IoOrderInvoiceRequest.java | 2 +- .../res/inout/IoOrderDetailBizResponse.java | 2 +- .../res/inout/IoOrderDetailCodeResponse.java | 2 +- .../inout/IoOrderDetailBizService.java | 6 +-- .../inout/IoOrderDetailCodeService.java | 2 +- .../impl/IoOrderDetailBizServiceImpl.java | 10 +++-- .../impl/IoOrderDetailCodeServiceImpl.java | 9 +++-- src/main/resources/schemas/schema_v2.1.sql | 7 +++- 13 files changed, 51 insertions(+), 46 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 a5de90da..9eca7837 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java @@ -483,8 +483,8 @@ public class IoOrderDetailBizController extends BaseController { @PostMapping("/udiwms/inout/order/delBizProduct") @Log(title = "单据管理", businessType = BusinessType.DELETE) public BaseResponse delBizProduct(@RequestBody DeleteRequest deleteRequest) { - IoOrderDetailBizEntity orderDetailBizEntity = orderDetailBizService.selectById(Integer.parseInt(deleteRequest.getId())); - int result = orderDetailBizService.deleteById(Integer.parseInt(deleteRequest.getId())); + IoOrderDetailBizEntity orderDetailBizEntity = orderDetailBizService.selectById(Long.parseLong(deleteRequest.getId())); + int result = orderDetailBizService.deleteById(Long.parseLong(deleteRequest.getId())); if (result > 0) { boolean r1 = orderDetailBizService.isExit(orderDetailBizEntity.getOrderIdFk()); boolean r2 = orderDetailCodeService.isExit(orderDetailBizEntity.getOrderIdFk()); @@ -572,18 +572,16 @@ public class IoOrderDetailBizController extends BaseController { ioOrderDetailBizEntity.setOrderIdFk(ioOrderInvoiceEntity.getOrderIdFk()); - ioOrderDetailBizEntity.setId(ioOrderInvoiceResponse.getBizIdFk().intValue()); - - ioOrderInvoiceService.deleteByInvId(ioOrderInvoiceEntity.getId()+""); + ioOrderDetailBizEntity.setId(ioOrderInvoiceResponse.getBizIdFk().longValue()); + ioOrderInvoiceService.deleteByInvId(ioOrderInvoiceEntity.getId() + ""); List list = orderDetailBizService.filterListInv(filterOrderDetailBizRequest); - if(list.size()==0){ + if (list.size() == 0) { ioOrderDetailBizEntity.setRegStatus(false); } orderDetailCodeService.updateOrderDetailBiz(ioOrderDetailBizEntity); return ResultVOUtils.success(); - } /** @@ -607,16 +605,16 @@ public class IoOrderDetailBizController extends BaseController { public BaseResponse insertInvoice(@RequestBody IoOrderInvoiceEntity ioOrderInvoice) { for (IoOrderDetailBizEntity ioOrderDetailBizEntity : ioOrderInvoice.getList()) { - IoOrderInvoiceEntity ioOrderInvoiceEntity = new IoOrderInvoiceEntity(); - ioOrderInvoiceEntity.setOrderIdFk(ioOrderDetailBizEntity.getOrderIdFk()); - ioOrderInvoiceEntity.setBindRlFk(ioOrderDetailBizEntity.getBindRlFk() + ""); - ioOrderInvoiceEntity.setBatchNo(ioOrderDetailBizEntity.getBatchNo()); - ioOrderInvoiceEntity.setProductDate(ioOrderDetailBizEntity.getProductDate()); - ioOrderInvoiceEntity.setExpireDate(ioOrderDetailBizEntity.getExpireDate()); - ioOrderInvoiceEntity.setBizIdFk(ioOrderDetailBizEntity.getId()); - ioOrderInvoiceEntity.setCreateTime(new Date()); - ioOrderInvoiceEntity.setUpdateTime(new Date()); - ioOrderInvoiceEntity.setId(IdUtil.getSnowflakeNextId()); + IoOrderInvoiceEntity ioOrderInvoiceEntity = new IoOrderInvoiceEntity(); + ioOrderInvoiceEntity.setOrderIdFk(ioOrderDetailBizEntity.getOrderIdFk()); + ioOrderInvoiceEntity.setBindRlFk(ioOrderDetailBizEntity.getBindRlFk() + ""); + ioOrderInvoiceEntity.setBatchNo(ioOrderDetailBizEntity.getBatchNo()); + ioOrderInvoiceEntity.setProductDate(ioOrderDetailBizEntity.getProductDate()); + ioOrderInvoiceEntity.setExpireDate(ioOrderDetailBizEntity.getExpireDate()); + ioOrderInvoiceEntity.setBizIdFk(ioOrderDetailBizEntity.getId()); + ioOrderInvoiceEntity.setCreateTime(new Date()); + ioOrderInvoiceEntity.setUpdateTime(new Date()); + ioOrderInvoiceEntity.setId(IdUtil.getSnowflakeNextId()); ioOrderInvoiceEntity.setMachineNo(ioOrderInvoice.getMachineNo()); ioOrderInvoiceEntity.setInvoiceCode(ioOrderInvoice.getInvoiceCode()); ioOrderInvoiceEntity.setInvoiceEncode(ioOrderInvoice.getInvoiceEncode()); @@ -624,14 +622,14 @@ public class IoOrderDetailBizController extends BaseController { ioOrderInvoiceEntity.setPrice(ioOrderInvoice.getPrice()); ioOrderInvoiceEntity.setRemark(ioOrderInvoice.getRemark()); ioOrderInvoiceEntity.setLicenseUrl(ioOrderInvoice.getLicenseUrl()); - boolean b = ioOrderInvoiceService.insertInvoice(ioOrderInvoiceEntity); + boolean b = ioOrderInvoiceService.insertInvoice(ioOrderInvoiceEntity); } return ResultVOUtils.success("成功"); } @PostMapping("/udiwms/inout/biz/updateorderBiz") - public BaseResponse updateorderBiz(@RequestBody List list) { + public BaseResponse updateorderBiz(@RequestBody List list) { for (IoOrderDetailCodeEntity ioOrderDetailBizEntity : list) { ioOrderDetailBizEntity.setRegStatus(true); orderDetailCodeService.updateOrderDetailBiz(ioOrderDetailBizEntity); @@ -641,7 +639,6 @@ public class IoOrderDetailBizController extends BaseController { } - /** * 查询单据业务详情列表 * @@ -652,7 +649,7 @@ public class IoOrderDetailBizController extends BaseController { public BaseResponse filterBizOrderList(FilterOrderDetailCodeRequest orderDetailBizRequest) { List ioOrderDetailCodeResponses = orderDetailBizService.getfilterList(orderDetailBizRequest); for (IoOrderDetailCodeResponse ioOrderDetailCodeRespons : ioOrderDetailCodeResponses) { - if(ioOrderDetailCodeRespons.getCount() != 0 && ioOrderDetailCodeRespons.getPrice()!=null ) { + if (ioOrderDetailCodeRespons.getCount() != 0 && ioOrderDetailCodeRespons.getPrice() != null) { ioOrderDetailCodeRespons.setAmount(new BigDecimal(ioOrderDetailCodeRespons.getCount()).multiply(ioOrderDetailCodeRespons.getPrice())); } String msg = ""; 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 6e3afc18..f2bb0ca6 100644 --- a/src/main/java/com/glxp/api/entity/inout/IoOrderDetailBizEntity.java +++ b/src/main/java/com/glxp/api/entity/inout/IoOrderDetailBizEntity.java @@ -9,8 +9,8 @@ import java.util.List; @Data @TableName(value = "io_order_detail_biz") public class IoOrderDetailBizEntity { - @TableId(value = "id", type = IdType.AUTO) - private Integer id; + @TableId(value = "id", type = IdType.INPUT) + private Long id; /** * 订单号外键 @@ -93,7 +93,7 @@ public class IoOrderDetailBizEntity { /** * 价格 */ - @TableField(value = "price",fill = FieldFill.UPDATE) + @TableField(value = "price", fill = FieldFill.UPDATE) private BigDecimal price; /** @@ -187,7 +187,6 @@ public class IoOrderDetailBizEntity { private String checkFileName; - @TableField(exist = false) private boolean checkSuccess; @@ -202,5 +201,4 @@ public class IoOrderDetailBizEntity { private boolean regStatus; - } diff --git a/src/main/java/com/glxp/api/entity/inout/IoOrderDetailCodeEntity.java b/src/main/java/com/glxp/api/entity/inout/IoOrderDetailCodeEntity.java index 2f7635e1..b92d17d8 100644 --- a/src/main/java/com/glxp/api/entity/inout/IoOrderDetailCodeEntity.java +++ b/src/main/java/com/glxp/api/entity/inout/IoOrderDetailCodeEntity.java @@ -11,8 +11,8 @@ import java.math.BigDecimal; @Data @TableName(value = "io_order_detail_code") public class IoOrderDetailCodeEntity { - @TableId(value = "id", type = IdType.AUTO) - private Integer id; + @TableId(value = "id", type = IdType.INPUT) + private Long id; /** * 订单号外键 diff --git a/src/main/java/com/glxp/api/entity/inout/IoOrderInvoiceEntity.java b/src/main/java/com/glxp/api/entity/inout/IoOrderInvoiceEntity.java index 5087c26b..adca1dd9 100644 --- a/src/main/java/com/glxp/api/entity/inout/IoOrderInvoiceEntity.java +++ b/src/main/java/com/glxp/api/entity/inout/IoOrderInvoiceEntity.java @@ -106,10 +106,10 @@ public class IoOrderInvoiceEntity { private String remark; @TableField(value = "bizIdFk") - private Integer bizIdFk; + private Long bizIdFk; @TableField(exist = false) - private Integer regId; + private Integer regId; @TableField(exist = false) diff --git a/src/main/java/com/glxp/api/req/inout/BizBindUpdateRequest.java b/src/main/java/com/glxp/api/req/inout/BizBindUpdateRequest.java index 43710c4b..722386dc 100644 --- a/src/main/java/com/glxp/api/req/inout/BizBindUpdateRequest.java +++ b/src/main/java/com/glxp/api/req/inout/BizBindUpdateRequest.java @@ -5,7 +5,7 @@ import lombok.Data; @Data public class BizBindUpdateRequest { - private Integer id; + private Long id; private Long bindRlFk; private String supId; diff --git a/src/main/java/com/glxp/api/req/inout/IoOrderInvoiceRequest.java b/src/main/java/com/glxp/api/req/inout/IoOrderInvoiceRequest.java index 5e0ddb7b..07ee07cc 100644 --- a/src/main/java/com/glxp/api/req/inout/IoOrderInvoiceRequest.java +++ b/src/main/java/com/glxp/api/req/inout/IoOrderInvoiceRequest.java @@ -67,7 +67,7 @@ public class IoOrderInvoiceRequest { private String remark; - private Integer bizIdFk; + private Long bizIdFk; public static final String COL_ID = "id"; 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 2af0db85..2d908e88 100644 --- a/src/main/java/com/glxp/api/res/inout/IoOrderDetailBizResponse.java +++ b/src/main/java/com/glxp/api/res/inout/IoOrderDetailBizResponse.java @@ -10,7 +10,7 @@ import java.math.BigDecimal; @Data public class IoOrderDetailBizResponse { - private Integer id; + private Long id; /** * 订单号外键 diff --git a/src/main/java/com/glxp/api/res/inout/IoOrderDetailCodeResponse.java b/src/main/java/com/glxp/api/res/inout/IoOrderDetailCodeResponse.java index 06963fcd..5ec35663 100644 --- a/src/main/java/com/glxp/api/res/inout/IoOrderDetailCodeResponse.java +++ b/src/main/java/com/glxp/api/res/inout/IoOrderDetailCodeResponse.java @@ -11,7 +11,7 @@ import java.math.BigDecimal; @Data public class IoOrderDetailCodeResponse { - private Integer id; + private Long id; /** * 订单号外键 diff --git a/src/main/java/com/glxp/api/service/inout/IoOrderDetailBizService.java b/src/main/java/com/glxp/api/service/inout/IoOrderDetailBizService.java index 7d96ecf1..a8853daf 100644 --- a/src/main/java/com/glxp/api/service/inout/IoOrderDetailBizService.java +++ b/src/main/java/com/glxp/api/service/inout/IoOrderDetailBizService.java @@ -12,7 +12,7 @@ import java.util.List; public interface IoOrderDetailBizService { - IoOrderDetailBizEntity selectById(Integer id); + IoOrderDetailBizEntity selectById(Long id); List findByOrderId(String orderId); @@ -22,13 +22,13 @@ public interface IoOrderDetailBizService { int update(IoOrderDetailBizEntity orderDetailBizEntity); - int deleteById(Integer id); + int deleteById(Long id); int deleteByOrderId(String billNo); boolean isExit(String billNo); - boolean isExit(Long relId, String bacthNo, Integer ignoreId, String orderId); + boolean isExit(Long relId, String bacthNo, Long ignoreId, String orderId); IoOrderDetailBizEntity findByUnique(String orderId, Long relId, String bacthNo, String productDate, String expireDate); diff --git a/src/main/java/com/glxp/api/service/inout/IoOrderDetailCodeService.java b/src/main/java/com/glxp/api/service/inout/IoOrderDetailCodeService.java index c7747a5c..d1294be9 100644 --- a/src/main/java/com/glxp/api/service/inout/IoOrderDetailCodeService.java +++ b/src/main/java/com/glxp/api/service/inout/IoOrderDetailCodeService.java @@ -19,7 +19,7 @@ public interface IoOrderDetailCodeService { int update(IoOrderDetailCodeEntity orderDetailCodeEntity); - int deleteById(Integer id); + int deleteById(Long id); /** * 查询单据扫码详情VO列表 diff --git a/src/main/java/com/glxp/api/service/inout/impl/IoOrderDetailBizServiceImpl.java b/src/main/java/com/glxp/api/service/inout/impl/IoOrderDetailBizServiceImpl.java index f24865ca..1c27807a 100644 --- a/src/main/java/com/glxp/api/service/inout/impl/IoOrderDetailBizServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inout/impl/IoOrderDetailBizServiceImpl.java @@ -1,6 +1,7 @@ package com.glxp.api.service.inout.impl; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.github.pagehelper.PageHelper; @@ -34,7 +35,7 @@ public class IoOrderDetailBizServiceImpl implements IoOrderDetailBizService { IoOrderDetailBizDao ioOrderDetailBizDao; @Override - public IoOrderDetailBizEntity selectById(Integer id) { + public IoOrderDetailBizEntity selectById(Long id) { return ioOrderDetailBizDao.selectById(id); } @@ -59,7 +60,8 @@ public class IoOrderDetailBizServiceImpl implements IoOrderDetailBizService { @Override public int insert(IoOrderDetailBizEntity orderDetailBizEntity) { - orderDetailBizEntity.setId(null); + if (orderDetailBizEntity.getId() == null) + orderDetailBizEntity.setId(IdUtil.getSnowflakeNextId()); return ioOrderDetailBizDao.insert(orderDetailBizEntity); } @@ -69,7 +71,7 @@ public class IoOrderDetailBizServiceImpl implements IoOrderDetailBizService { } @Override - public int deleteById(Integer id) { + public int deleteById(Long id) { return ioOrderDetailBizDao.deleteById(id); } @@ -87,7 +89,7 @@ public class IoOrderDetailBizServiceImpl implements IoOrderDetailBizService { @Override - public boolean isExit(Long relId, String bacthNo, Integer ignoreId, String orderId) { + public boolean isExit(Long relId, String bacthNo, Long ignoreId, String orderId) { return ioOrderDetailBizDao.exists(new QueryWrapper().eq("bindRlFk", relId).eq(StrUtil.isNotEmpty(bacthNo), "batchNo", bacthNo) .isNull(StrUtil.isEmpty(bacthNo), "batchNo").eq("orderIdFk", orderId).ne("id", ignoreId)); } diff --git a/src/main/java/com/glxp/api/service/inout/impl/IoOrderDetailCodeServiceImpl.java b/src/main/java/com/glxp/api/service/inout/impl/IoOrderDetailCodeServiceImpl.java index 071c6071..07b00d69 100644 --- a/src/main/java/com/glxp/api/service/inout/impl/IoOrderDetailCodeServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inout/impl/IoOrderDetailCodeServiceImpl.java @@ -2,6 +2,7 @@ package com.glxp.api.service.inout.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; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.github.pagehelper.PageHelper; @@ -55,7 +56,9 @@ public class IoOrderDetailCodeServiceImpl implements IoOrderDetailCodeService { @Override public int insert(IoOrderDetailCodeEntity orderDetailCodeEntity) { - orderDetailCodeEntity.setId(null); + if (orderDetailCodeEntity.getId() == null) { + orderDetailCodeEntity.setId(IdUtil.getSnowflakeNextId()); + } return ioOrderDetailCodeDao.insert(orderDetailCodeEntity); } @@ -65,7 +68,7 @@ public class IoOrderDetailCodeServiceImpl implements IoOrderDetailCodeService { } @Override - public int deleteById(Integer id) { + public int deleteById(Long id) { return ioOrderDetailCodeDao.deleteById(id); } @@ -118,7 +121,7 @@ public class IoOrderDetailCodeServiceImpl implements IoOrderDetailCodeService { @Override public Boolean updateOrderDetailBiz(IoOrderDetailCodeEntity orderDetailCodeEntity) { - return ioOrderDetailCodeDao.updateById(orderDetailCodeEntity)>0; + return ioOrderDetailCodeDao.updateById(orderDetailCodeEntity) > 0; } } diff --git a/src/main/resources/schemas/schema_v2.1.sql b/src/main/resources/schemas/schema_v2.1.sql index 636f59da..c46b149b 100644 --- a/src/main/resources/schemas/schema_v2.1.sql +++ b/src/main/resources/schemas/schema_v2.1.sql @@ -37,7 +37,6 @@ CALL Pro_Temp_ColumnWork('io_order', 'regStatus', 'varchar(255) ', 1); - CALL Pro_Temp_ColumnWork('io_code_lost', 'nameCode', 'varchar(255) ', 1); CALL Pro_Temp_ColumnWork('thr_bustype_origin', 'thirdSysName', 'varchar(255) ', 3); @@ -372,4 +371,10 @@ 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); + + + +