From 80ca3204d5fa1f8ec0ea7d7555612f92814ae757 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=AD=E5=87=AF=E5=87=AF?= Date: Mon, 25 Nov 2024 16:46:32 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=8C=82=E8=B4=A6?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=9B=B8=E5=85=B3=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../booking/TbShopTableBookingController.java | 7 +++++++ .../mybatis/mapper/TbShopTableBookingMapper.java | 6 ++++++ .../service/TbShopTableBookingService.java | 2 ++ .../impl/TbPadProductCategoryServiceImpl.java | 8 +++++--- .../impl/TbShopTableBookingServiceImpl.java | 15 +++++++++++++++ 5 files changed, 35 insertions(+), 3 deletions(-) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/controller/booking/TbShopTableBookingController.java b/eladmin-system/src/main/java/cn/ysk/cashier/controller/booking/TbShopTableBookingController.java index 7edc9167..24f7f493 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/controller/booking/TbShopTableBookingController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/controller/booking/TbShopTableBookingController.java @@ -94,4 +94,11 @@ public class TbShopTableBookingController { List list = tbShopTableBookingService.findShopTableList(params); return ResponseEntity.ok().body(list); } + + @GetMapping("summary") + @ApiOperation("根据电话号码统计历史预订信息") + public ResponseEntity summary(@RequestBody String[] phoneNos) { + Map data = tbShopTableBookingService.summary(phoneNos); + return ResponseEntity.ok().body(data); + } } \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbShopTableBookingMapper.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbShopTableBookingMapper.java index c7f465e4..835e5d96 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbShopTableBookingMapper.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbShopTableBookingMapper.java @@ -3,6 +3,10 @@ package cn.ysk.cashier.mybatis.mapper; import cn.ysk.cashier.mybatis.entity.TbShopTableBooking; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; /** * 店铺台桌预订 @@ -12,5 +16,7 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface TbShopTableBookingMapper extends BaseMapper { + + List> summaryByPhoneNos(@Param("phoneNoList") List phoneNoList); } \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbShopTableBookingService.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbShopTableBookingService.java index 03c2d7e8..762757bb 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbShopTableBookingService.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbShopTableBookingService.java @@ -36,4 +36,6 @@ public interface TbShopTableBookingService extends IService List findShopTableList(Map params); + Map summary(String[] phoneNos); + } \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbPadProductCategoryServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbPadProductCategoryServiceImpl.java index 85aa89cd..b8277c10 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbPadProductCategoryServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbPadProductCategoryServiceImpl.java @@ -211,7 +211,8 @@ public class TbPadProductCategoryServiceImpl extends ServiceImpl productIdSet = productIdList.stream().collect(Collectors.toSet()); + for (Long productId : productIdSet) { TbPadProductCategoryDetail subEntity = new TbPadProductCategoryDetail(); subEntity.setProductId(productId); subEntity.setPadProductCategoryId(entity.getId()); @@ -269,8 +270,9 @@ public class TbPadProductCategoryServiceImpl extends ServiceImpllambdaQuery().eq(TbPadProductCategoryDetail::getPadProductCategoryId, entity.getId())); + tbPadProductCategoryDetailMapper.delete(Wrappers.lambdaQuery().eq(TbPadProductCategoryDetail::getPadProductCategoryId, entity.getId())); + Set productIdSet = productIdList.stream().collect(Collectors.toSet()); + for (Long productId : productIdSet) { TbPadProductCategoryDetail subEntity = new TbPadProductCategoryDetail(); subEntity.setProductId(productId); subEntity.setPadProductCategoryId(entity.getId()); diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbShopTableBookingServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbShopTableBookingServiceImpl.java index 5bcfb06c..ca9b9870 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbShopTableBookingServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbShopTableBookingServiceImpl.java @@ -262,4 +262,19 @@ public class TbShopTableBookingServiceImpl extends ServiceImpl summary(String[] phoneNos) { + List> list = baseMapper.summaryByPhoneNos(Arrays.asList(phoneNos)); + Map result = new HashMap<>(phoneNos.length); + Map fillData = new HashMap<>(2); + fillData.put("consumeOrders", 0); + fillData.put("cancelOrders", 0); + for (String phoneNo : phoneNos) { + fillData.put("phoneNumber", phoneNo); + Map data = list.stream().filter(item -> phoneNo.equals(item.get("phoneNumber"))).findFirst().orElse(fillData); + result.put("Tel_"+phoneNo, data); + } + return result; + } } \ No newline at end of file From 1be72037daf5643adf7d3f6c864ee9eb0b8caf42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=AD=E5=87=AF=E5=87=AF?= Date: Mon, 25 Nov 2024 16:56:52 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=8C=82=E8=B4=A6?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=9B=B8=E5=85=B3=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/plus/TbShopTableBookingMapper.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 eladmin-system/src/main/resources/mapper/plus/TbShopTableBookingMapper.xml diff --git a/eladmin-system/src/main/resources/mapper/plus/TbShopTableBookingMapper.xml b/eladmin-system/src/main/resources/mapper/plus/TbShopTableBookingMapper.xml new file mode 100644 index 00000000..6a94f86e --- /dev/null +++ b/eladmin-system/src/main/resources/mapper/plus/TbShopTableBookingMapper.xml @@ -0,0 +1,18 @@ + + + + + + + \ No newline at end of file From 83242a5398bc23bcc67ba11dc303656943d80806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=AD=E5=87=AF=E5=87=AF?= Date: Mon, 25 Nov 2024 17:12:43 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=8C=82=E8=B4=A6?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=9B=B8=E5=85=B3=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mybatis/service/impl/TbShopTableBookingServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbShopTableBookingServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbShopTableBookingServiceImpl.java index ca9b9870..63a08eb9 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbShopTableBookingServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbShopTableBookingServiceImpl.java @@ -273,7 +273,7 @@ public class TbShopTableBookingServiceImpl extends ServiceImpl data = list.stream().filter(item -> phoneNo.equals(item.get("phoneNumber"))).findFirst().orElse(fillData); - result.put("Tel_"+phoneNo, data); + result.put(phoneNo, data); } return result; } From ee88ccc07dae244acc754020b53784e0645ea044 Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Mon, 25 Nov 2024 17:16:28 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=8F=8F=E8=BF=B0=20=E8=BF=94=E5=9B=9E=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cashier/mybatis/service/impl/TbShopCouponServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbShopCouponServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbShopCouponServiceImpl.java index 5d2d448c..904706e5 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbShopCouponServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbShopCouponServiceImpl.java @@ -196,7 +196,7 @@ public class TbShopCouponServiceImpl extends ServiceImpl Date: Mon, 25 Nov 2024 17:54:41 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E5=BC=80=E7=A5=A8=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cashier/service/impl/BindServiceImpl.java | 49 ++++++++++--------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/BindServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/BindServiceImpl.java index 46c89573..c6978cbd 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/BindServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/BindServiceImpl.java @@ -52,15 +52,15 @@ public class BindServiceImpl implements BindService { String result = HttpUtil.post(url + "cash/subinvoicing", params, 5000); JSONObject jsonObject = JSONObject.parseObject(result); if (jsonObject.getInteger("code").equals(1)) { - if (StringUtils.isNotBlank(shopId)) { - if (redisUtils.hasKey(CacheKey.INVOICE_SD_TYPE + shopId)) { - Set articles = redisUtils.sGet(CacheKey.INVOICE_SD_TYPE + shopId); - if (!articles.contains(params.get("article"))) { - articles.add(params.get("article")); - redisUtils.sSet(CacheKey.INVOICE_SD_TYPE + shopId, articles); - } - } - } +// if (StringUtils.isNotBlank(shopId)) { +// if (redisUtils.hasKey(CacheKey.INVOICE_SD_TYPE + shopId)) { +// Set articles = redisUtils.sGet(CacheKey.INVOICE_SD_TYPE + shopId); +// if (!articles.contains(params.get("article"))) { +// articles.add(params.get("article")); +// redisUtils.sSet(CacheKey.INVOICE_SD_TYPE + shopId, articles); +// } +// } +// } return jsonObject.getJSONObject("data"); } else { throw new BadRequestException(jsonObject.getString("msg")); @@ -69,7 +69,7 @@ public class BindServiceImpl implements BindService { @Override public JSONObject industry(BindingDto bindingDto) { - if (StringUtils.isNotBlank(bindingDto.getArticle())) { +// if (StringUtils.isNotBlank(bindingDto.getArticle())) { Map params = new HashMap<>(); params.put("name", bindingDto.getArticle()); params.put("page", bindingDto.getPage() == null ? 1 : bindingDto.getPage()); @@ -80,20 +80,21 @@ public class BindServiceImpl implements BindService { } else { throw new BadRequestException(jsonObject.getString("msg")); } - } else { - Set set = new HashSet<>(); - JSONObject jsonObject = new JSONObject(); - if (!redisUtils.hasKey(CacheKey.INVOICE_SD_TYPE + bindingDto.getShopId())) { - TbShopInfo tbShopInfo = tbShopInfoRepository.findById(bindingDto.getShopId()).orElseGet(null); - TbMerchantAccount account = accountRepository.findByAccount(tbShopInfo.getAccount()); - set.add(account.getArticle()); - redisUtils.sSet(CacheKey.INVOICE_SD_TYPE + bindingDto.getShopId(), set); - jsonObject.put("articles", set); - } else { - jsonObject.put("list", redisUtils.sGet(CacheKey.INVOICE_SD_TYPE + bindingDto.getShopId())); - } - return jsonObject; - } +// } +// else { +// Set set = new HashSet<>(); +// JSONObject jsonObject = new JSONObject(); +// if (!redisUtils.hasKey(CacheKey.INVOICE_SD_TYPE + bindingDto.getShopId())) { +// TbShopInfo tbShopInfo = tbShopInfoRepository.findById(bindingDto.getShopId()).orElseGet(null); +// TbMerchantAccount account = accountRepository.findByAccount(tbShopInfo.getAccount()); +// set.add(account.getArticle()); +// redisUtils.sSet(CacheKey.INVOICE_SD_TYPE + bindingDto.getShopId(), set); +// jsonObject.put("articles", set); +// } else { +// jsonObject.put("list", redisUtils.sGet(CacheKey.INVOICE_SD_TYPE + bindingDto.getShopId())); +// } +// return jsonObject; +// } } @Override From 41e21bcd3b3ce39e4edb7a5dabb119ed7f8b369c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=AD=E5=87=AF=E5=87=AF?= Date: Tue, 26 Nov 2024 09:26:44 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=8C=82=E8=B4=A6?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=9B=B8=E5=85=B3=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/TbCreditBuyerServiceImpl.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbCreditBuyerServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbCreditBuyerServiceImpl.java index 10c96535..4858bbab 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbCreditBuyerServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbCreditBuyerServiceImpl.java @@ -45,6 +45,7 @@ public class TbCreditBuyerServiceImpl extends ServiceImpl getWrapper(Map params) { MapProxy mapProxy = MapProxy.create(params); String keywords = mapProxy.getStr("keywords"); + String repaymentStatus = mapProxy.getStr("repaymentStatus"); TbCreditBuyer param = BeanUtil.toBean(params, TbCreditBuyer.class); LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(); @@ -55,6 +56,16 @@ public class TbCreditBuyerServiceImpl extends ServiceImpl i.like(TbCreditBuyer::getDebtor, keywords).or().like(TbCreditBuyer::getMobile, keywords)); } + if (StrUtil.isNotEmpty(repaymentStatus)) { + if ("unpaid".equals(repaymentStatus)) { + wrapper.apply("0 < ifnull((select x.count from view_credit_buyer_order_count x where x.credit_buyer_id = tb_credit_buyer.id and x.status = 'unpaid'),0)"); + wrapper.apply("0 = ifnull((select x.count from view_credit_buyer_order_count x where x.credit_buyer_id = tb_credit_buyer.id and x.status = 'partial'),0)"); + }else if ("partial".equals(repaymentStatus)) { + wrapper.apply("0 < ifnull((select x.count from view_credit_buyer_order_count x where x.credit_buyer_id = tb_credit_buyer.id and x.status = 'partial'),0)"); + }else if ("paid".equals(repaymentStatus)) { + wrapper.apply("0 = ifnull((select sum(x.count) from view_credit_buyer_order_count x where x.credit_buyer_id = tb_credit_buyer.id and x.status in ('unpaid','partial')),0)"); + } + } wrapper.eq(TbCreditBuyer::getDelFlag, 0); wrapper.select(TbCreditBuyer::getId, TbCreditBuyer::getShopId, TbCreditBuyer::getStatus, TbCreditBuyer::getDebtor, TbCreditBuyer::getMobile, TbCreditBuyer::getPosition, TbCreditBuyer::getCreditAmount, TbCreditBuyer::getRepaymentMethod, TbCreditBuyer::getPaymentMethod, TbCreditBuyer::getRemark, TbCreditBuyer::getDelFlag, TbCreditBuyer::getOwedAmount, TbCreditBuyer::getAccumulateAmount, TbCreditBuyer::getShopName, TbCreditBuyer::getResponsiblePerson, TbCreditBuyer::getAccountBalance); wrapper.orderByDesc(TbCreditBuyer::getStatus); From 574fc1eb15389dbb559b06c52438630847295f24 Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Tue, 26 Nov 2024 10:28:07 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E7=9B=98=E7=82=B9=20=E5=8F=96=E7=BB=9D?= =?UTF-8?q?=E5=AF=B9=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/ysk/cashier/cons/service/impl/TbConCheckServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/impl/TbConCheckServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/impl/TbConCheckServiceImpl.java index d4358b77..787520ea 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/impl/TbConCheckServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/impl/TbConCheckServiceImpl.java @@ -113,8 +113,8 @@ public class TbConCheckServiceImpl implements TbConCheckService { conCheck.setPrice(consInfo.getPrice()); conCheck.setAcStockNumber(resources.getStockNumber()); conCheck.setStockNumber(resources.getStockNumber()); - conCheck.setLpNum(resources.getLpNum()); conCheck.setLpAmount(consInfo.getPrice().multiply(resources.getLpNum())); + conCheck.setLpNum(resources.getLpNum().abs()); conCheck.setCreateTime(new Timestamp(System.currentTimeMillis())); conCheck.setRemark(resources.getRemark()); return tbConCheckMapper.toDto(tbConCheckRepository.save(conCheck)); From f8cc0c26d664a2a6ce72b02bba535eb0f6f0cf5e Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Tue, 26 Nov 2024 10:43:28 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E7=9B=98=E7=82=B9=20=E5=8F=96=E7=BB=9D?= =?UTF-8?q?=E5=AF=B9=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ysk/cashier/cons/service/impl/TbConCheckServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/impl/TbConCheckServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/impl/TbConCheckServiceImpl.java index 787520ea..67fcd93e 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/impl/TbConCheckServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/impl/TbConCheckServiceImpl.java @@ -97,7 +97,7 @@ public class TbConCheckServiceImpl implements TbConCheckService { flow.setConsId(consInfo.getId()); flow.setShopId(consInfo.getShopId()); flow.setConName(consInfo.getConName()); - flow.setAmount(resources.getLpNum()); + flow.setAmount(resources.getLpNum().abs()); flow.setBalance(resources.getStockNumber()); flow.setOperator(SecurityUtils.getCurrentUserNickName()); flow.setCreateTime(new Timestamp(System.currentTimeMillis())); @@ -114,7 +114,7 @@ public class TbConCheckServiceImpl implements TbConCheckService { conCheck.setAcStockNumber(resources.getStockNumber()); conCheck.setStockNumber(resources.getStockNumber()); conCheck.setLpAmount(consInfo.getPrice().multiply(resources.getLpNum())); - conCheck.setLpNum(resources.getLpNum().abs()); + conCheck.setLpNum(resources.getLpNum()); conCheck.setCreateTime(new Timestamp(System.currentTimeMillis())); conCheck.setRemark(resources.getRemark()); return tbConCheckMapper.toDto(tbConCheckRepository.save(conCheck));