From e7e5cac0bb6bf930c83d0c023701630c6ce4cb91 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, 7 Jun 2023 17:08:46 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E9=80=81=E8=B4=A7=E5=8F=91=E7=A5=A8?= =?UTF-8?q?=E7=99=BB=E8=AE=B0=E6=8E=A5=E5=8F=A3=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/inout/IoOrderController.java | 6 +- .../com/glxp/api/dao/inout/IoOrderDao.java | 2 + .../api/dao/inout/IoOrderDetailBizDao.java | 2 + .../inout/IoOrderDetailBizService.java | 2 + .../api/service/inout/IoOrderService.java | 2 + .../impl/IoOrderDetailBizServiceImpl.java | 11 + .../inout/impl/IoOrderServiceImpl.java | 11 + .../mybatis/mapper/inout/IoOrderDao.xml | 235 +++++++++++++++--- .../mapper/inout/IoOrderDetailBizDao.xml | 24 ++ 9 files changed, 250 insertions(+), 45 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 6144db73..b1bbd080 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderController.java @@ -146,7 +146,7 @@ public class IoOrderController extends BaseController { if (!customerId.equals("110")) { filterOrderRequest.setFromCorp(customerId); } - List list = orderService.getfilterList(filterOrderRequest); + List list = orderService.getfilterOrderList(filterOrderRequest); for (IoOrderResponse ioOrderResponse : list) { if (ioOrderResponse.getCheckStatus() == null) { @@ -154,7 +154,7 @@ public class IoOrderController extends BaseController { } FilterOrderDetailCodeRequest filterOrderDetailCodeRequest = new FilterOrderDetailCodeRequest(); filterOrderDetailCodeRequest.setOrderIdFk(ioOrderResponse.getBillNo()); - List ioOrderDetailCodeResponses = orderDetailBizService.getfilterList(filterOrderDetailCodeRequest); + List ioOrderDetailCodeResponses = orderDetailBizService.getfilterOrderList(filterOrderDetailCodeRequest); BigDecimal amount = new BigDecimal(0.00); for (IoOrderDetailCodeResponse ioOrderDetailCodeRespons : ioOrderDetailCodeResponses) { if (ioOrderDetailCodeRespons.getCount() != 0 && ioOrderDetailCodeRespons.getPrice() != null) { @@ -162,8 +162,6 @@ public class IoOrderController extends BaseController { } } ioOrderResponse.setAllAmount(amount); - - } diff --git a/src/main/java/com/glxp/api/dao/inout/IoOrderDao.java b/src/main/java/com/glxp/api/dao/inout/IoOrderDao.java index b2cfe5dc..ad9882b8 100644 --- a/src/main/java/com/glxp/api/dao/inout/IoOrderDao.java +++ b/src/main/java/com/glxp/api/dao/inout/IoOrderDao.java @@ -22,6 +22,8 @@ public interface IoOrderDao extends BaseMapperPlus getfilterList(FilterOrderRequest filterOrderRequest); + List getfilterOrderList(FilterOrderRequest filterOrderRequest); + /** * 查询单据实体列表 * 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 b4e93ab5..d183c89e 100644 --- a/src/main/java/com/glxp/api/dao/inout/IoOrderDetailBizDao.java +++ b/src/main/java/com/glxp/api/dao/inout/IoOrderDetailBizDao.java @@ -23,6 +23,8 @@ public interface IoOrderDetailBizDao extends BaseMapperPlus getfilterList(FilterOrderDetailCodeRequest orderDetailBizRequest); + List getfilterOrderList(FilterOrderDetailCodeRequest orderDetailBizRequest); + List filterListInv(FilterOrderDetailBizRequest orderDetailBizRequest); IoOrderInvoiceResponse selectByinvoiceId(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 a8853daf..c85b5250 100644 --- a/src/main/java/com/glxp/api/service/inout/IoOrderDetailBizService.java +++ b/src/main/java/com/glxp/api/service/inout/IoOrderDetailBizService.java @@ -38,6 +38,8 @@ public interface IoOrderDetailBizService { List getfilterList(FilterOrderDetailCodeRequest orderDetailBizRequest); + List getfilterOrderList(FilterOrderDetailCodeRequest orderDetailBizRequest); + IoOrderDetailBizEntity selectByBatchNoAndBindRlFk(String batchNo, String bindRlFk); List checkOrderList(String orderId); diff --git a/src/main/java/com/glxp/api/service/inout/IoOrderService.java b/src/main/java/com/glxp/api/service/inout/IoOrderService.java index 3c117440..203651bf 100644 --- a/src/main/java/com/glxp/api/service/inout/IoOrderService.java +++ b/src/main/java/com/glxp/api/service/inout/IoOrderService.java @@ -56,6 +56,8 @@ public interface IoOrderService { List getfilterList(FilterOrderRequest filterOrderRequest); + List getfilterOrderList(FilterOrderRequest filterOrderRequest); + /** * 查询单据列表 * 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 1c27807a..70ced51f 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 @@ -132,6 +132,17 @@ public class IoOrderDetailBizServiceImpl implements IoOrderDetailBizService { return ioOrderDetailBizDao.getfilterList(OrderDetailCodeRequest); } + @Override + public List getfilterOrderList(FilterOrderDetailCodeRequest OrderDetailCodeRequest) { + if (null == OrderDetailCodeRequest) { + return Collections.emptyList(); + } + if (null != OrderDetailCodeRequest.getPage() && null != OrderDetailCodeRequest.getLimit()) { + PageHelper.offsetPage((OrderDetailCodeRequest.getPage() - 1) * OrderDetailCodeRequest.getLimit(), OrderDetailCodeRequest.getLimit()); + } + return ioOrderDetailBizDao.getfilterOrderList(OrderDetailCodeRequest); + } + @Override public IoOrderDetailBizEntity selectByBatchNoAndBindRlFk(String batchNo, String bindRlFk) { QueryWrapper ew = new QueryWrapper<>(); 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 b1d62bd0..f75079d0 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 @@ -546,6 +546,17 @@ public class IoOrderServiceImpl implements IoOrderService { return orderDao.getfilterList(filterOrderRequest); } + @Override + public List getfilterOrderList(FilterOrderRequest filterOrderRequest) { + if (null == filterOrderRequest) { + return Collections.emptyList(); + } + if (null != filterOrderRequest.getPage() && null != filterOrderRequest.getLimit()) { + PageHelper.offsetPage((filterOrderRequest.getPage() - 1) * filterOrderRequest.getLimit(), filterOrderRequest.getLimit()); + } + return orderDao.getfilterOrderList(filterOrderRequest); + } + @Override public List filterOrderList(FilterOrderRequest filterOrderRequest) { if (null == filterOrderRequest) { diff --git a/src/main/resources/mybatis/mapper/inout/IoOrderDao.xml b/src/main/resources/mybatis/mapper/inout/IoOrderDao.xml index 0d4bb3f2..fc6e2c55 100644 --- a/src/main/resources/mybatis/mapper/inout/IoOrderDao.xml +++ b/src/main/resources/mybatis/mapper/inout/IoOrderDao.xml @@ -2,85 +2,88 @@ select * from io_order @@ -407,4 +412,152 @@ from io_order where billNo = #{billNo} + + + + + + + + + diff --git a/src/main/resources/mybatis/mapper/inout/IoOrderDetailBizDao.xml b/src/main/resources/mybatis/mapper/inout/IoOrderDetailBizDao.xml index 122998d2..cf3d5258 100644 --- a/src/main/resources/mybatis/mapper/inout/IoOrderDetailBizDao.xml +++ b/src/main/resources/mybatis/mapper/inout/IoOrderDetailBizDao.xml @@ -111,4 +111,28 @@ + + + From d52bb00a184432812096646998360680eb4f9b72 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, 7 Jun 2023 17:28:13 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E9=80=81=E8=B4=A7=E5=8F=91=E7=A5=A8?= =?UTF-8?q?=E7=99=BB=E8=AE=B0=E6=8E=A5=E5=8F=A3=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mybatis/mapper/inout/IoOrderDao.xml | 185 +++++++++--------- 1 file changed, 89 insertions(+), 96 deletions(-) diff --git a/src/main/resources/mybatis/mapper/inout/IoOrderDao.xml b/src/main/resources/mybatis/mapper/inout/IoOrderDao.xml index fc6e2c55..e1e10206 100644 --- a/src/main/resources/mybatis/mapper/inout/IoOrderDao.xml +++ b/src/main/resources/mybatis/mapper/inout/IoOrderDao.xml @@ -2,88 +2,85 @@ - select io.*, - (select name from basic_bussiness_type bus where bus.action = io.action) billTypeName, - (select name from auth_dept ad where ad.code = io.deptCode) deptName, - (select name from auth_warehouse aw where aw.code = io.invCode) invName, - (select employeeName from auth_user au where au.id = io.createUser) createUserName, - (select employeeName from auth_user au2 where au2.id = io.updateUser) updateUserName, - (select employeeName from auth_user au3 where au3.id = io.reviewUser) reviewUserName, - (select employeeName from auth_user au4 where au4.id = io.checkUser) checkUserName, - (select name from auth_dept ad2 where ad2.code = io.fromDeptCode) fromDeptName, - (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_code WHERE io_order_detail_code.orderIdFk = io.billNo - and io_order_detail_code.regStatus = 1 - ) AS allCout, - (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 + SELECT + io.*, + bus.NAME AS billTypeName, + ad.NAME AS deptName, + aw.NAME AS invName, + bc.NAME AS fromCorpName, + COUNT(IF(dc.regStatus = 1, 1, NULL)) AS allCount, + COUNT(IF(dc.regStatus = 0, 1, NULL)) AS partCount + FROM + io_order io + LEFT JOIN basic_bussiness_type bus ON io.action = bus.action + LEFT JOIN auth_dept ad ON io.deptCode = ad.CODE + LEFT JOIN auth_warehouse aw ON io.invCode = aw.CODE + LEFT JOIN basic_corp bc ON io.fromCorp = bc.erpId + LEFT JOIN io_order_detail_code dc ON io.billNo = dc.orderIdFk - AND id = #{id} + AND io.id = #{id} AND (SELECT NAME FROM auth_warehouse aw2 WHERE aw2.CODE = io.fromInvCode) like concat('%', #{corpName}, '%') - AND action = #{action} + AND io.action = #{action} - AND mainAction = #{mainAction} + AND io.mainAction = #{mainAction} - AND billNo like concat('%', #{billNo}, '%') + AND io.billNo like concat('%', #{billNo}, '%') - AND corpOrderId = #{corpOrderId} + AND io.corpOrderId = #{corpOrderId} - AND fromCorp = #{fromCorp} + AND io.fromCorp = #{fromCorp} - AND deptCode = #{deptCode} + AND io.deptCode = #{deptCode} - AND invCode = #{invCode} + AND io.invCode = #{invCode} - AND busType = #{busType} + AND io.busType = #{busType} - AND inCodeStatus = #{inCodeStatus} + AND io.inCodeStatus = #{inCodeStatus} - AND relKey = #{relKey} + AND io.relKey = #{relKey} - AND date_format(createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d') + AND date_format(io.createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d') - AND date_format(auditTime, '%Y-%m-%d') between date_format(#{startAduditTime}, '%Y-%m-%d') and date_format(#{endAduditTime}, '%Y-%m-%d') + AND date_format(io.auditTime, '%Y-%m-%d') between date_format(#{startAduditTime}, '%Y-%m-%d') and date_format(#{endAduditTime}, '%Y-%m-%d') - AND `action` in + AND io.`action` in #{item} - AND fromType in + AND io.fromType in #{item} - AND status in + AND io.status in #{item} - AND dealStatus in + AND io.dealStatus in #{item} @@ -511,48 +503,49 @@ - AND status = #{status} + AND io.status = #{status} - AND orderType = #{orderType} + AND io.orderType = #{orderType} - AND (`action` in + AND (io.`action` in #{item} - and status = 10) + and io.status = 10) and ( - `action` in + io.`action` in #{item} - and status = 7 + and io.status = 7 ) - AND ((`action` in + AND ((io.`action` in #{item} - and status = 10) + and io.status = 10) or ( - `action` in + io.`action` in #{item} - and status = 7) + and io.status = 7) ) - order by createTime desc + GROUP BY io.id + order by io.createTime desc From 79df891647d8104f397ac205a119e2f5f43bedc4 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, 7 Jun 2023 18:01:55 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E9=80=81=E8=B4=A7=E5=8F=91=E7=A5=A8?= =?UTF-8?q?=E7=99=BB=E8=AE=B0=E6=8E=A5=E5=8F=A3=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/mybatis/mapper/inout/IoOrderDao.xml | 2 +- .../mybatis/mapper/inout/IoOrderDetailBizDao.xml | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/resources/mybatis/mapper/inout/IoOrderDao.xml b/src/main/resources/mybatis/mapper/inout/IoOrderDao.xml index e1e10206..f7b8142f 100644 --- a/src/main/resources/mybatis/mapper/inout/IoOrderDao.xml +++ b/src/main/resources/mybatis/mapper/inout/IoOrderDao.xml @@ -417,7 +417,7 @@ ad.NAME AS deptName, aw.NAME AS invName, bc.NAME AS fromCorpName, - COUNT(IF(dc.regStatus = 1, 1, NULL)) AS allCount, + COUNT(IF(dc.regStatus = 1, 1, NULL)) AS allCout, COUNT(IF(dc.regStatus = 0, 1, NULL)) AS partCount FROM io_order io diff --git a/src/main/resources/mybatis/mapper/inout/IoOrderDetailBizDao.xml b/src/main/resources/mybatis/mapper/inout/IoOrderDetailBizDao.xml index cf3d5258..6da20521 100644 --- a/src/main/resources/mybatis/mapper/inout/IoOrderDetailBizDao.xml +++ b/src/main/resources/mybatis/mapper/inout/IoOrderDetailBizDao.xml @@ -50,12 +50,10 @@ @@ -331,7 +330,7 @@ ]]> - order by createTime desc + @@ -545,7 +544,15 @@ GROUP BY io.id - order by io.createTime desc + + + order by ${orderBy} ${sort} + + + order by updateTime desc + + + diff --git a/src/main/resources/mybatis/mapper/purchase/PurOrderDao.xml b/src/main/resources/mybatis/mapper/purchase/PurOrderDao.xml index acf4c3d0..d7e487e0 100644 --- a/src/main/resources/mybatis/mapper/purchase/PurOrderDao.xml +++ b/src/main/resources/mybatis/mapper/purchase/PurOrderDao.xml @@ -102,5 +102,14 @@ AND createUser = #{createUser} + + + order by ${orderBy} ${sort} + + + order by pur_order.updateTime desc + + + From 8733e63cd57871d6db9549593976fb11b4cae22b Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Thu, 8 Jun 2023 10:10:06 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/controller/inout/IoOrderDetailBizController.java | 5 ++++- .../java/com/glxp/api/entity/inout/IoOrderInvoiceEntity.java | 2 +- 2 files changed, 5 insertions(+), 2 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 8d995a24..73df7af8 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java @@ -575,6 +575,7 @@ public class IoOrderDetailBizController extends BaseController { FilterOrderDetailBizRequest filterOrderDetailBizRequest = new FilterOrderDetailBizRequest(); filterOrderDetailBizRequest.setOrderIdFk(ioOrderInvoiceEntity.getOrderIdFk()); + filterOrderDetailBizRequest.setBatchNo(ioOrderInvoiceEntity.getBatchNo()); ioOrderDetailBizEntity.setOrderIdFk(ioOrderInvoiceEntity.getOrderIdFk()); @@ -583,9 +584,11 @@ public class IoOrderDetailBizController extends BaseController { List list = orderDetailBizService.filterListInv(filterOrderDetailBizRequest); if (list.size() == 0) { ioOrderDetailBizEntity.setRegStatus(false); + }else{ + ioOrderDetailBizEntity.setRegStatus(true); } orderDetailCodeService.updateOrderDetailBiz(ioOrderDetailBizEntity); - return ResultVOUtils.success(); + return ResultVOUtils.success(list); } 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 adca1dd9..c7eacf2d 100644 --- a/src/main/java/com/glxp/api/entity/inout/IoOrderInvoiceEntity.java +++ b/src/main/java/com/glxp/api/entity/inout/IoOrderInvoiceEntity.java @@ -109,7 +109,7 @@ public class IoOrderInvoiceEntity { private Long bizIdFk; @TableField(exist = false) - private Integer regId; + private Long regId; @TableField(exist = false)