From 83697b44bd8962b858c08d17de616132a8d7782e Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Mon, 8 May 2023 10:06:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=91=E7=A5=A8bug=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=87=91=E9=A2=9D=20=E6=80=BB=E9=87=91?= =?UTF-8?q?=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/inout/IoOrderController.java | 18 ++++++++ .../inout/IoOrderDetailBizController.java | 42 ++++++++++--------- .../api/dao/inout/IoOrderDetailBizDao.java | 4 +- .../entity/inout/IoOrderDetailCodeEntity.java | 4 ++ .../inout/FilterOrderDetailCodeRequest.java | 3 ++ .../res/inout/IoOrderDetailCodeResponse.java | 9 ++++ .../glxp/api/res/inout/IoOrderResponse.java | 4 ++ .../inout/IoOrderDetailBizService.java | 4 +- .../inout/IoOrderDetailCodeService.java | 4 ++ .../impl/IoOrderDetailBizServiceImpl.java | 12 +++--- .../impl/IoOrderDetailCodeServiceImpl.java | 6 +++ .../mybatis/mapper/inout/IoOrderDao.xml | 8 ++-- .../mapper/inout/IoOrderDetailBizDao.xml | 12 +++--- src/main/resources/schemas/schema_v2.1.sql | 9 ++-- 14 files changed, 98 insertions(+), 41 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 a4657eca..976bfbad 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderController.java @@ -21,6 +21,7 @@ import com.glxp.api.req.inout.*; import com.glxp.api.req.system.DeleteRequest; import com.glxp.api.res.PageSimpleResponse; import com.glxp.api.res.inout.IoOrderDetailBizResponse; +import com.glxp.api.res.inout.IoOrderDetailCodeResponse; import com.glxp.api.res.inout.IoOrderResponse; import com.glxp.api.res.inout.PdaBusOrderResponse; import com.glxp.api.service.auth.InvBusUserService; @@ -36,6 +37,7 @@ import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -134,6 +136,22 @@ public class IoOrderController extends BaseController { } List list = orderService.getfilterList(filterOrderRequest); + for (IoOrderResponse ioOrderResponse : list) { + FilterOrderDetailCodeRequest filterOrderDetailCodeRequest = new FilterOrderDetailCodeRequest(); + filterOrderDetailCodeRequest.setOrderIdFk(ioOrderResponse.getBillNo()); + List ioOrderDetailCodeResponses = orderDetailBizService.getfilterList(filterOrderDetailCodeRequest); + BigDecimal amount=new BigDecimal(0.00); + for (IoOrderDetailCodeResponse ioOrderDetailCodeRespons : ioOrderDetailCodeResponses) { + if(ioOrderDetailCodeRespons.getCount() != 0) { + amount = amount.add(new BigDecimal(ioOrderDetailCodeRespons.getCount()).multiply(ioOrderDetailCodeRespons.getPrice())); + } + } + ioOrderResponse.setAllAmount(amount); + + + } + + PageInfo pageInfo = new PageInfo<>(list); return ResultVOUtils.page(pageInfo); } 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 6e81a8d1..dff2e539 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java @@ -32,6 +32,7 @@ import com.glxp.api.req.thrsys.FilterThrOrderDetailRequest; import com.glxp.api.res.PageSimpleResponse; import com.glxp.api.res.basic.UdiRelevanceResponse; import com.glxp.api.res.inout.IoOrderDetailBizResponse; +import com.glxp.api.res.inout.IoOrderDetailCodeResponse; import com.glxp.api.res.inout.IoOrderInvoiceResponse; import com.glxp.api.service.auth.InvWarehouseService; import com.glxp.api.service.basic.*; @@ -513,14 +514,14 @@ public class IoOrderDetailBizController extends BaseController { return ResultVOUtils.page(pageInfo); } - @GetMapping("/udiwms/inout/bizDetail/filterListInv") - public BaseResponse filterListInv(FilterOrderDetailBizRequest orderDetailBizRequest) { - List list = orderDetailBizService.getfilterList(orderDetailBizRequest); - List orderDetailCodeEntities = orderDetailCodeService.findByOrderId(orderDetailBizRequest.getOrderIdFk()); - ioCheckInoutService.bizOrderCheck2(list, orderDetailCodeEntities); - PageInfo pageInfo = new PageInfo<>(list); - return ResultVOUtils.page(pageInfo); - } +// @GetMapping("/udiwms/inout/bizDetail/filterListInv") +// public BaseResponse filterListInv(FilterOrderDetailBizRequest orderDetailBizRequest) { +// List list = orderDetailBizService.getfilterList(orderDetailBizRequest); +// List orderDetailCodeEntities = orderDetailCodeService.findByOrderId(orderDetailBizRequest.getOrderIdFk()); +// ioCheckInoutService.bizOrderCheck2(list, orderDetailCodeEntities); +// PageInfo pageInfo = new PageInfo<>(list); +// return ResultVOUtils.page(pageInfo); +// } @GetMapping("/udiwms/inout/bizDetail/filterListInvoice") public BaseResponse filterListInvoice(FilterOrderDetailBizRequest orderDetailBizRequest) { @@ -561,7 +562,7 @@ public class IoOrderDetailBizController extends BaseController { ioOrderInvoiceService.deleteByInvId(ioOrderInvoiceEntity.getId()+""); //更改 登记状态 - IoOrderDetailBizEntity ioOrderDetailBizEntity = new IoOrderDetailBizEntity(); + IoOrderDetailCodeEntity ioOrderDetailBizEntity = new IoOrderDetailCodeEntity(); FilterOrderDetailBizRequest filterOrderDetailBizRequest = new FilterOrderDetailBizRequest(); @@ -575,7 +576,7 @@ public class IoOrderDetailBizController extends BaseController { if(list == null && list.size()==0){ ioOrderDetailBizEntity.setRegStatus(false); } - orderDetailBizService.updateOrderDetailBiz(ioOrderDetailBizEntity); + orderDetailCodeService.updateOrderDetailBiz(ioOrderDetailBizEntity); return ResultVOUtils.success(); @@ -627,10 +628,10 @@ public class IoOrderDetailBizController extends BaseController { } @PostMapping("/udiwms/inout/biz/updateorderBiz") - public BaseResponse updateorderBiz(@RequestBody List list) { - for (IoOrderDetailBizEntity ioOrderDetailBizEntity : list) { + public BaseResponse updateorderBiz(@RequestBody List list) { + for (IoOrderDetailCodeEntity ioOrderDetailBizEntity : list) { ioOrderDetailBizEntity.setRegStatus(true); - orderDetailBizService.updateOrderDetailBiz(ioOrderDetailBizEntity); + orderDetailCodeService.updateOrderDetailBiz(ioOrderDetailBizEntity); } return ResultVOUtils.success("成功"); @@ -645,13 +646,14 @@ public class IoOrderDetailBizController extends BaseController { * @return */ @GetMapping("/udiwms/inout/bizDetail/filterBizOrderList") - public BaseResponse filterBizOrderList(FilterOrderDetailBizRequest orderDetailBizRequest) { - List list = orderDetailBizService.getfilterList(orderDetailBizRequest); - for (IoOrderDetailBizResponse ioOrderDetailBizResponse : list) { + public BaseResponse filterBizOrderList(FilterOrderDetailCodeRequest orderDetailBizRequest) { + List ioOrderDetailCodeResponses = orderDetailBizService.getfilterList(orderDetailBizRequest); + for (IoOrderDetailCodeResponse ioOrderDetailCodeRespons : ioOrderDetailCodeResponses) { + ioOrderDetailCodeRespons.setAmount(new BigDecimal(ioOrderDetailCodeRespons.getCount()).multiply(ioOrderDetailCodeRespons.getPrice())); String msg = ""; IoOrderInvoiceRequest ioOrderInvoiceEntity = new IoOrderInvoiceRequest(); - ioOrderInvoiceEntity.setOrderIdFk(ioOrderDetailBizResponse.getOrderIdFk()); - ioOrderInvoiceEntity.setBizIdFk(ioOrderDetailBizResponse.getId()); + ioOrderInvoiceEntity.setOrderIdFk(ioOrderDetailCodeRespons.getOrderIdFk()); + ioOrderInvoiceEntity.setBizIdFk(ioOrderDetailCodeRespons.getId()); List ioOrderInvoiceEntityList = ioOrderInvoiceService.selectOrderInvoice(ioOrderInvoiceEntity); for (IoOrderInvoiceEntity obj : ioOrderInvoiceEntityList) { if (StrUtil.isNotEmpty(obj.getInvoiceEncode())) { @@ -661,9 +663,9 @@ public class IoOrderDetailBizController extends BaseController { if (msg.length() > 1) { msg = msg.substring(1); } - ioOrderDetailBizResponse.setInvoiceCodes(msg); + ioOrderDetailCodeRespons.setInvoiceCodes(msg); } - PageInfo pageInfo = new PageInfo<>(list); + PageInfo pageInfo = new PageInfo<>(ioOrderDetailCodeResponses); return ResultVOUtils.page(pageInfo); } diff --git a/src/main/java/com/glxp/api/dao/inout/IoOrderDetailBizDao.java b/src/main/java/com/glxp/api/dao/inout/IoOrderDetailBizDao.java index 18688e93..2d5cceb1 100644 --- a/src/main/java/com/glxp/api/dao/inout/IoOrderDetailBizDao.java +++ b/src/main/java/com/glxp/api/dao/inout/IoOrderDetailBizDao.java @@ -3,7 +3,9 @@ package com.glxp.api.dao.inout; import com.glxp.api.dao.BaseMapperPlus; import com.glxp.api.entity.inout.IoOrderDetailBizEntity; import com.glxp.api.req.inout.FilterOrderDetailBizRequest; +import com.glxp.api.req.inout.FilterOrderDetailCodeRequest; import com.glxp.api.res.inout.IoOrderDetailBizResponse; +import com.glxp.api.res.inout.IoOrderDetailCodeResponse; import com.glxp.api.res.inout.IoOrderInvoiceResponse; import org.apache.ibatis.annotations.Param; @@ -19,7 +21,7 @@ public interface IoOrderDetailBizDao extends BaseMapperPlus filterList(FilterOrderDetailBizRequest orderDetailBizRequest); - List getfilterList(FilterOrderDetailBizRequest orderDetailBizRequest); + List getfilterList(FilterOrderDetailCodeRequest orderDetailBizRequest); List filterListInv(FilterOrderDetailBizRequest orderDetailBizRequest); 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 56e83867..36bb9008 100644 --- a/src/main/java/com/glxp/api/entity/inout/IoOrderDetailCodeEntity.java +++ b/src/main/java/com/glxp/api/entity/inout/IoOrderDetailCodeEntity.java @@ -191,5 +191,9 @@ public class IoOrderDetailCodeEntity { @TableField(exist = false) private String errMsg; + @TableField(value = "regStatus") + private boolean regStatus; + + } diff --git a/src/main/java/com/glxp/api/req/inout/FilterOrderDetailCodeRequest.java b/src/main/java/com/glxp/api/req/inout/FilterOrderDetailCodeRequest.java index 97980221..6e5d2edb 100644 --- a/src/main/java/com/glxp/api/req/inout/FilterOrderDetailCodeRequest.java +++ b/src/main/java/com/glxp/api/req/inout/FilterOrderDetailCodeRequest.java @@ -8,6 +8,7 @@ import lombok.Data; */ @Data public class FilterOrderDetailCodeRequest extends ListPageRequest { + private Long relId; /** * 单据号 @@ -39,4 +40,6 @@ public class FilterOrderDetailCodeRequest extends ListPageRequest { */ private String productName; + private Long bizIdFk; + } 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 fc054081..06963fcd 100644 --- a/src/main/java/com/glxp/api/res/inout/IoOrderDetailCodeResponse.java +++ b/src/main/java/com/glxp/api/res/inout/IoOrderDetailCodeResponse.java @@ -162,4 +162,13 @@ public class IoOrderDetailCodeResponse { private int orderCount; + private String invoiceCodes; + + private Integer sucCount; + + private boolean regStatus; + + //金额 + private BigDecimal amount; + } diff --git a/src/main/java/com/glxp/api/res/inout/IoOrderResponse.java b/src/main/java/com/glxp/api/res/inout/IoOrderResponse.java index f9ee6dd5..165dd73f 100644 --- a/src/main/java/com/glxp/api/res/inout/IoOrderResponse.java +++ b/src/main/java/com/glxp/api/res/inout/IoOrderResponse.java @@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.math.BigDecimal; import java.util.Date; @Data @@ -236,6 +237,9 @@ public class IoOrderResponse { private Integer partCount; + //总金额 + private BigDecimal allAmount; + /** 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 bbeb3681..12879fad 100644 --- a/src/main/java/com/glxp/api/service/inout/IoOrderDetailBizService.java +++ b/src/main/java/com/glxp/api/service/inout/IoOrderDetailBizService.java @@ -2,7 +2,9 @@ package com.glxp.api.service.inout; import com.glxp.api.entity.inout.IoOrderDetailBizEntity; import com.glxp.api.req.inout.FilterOrderDetailBizRequest; +import com.glxp.api.req.inout.FilterOrderDetailCodeRequest; import com.glxp.api.res.inout.IoOrderDetailBizResponse; +import com.glxp.api.res.inout.IoOrderDetailCodeResponse; import com.glxp.api.res.inout.IoOrderInvoiceResponse; import java.util.List; @@ -34,7 +36,7 @@ public interface IoOrderDetailBizService { List filterList(FilterOrderDetailBizRequest orderDetailBizRequest); - List getfilterList(FilterOrderDetailBizRequest orderDetailBizRequest); + List getfilterList(FilterOrderDetailCodeRequest orderDetailBizRequest); IoOrderDetailBizEntity selectByBatchNoAndBindRlFk(String batchNo, String bindRlFk); 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 b475649f..c7747a5c 100644 --- a/src/main/java/com/glxp/api/service/inout/IoOrderDetailCodeService.java +++ b/src/main/java/com/glxp/api/service/inout/IoOrderDetailCodeService.java @@ -1,5 +1,6 @@ package com.glxp.api.service.inout; +import com.glxp.api.entity.inout.IoOrderDetailBizEntity; import com.glxp.api.entity.inout.IoOrderDetailCodeEntity; import com.glxp.api.req.inout.FilterOrderDetailCodeRequest; import com.glxp.api.res.inout.IoOrderDetailCodeResponse; @@ -47,4 +48,7 @@ public interface IoOrderDetailCodeService { * @return */ List getDetailCodeResponse(List orderEntityList); + + Boolean updateOrderDetailBiz(IoOrderDetailCodeEntity orderDetailCodeEntity); + } 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 1b802e98..2e8d29aa 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 @@ -10,7 +10,9 @@ 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.FilterOrderDetailBizRequest; +import com.glxp.api.req.inout.FilterOrderDetailCodeRequest; import com.glxp.api.res.inout.IoOrderDetailBizResponse; +import com.glxp.api.res.inout.IoOrderDetailCodeResponse; import com.glxp.api.res.inout.IoOrderInvoiceResponse; import com.glxp.api.service.inout.IoCheckInoutService; import com.glxp.api.service.inout.IoOrderDetailBizService; @@ -118,14 +120,14 @@ public class IoOrderDetailBizServiceImpl implements IoOrderDetailBizService { } @Override - public List getfilterList(FilterOrderDetailBizRequest orderDetailBizRequest) { - if (null == orderDetailBizRequest) { + public List getfilterList(FilterOrderDetailCodeRequest OrderDetailCodeRequest) { + if (null == OrderDetailCodeRequest) { return Collections.emptyList(); } - if (null != orderDetailBizRequest.getPage() && null != orderDetailBizRequest.getLimit()) { - PageHelper.offsetPage((orderDetailBizRequest.getPage() - 1) * orderDetailBizRequest.getLimit(), orderDetailBizRequest.getLimit()); + if (null != OrderDetailCodeRequest.getPage() && null != OrderDetailCodeRequest.getLimit()) { + PageHelper.offsetPage((OrderDetailCodeRequest.getPage() - 1) * OrderDetailCodeRequest.getLimit(), OrderDetailCodeRequest.getLimit()); } - return ioOrderDetailBizDao.getfilterList(orderDetailBizRequest); + return ioOrderDetailBizDao.getfilterList(OrderDetailCodeRequest); } @Override 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 b7937cd2..071c6071 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 @@ -115,4 +115,10 @@ public class IoOrderDetailCodeServiceImpl implements IoOrderDetailCodeService { } return list; } + + @Override + public Boolean updateOrderDetailBiz(IoOrderDetailCodeEntity orderDetailCodeEntity) { + return ioOrderDetailCodeDao.updateById(orderDetailCodeEntity)>0; + } + } diff --git a/src/main/resources/mybatis/mapper/inout/IoOrderDao.xml b/src/main/resources/mybatis/mapper/inout/IoOrderDao.xml index 36a7a47b..0d4bb3f2 100644 --- a/src/main/resources/mybatis/mapper/inout/IoOrderDao.xml +++ b/src/main/resources/mybatis/mapper/inout/IoOrderDao.xml @@ -149,11 +149,11 @@ (select name from auth_warehouse aw2 where aw2.code = io.fromInvCode) fromInvName, (select name from basic_corp bc where bc.erpId = io.fromCorp) fromCorpName, (select name from basic_corp bc where bc.erpId = io.customerId) customerName, - (SELECT count(*) FROM io_order_detail_biz WHERE io_order_detail_biz.orderIdFk = io.billNo - and io_order_detail_biz.regStatus = 1 + (SELECT count(*) FROM io_order_detail_code WHERE io_order_detail_code.orderIdFk = io.billNo + and io_order_detail_code.regStatus = 1 ) AS allCout, - (SELECT count(*) FROM io_order_detail_biz WHERE io_order_detail_biz.orderIdFk = io.billNo - and io_order_detail_biz.regStatus = 0 + (SELECT count(*) FROM io_order_detail_code WHERE io_order_detail_code.orderIdFk = io.billNo + and io_order_detail_code.regStatus = 0 ) As partCount from io_order as io diff --git a/src/main/resources/mybatis/mapper/inout/IoOrderDetailBizDao.xml b/src/main/resources/mybatis/mapper/inout/IoOrderDetailBizDao.xml index aa1104ae..0404938d 100644 --- a/src/main/resources/mybatis/mapper/inout/IoOrderDetailBizDao.xml +++ b/src/main/resources/mybatis/mapper/inout/IoOrderDetailBizDao.xml @@ -23,13 +23,13 @@ group by io_order_detail_biz.id - + select io_order_detail_code.*, (select count(*) FROM io_order_invoice - where io_order_invoice.orderIdFk = io_order_detail_biz.orderIdFk) as sucCount - from io_order_detail_biz - left join basic_udirel bu on bu.id = io_order_detail_biz.bindRlFk + where io_order_invoice.orderIdFk = io_order_detail_code.orderIdFk) as sucCount + from io_order_detail_code + left join basic_udirel bu on bu.id = io_order_detail_code.bindRlFk left join basic_products bp on bu.uuid = bp.uuid @@ -45,7 +45,7 @@ AND bp.cpmctymc like concat('%', #{productName}, '%') - group by io_order_detail_biz.id + group by io_order_detail_code.id diff --git a/src/main/resources/schemas/schema_v2.1.sql b/src/main/resources/schemas/schema_v2.1.sql index 5df05c4b..0ec61d89 100644 --- a/src/main/resources/schemas/schema_v2.1.sql +++ b/src/main/resources/schemas/schema_v2.1.sql @@ -35,7 +35,6 @@ CALL Pro_Temp_ColumnWork('io_order', 'checkTime', 'datetime ', 1); CALL Pro_Temp_ColumnWork('io_order', 'checkUser', 'varchar(255) ', 1); CALL Pro_Temp_ColumnWork('io_order', 'regStatus', 'varchar(255) ', 1); -CALL Pro_Temp_ColumnWork('io_order_detail_biz', 'regStatus', 'varchar(255) ', 1); @@ -351,9 +350,6 @@ CALL Pro_Temp_ColumnWork('thr_inv_warehouse', 'id', 'bigint', 2); CALL Pro_Temp_ColumnWork('thr_products', 'id', 'bigint', 2); CALL Pro_Temp_ColumnWork('thr_corp', 'id', 'bigint', 2); - -CALL Pro_Temp_ColumnWork('auth_dept_user', 'userId', 'bigint', 2); -CALL Pro_Temp_ColumnWork('auth_dept_user', 'deptId', 'bigint', 2); CALL Pro_Temp_ColumnWork('basic_bustype_pre', 'Id', 'bigint', 2); CALL Pro_Temp_ColumnWork('basic_export_status', 'remark', 'varchar(2048)', 2); CALL Pro_Temp_ColumnWork('auth_role', 'isCustomer', 'int', 1); @@ -367,4 +363,9 @@ CALL Pro_Temp_ColumnWork('sync_data_set', 'orderInvoice', 'tinyint', 1); CALL Pro_Temp_ColumnWork('io_order_invoice', 'id', 'bigint ', 2); +CALL Pro_Temp_ColumnWork('io_order_detail_code', 'regStatus', 'varchar(255) ', 1); + + + +