From c7c61ed00fc5bc18da5b041ea1e916608417eb0d Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Sun, 9 Mar 2025 09:45:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E6=B7=BB=E5=8A=A0=E5=8F=8A?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hiver-admin/test-output/test-report.html | 16 +-- .../core/common/constant/SaleConstant.java | 6 + .../common/constant/PurchaseConstant.java | 6 + .../common/constant/StockLogConstant.java | 4 +- .../hiver/mall/controller/SaleController.java | 42 ++++++- .../hiver/mall/controller/ShopController.java | 4 + .../mall/controller/StockController.java | 29 +++++ .../cc/hiver/mall/dao/mapper/SaleMapper.java | 17 +++ .../java/cc/hiver/mall/entity/Purchase.java | 3 + .../main/java/cc/hiver/mall/entity/Sale.java | 39 +++--- .../main/java/cc/hiver/mall/entity/Shop.java | 3 + .../lable/controller/LableController.java | 90 ++++++++++++++ .../lable/controller/SaleLableController.java | 114 ++++++++++++++++++ .../cc/hiver/mall/lable/entity/Lable.java | 33 +++++ .../cc/hiver/mall/lable/entity/SaleLable.java | 22 ++++ .../hiver/mall/lable/mapper/LableMapper.java | 33 +++++ .../mall/lable/mapper/SaleLableMapper.java | 31 +++++ .../mall/lable/service/LableService.java | 44 +++++++ .../mall/lable/service/SaleLableService.java | 15 +++ .../lable/service/impl/LableServiceImpl.java | 81 +++++++++++++ .../service/impl/SaleLableServiceImpl.java | 65 ++++++++++ .../cc/hiver/mall/lable/vo/SaleLableVo.java | 26 ++++ .../java/cc/hiver/mall/pojo/vo/SaleVO.java | 14 ++- .../mapper/PurchaseOcrPictureMapper.java | 1 + .../impl/PurchaseOcrPictureServiceImpl.java | 33 +++-- .../mall/service/mybatis/SaleService.java | 17 +++ .../serviceimpl/mybatis/SaleServiceImpl.java | 95 ++++++++++++--- .../serviceimpl/mybatis/StockServiceImpl.java | 2 + .../java/cc/hiver/mall/utils/AliOcrUtil.java | 4 +- .../src/main/resources/mapper/LableMapper.xml | 33 +++++ .../main/resources/mapper/PurchaseMapper.xml | 40 +++++- .../main/resources/mapper/SaleLableMapper.xml | 27 +++++ .../src/main/resources/mapper/SaleMapper.xml | 83 +++++++++++-- 33 files changed, 998 insertions(+), 74 deletions(-) create mode 100644 hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/controller/LableController.java create mode 100644 hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/controller/SaleLableController.java create mode 100644 hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/entity/Lable.java create mode 100644 hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/entity/SaleLable.java create mode 100644 hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/mapper/LableMapper.java create mode 100644 hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/mapper/SaleLableMapper.java create mode 100644 hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/service/LableService.java create mode 100644 hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/service/SaleLableService.java create mode 100644 hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/service/impl/LableServiceImpl.java create mode 100644 hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/service/impl/SaleLableServiceImpl.java create mode 100644 hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/vo/SaleLableVo.java create mode 100644 hiver-modules/hiver-mall/src/main/resources/mapper/LableMapper.xml create mode 100644 hiver-modules/hiver-mall/src/main/resources/mapper/SaleLableMapper.xml diff --git a/hiver-admin/test-output/test-report.html b/hiver-admin/test-output/test-report.html index 62b0dfa8..cc7c9a5f 100644 --- a/hiver-admin/test-output/test-report.html +++ b/hiver-admin/test-output/test-report.html @@ -35,7 +35,7 @@ Hiver
  • -一月 22, 2025 18:29:49 +三月 07, 2025 14:48:44
  • @@ -84,7 +84,7 @@

    passTest

    -

    18:29:50 下午 / 0.015 secs

    +

    14:48:44 下午 / 0.017 secs

    @@ -92,9 +92,9 @@
    #test-id=1
    passTest
    -01.22.2025 18:29:50 -01.22.2025 18:29:50 -0.015 secs +03.07.2025 14:48:44 +03.07.2025 14:48:44 +0.017 secs
    @@ -104,7 +104,7 @@ Pass - 18:29:50 + 14:48:44 Test passed @@ -128,13 +128,13 @@

    Started

    -

    一月 22, 2025 18:29:49

    +

    三月 07, 2025 14:48:44

    Ended

    -

    一月 22, 2025 18:29:50

    +

    三月 07, 2025 14:48:44

    diff --git a/hiver-core/src/main/java/cc/hiver/core/common/constant/SaleConstant.java b/hiver-core/src/main/java/cc/hiver/core/common/constant/SaleConstant.java index ec5c662d..b60f8420 100644 --- a/hiver-core/src/main/java/cc/hiver/core/common/constant/SaleConstant.java +++ b/hiver-core/src/main/java/cc/hiver/core/common/constant/SaleConstant.java @@ -54,4 +54,10 @@ public interface SaleConstant { * 鏄惁璐拱杩囷細0锛氭病涔拌繃锛1锛氫拱杩 */ int[] IS_PURCHASED_BEFORE = {0, 1}; + + /** + + * 鏄惁閰嶈揣:0:鍚︼紱1锛氭槸 + */ + int[] DISTRIBUTION_FLAG = {0, 1}; } diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/common/constant/PurchaseConstant.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/common/constant/PurchaseConstant.java index f0eb9a66..7b5bf15a 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/common/constant/PurchaseConstant.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/common/constant/PurchaseConstant.java @@ -17,4 +17,10 @@ public interface PurchaseConstant { */ int[] OCR_STATUS = {0, 1,2}; + /** + * 鏄惁闇瑕佸叆搴撶‘璁わ細0锛氫笉闇瑕侊紱1锛氶渶瑕 + */ + int[] STORE_FLAG = {0, 1}; + + } diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/common/constant/StockLogConstant.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/common/constant/StockLogConstant.java index 2fb951f2..5f9cccbe 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/common/constant/StockLogConstant.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/common/constant/StockLogConstant.java @@ -8,8 +8,8 @@ package cc.hiver.mall.common.constant; public interface StockLogConstant { /** - * 鍑哄叆搴撶被鍨嬶紙0-鍏ュ簱锛1-鍑哄簱;2-鐩樼偣锛 + * 鍑哄叆搴撶被鍨嬶紙0-鍏ュ簱锛1-鍑哄簱;2-鐩樼偣;3-鎵嬪姩鏇存柊锛 */ - String[] CHANGE_TYPE = {"0","1","2"}; + String[] CHANGE_TYPE = {"0","1","2","3"}; } diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/SaleController.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/SaleController.java index a43e59de..c0122c5a 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/SaleController.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/SaleController.java @@ -247,6 +247,7 @@ public class SaleController { } sale.setDelFlag(CommonConstant.DEL_FLAG_FALSE); sale.setStatus(SaleConstant.SALE_STATUS[4]); + sale.setDistributionFlag(SaleConstant.DISTRIBUTION_FLAG[0]); saleService.save(sale); // 鍙湁閫璐э紝鍗曠嫭澶勭悊涓嬪鎴锋瑺娆 } @@ -706,7 +707,7 @@ public class SaleController { startTime = saleVO.getStartTime() == null ? dateText : saleVO.getStartTime(); if (StringUtils.isEmpty(saleVO.getEndTime())) { // 涓虹┖锛屼娇鐢ㄥ綋鍓嶆棩鏈+1 - endTime = DateUtil.addDay(dateText,1); + endTime = DateUtil.addDay(dateText, 1); } else { // 涓嶄负绌猴紝浣跨敤浼犲弬鏃ユ湡+1 endTime = DateUtil.addDay(saleVO.getEndTime(), 1); @@ -1385,4 +1386,43 @@ public class SaleController { final List count = saleService.buyCount(customerId, productIdList); return new ResultUtil>().setData(count); } + + /** + * 鏍规嵁saleid鏇存柊閰嶈揣鐘舵佺殑 + * @author 鐜嬪瘜搴 + * @date 2025/2/26 + * @param saleId + * @param distributionFlag + * @return Result + */ + @RequestMapping(value = "/updateDistributionFlag", method = RequestMethod.POST) + @ApiOperation("鏍规嵁saleid鏇存柊閰嶈揣鐘舵佺殑") + public Result updateDistributionFlag(String saleId, String distributionFlag) { + if (StringUtils.isEmpty(saleId)) { + ResultUtil.error("璁㈠崟id涓嶈兘涓虹┖"); + } + if (StringUtils.isEmpty(distributionFlag)) { + ResultUtil.error("閰嶈揣鏍囪瘑涓嶈兘涓虹┖"); + } + saleService.updateDistributionFlag(saleId, distributionFlag); + return ResultUtil.success("鏇存柊鎴愬姛锛"); + } + + /** + * 鏇存柊鎵撳嵃娆℃暟+1 + * @author 鐜嬪瘜搴 + * @date 2025/2/26 + * @param saleId + * @return Result + */ + @RequestMapping(value = "/updatePrintCount", method = RequestMethod.POST) + @ApiOperation("鏇存柊鎵撳嵃娆℃暟+1") + public Result updatePrintCount(String saleId) { + if (StringUtils.isEmpty(saleId)) { + ResultUtil.error("璁㈠崟id涓嶈兘涓虹┖"); + } + saleService.updatePrintCount(saleId); + return ResultUtil.success("鏇存柊鎴愬姛锛"); + } + } diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ShopController.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ShopController.java index d4c666de..eff4209f 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ShopController.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ShopController.java @@ -307,6 +307,10 @@ public class ShopController { if (shop.getPrintingMethod() != null) { oldShop.setPrintingMethod(shop.getPrintingMethod()); } + + if (shop.getStoreFlag() != null) { + oldShop.setStoreFlag(shop.getStoreFlag()); + } shopService.update(oldShop); return ResultUtil.success("鏇存柊鎴愬姛"); } diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/StockController.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/StockController.java index 75ebba90..4de95534 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/StockController.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/StockController.java @@ -3,7 +3,9 @@ package cc.hiver.mall.controller; import cc.hiver.core.common.utils.ResultUtil; import cc.hiver.core.common.utils.SecurityUtil; import cc.hiver.core.common.vo.Result; +import cc.hiver.mall.common.constant.StockLogConstant; import cc.hiver.mall.entity.Stock; +import cc.hiver.mall.entity.StockLog; import cc.hiver.mall.pojo.query.StockPageQuery; import cc.hiver.mall.pojo.vo.ProductCategoryStockVo; import cc.hiver.mall.pojo.vo.PurchaseVo; @@ -222,4 +224,31 @@ public class StockController { return ResultUtil.error("鍒犻櫎澶辫触锛"); } } + + // 鏍规嵁鍟嗗搧id鍙婅鏍兼洿鏂板簱瀛樻暟 + @RequestMapping(value = "/updateStockCount", method = RequestMethod.POST) + @ApiOperation("鏍规嵁鍟嗗搧id鍙婅鏍兼洿鏂板簱瀛樻暟") + public Result updateStockCount(String productId, String attributeList, int count) { + final Stock stock = stockService.getByProductIdAndAttributeList(productId, attributeList); + if (stock == null) { + return ResultUtil.error("搴撳瓨涓嶅瓨鍦紒"); + } + int oldStockCount = stock.getStockCount(); + stock.setStockCount(count); + stockService.updateById(stock); + + // 璁板綍搴撳瓨鍙樻洿璁板綍 + StockLog changeStockLog = new StockLog(); + changeStockLog.setStock(oldStockCount); + changeStockLog.setProductId(productId); + changeStockLog.setAttributeList(attributeList); + // 鍏ュ簱 + changeStockLog.setChangeType(StockLogConstant.CHANGE_TYPE[3]); + // 鍙樻崲鐨勬暟閲 + changeStockLog.setStockCount(count - oldStockCount); + // shopId浠庣紦瀛樹腑璁剧疆 + final String shopId = securityUtil.getShopId(); + changeStockLog.setShopId(shopId); + return ResultUtil.success("鏇存柊鎴愬姛锛"); + } } diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/SaleMapper.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/SaleMapper.java index e82eac8b..a1a4f0b2 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/SaleMapper.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/SaleMapper.java @@ -156,4 +156,21 @@ public interface SaleMapper extends BaseMapper { CustomerDataVo getSalePrice(@Param("customerPageQuery")CustomerPageQuery customerPageQuery); List getSaleCount(@Param("customerPageQuery")CustomerPageQuery customerPageQuery); + + /** + * 鏍规嵁saleid鏇存柊閰嶈揣鐘舵佺殑 + * @author 鐜嬪瘜搴 + * @date 2025/2/26 + * @param saleId + * @param distributionFlag + */ + void updateDistributionFlag(@Param("saleId") String saleId,@Param("distributionFlag") String distributionFlag); + + /** + * 鏇存柊鎵撳嵃娆℃暟+1 + * @author 鐜嬪瘜搴 + * @date 2025/2/26 + * @param saleId + */ + void updatePrintCount(@Param("saleId") String saleId); } \ No newline at end of file diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Purchase.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Purchase.java index 938d30e5..3932b4a5 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Purchase.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Purchase.java @@ -100,6 +100,9 @@ public class Purchase { @ApiModelProperty(value = "浣欓鎶垫墸") private BigDecimal balanceDeductionAmount; + @ApiModelProperty(value = "鏄惁闇瑕佸叆搴撶‘璁わ細0锛氫笉闇瑕侊紱1锛氶渶瑕侊紙鏁版嵁搴撻粯璁や负0锛") + private int storeFlag; + @Transient @TableField(exist = false) @ApiModelProperty(value = "璧峰鏃ユ湡") diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Sale.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Sale.java index 53e84b93..778080a7 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Sale.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Sale.java @@ -1,6 +1,7 @@ package cc.hiver.mall.entity; import cc.hiver.core.common.utils.SnowFlakeUtil; +import cc.hiver.mall.lable.vo.SaleLableVo; import cc.hiver.mall.pojo.dto.SaleDetailDTO; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; @@ -95,7 +96,7 @@ public class Sale implements Serializable { * 03锛氶璐у緟閫佽揪 * 04锛氬緟纭閫璐 * 4锛氬凡瀹屾垚 - * + *

    * 鍒嗕韩椤垫彁浜よ鍗曪細6锛氬緟閰嶈揣 * 鎸傚崟椤垫彁浜よ鍗曪細7锛氭寕鍗 */ @@ -132,49 +133,49 @@ public class Sale implements Serializable { @ApiModelProperty(value = "涓嬪崟鎬讳欢鏁") private int productCount; - @ApiModelProperty(value="澶囨敞") + @ApiModelProperty(value = "澶囨敞") private String remark; - @ApiModelProperty(value="鎸傚崟鍚嶇О") + @ApiModelProperty(value = "鎸傚崟鍚嶇О") private String saleName; - @ApiModelProperty(value="鍏朵粬璐圭敤") + @ApiModelProperty(value = "鍏朵粬璐圭敤") private BigDecimal otherExpense; - @ApiModelProperty(value="閰嶉佹柟寮 0-骞冲彴閰嶉 1-鑷 2-鐗╂祦鑷彁") + @ApiModelProperty(value = "閰嶉佹柟寮 0-骞冲彴閰嶉 1-鑷 2-鐗╂祦鑷彁") private String modeOfService; - @ApiModelProperty(value="鏄惁鏄疉I鐨勬爣璇嗭細0锛氫笉鏄疉I锛1锛氭槸锛圓I鏈瘑鍒級, 2锛圓I璇嗗埆鎴愬姛锛夛紝3锛圓I璇嗗埆澶辫触") + @ApiModelProperty(value = "鏄惁鏄疉I鐨勬爣璇嗭細0锛氫笉鏄疉I锛1锛氭槸锛圓I鏈瘑鍒級, 2锛圓I璇嗗埆鎴愬姛锛夛紝3锛圓I璇嗗埆澶辫触") private String aiFlag; - @ApiModelProperty(value="AI璇嗗埆鐨勭粨鏋") + @ApiModelProperty(value = "AI璇嗗埆鐨勭粨鏋") private String aiResult; - @ApiModelProperty(value="AI鏈瘑鍒殑鍟嗗搧鍙婅鏍兼荤粨") + @ApiModelProperty(value = "AI鏈瘑鍒殑鍟嗗搧鍙婅鏍兼荤粨") private String aiNotRecognition; @Transient @TableField(exist = false) - @ApiModelProperty(value="鍟嗗搧璇︽儏") + @ApiModelProperty(value = "鍟嗗搧璇︽儏") private List saleDetailDTOList; @Transient @TableField(exist = false) - @ApiModelProperty(value="閫娆炬暟閲") + @ApiModelProperty(value = "閫娆炬暟閲") private int returnSaleProductCount; @Transient @TableField(exist = false) - @ApiModelProperty(value="閫娆炬婚噾棰") + @ApiModelProperty(value = "閫娆炬婚噾棰") private BigDecimal returnSaleTotalAmount; - @ApiModelProperty(value="娆犳鎶垫墸閲戦") + @ApiModelProperty(value = "娆犳鎶垫墸閲戦") private BigDecimal debtDeductionAmount; - @ApiModelProperty(value="閿鍞姷鎵i噾棰") + @ApiModelProperty(value = "閿鍞姷鎵i噾棰") private BigDecimal saleDeductionAmount; - @ApiModelProperty(value="浣欓鎶垫墸閲戦") + @ApiModelProperty(value = "浣欓鎶垫墸閲戦") private BigDecimal balanceDeductionAmount; @Transient @@ -182,6 +183,16 @@ public class Sale implements Serializable { @ApiModelProperty(value = "涓婃娆犳") private BigDecimal lastDebtAmount; + @ApiModelProperty(value = "鎵撳嵃娆℃暟") + private int printCount; + + @ApiModelProperty(value = "鏄惁閰嶈揣:0:鍚︼紱1锛氭槸") + private int distributionFlag; + + @Transient + @TableField(exist = false) + @ApiModelProperty(value = "鏍囩鍒楄〃") + private List lableList; private static final long serialVersionUID = 1L; diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Shop.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Shop.java index 9017d66a..c4d0d793 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Shop.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Shop.java @@ -130,4 +130,7 @@ public class Shop extends HiverBaseEntity { @ApiModelProperty(value = "鎵撳嵃鏂瑰紡") private String printingMethod; + + @ApiModelProperty(value = "鏄惁闇瑕佸叆搴撶‘璁わ細0锛氫笉闇瑕侊紱1锛氶渶瑕侊紙鏁版嵁搴撻粯璁や负0锛") + private String storeFlag; } diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/controller/LableController.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/controller/LableController.java new file mode 100644 index 00000000..2d793f8b --- /dev/null +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/controller/LableController.java @@ -0,0 +1,90 @@ +package cc.hiver.mall.lable.controller; + +import cc.hiver.core.common.utils.ResultUtil; +import cc.hiver.core.common.vo.Result; +import cc.hiver.mall.lable.entity.Lable; +import cc.hiver.mall.lable.service.LableService; +import io.swagger.annotations.Api; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 鏍囩鎺у埗灞 + * + * @author 鐜嬪瘜搴 + * @date 2025/2/26 + */ +@Slf4j +@RestController +@Api(tags = "鏍囩鎺у埗灞") +@RequestMapping("/hiver/app/lable/") +public class LableController { + + @Autowired + private LableService lableService; + + /** + * 鏂板/缂栬緫鏍囩 + * + * @param lable + * @return Result + * @author 鐜嬪瘜搴 + * @date 2025/2/26 + */ + @RequestMapping(value = "/saveOrEditLable", method = RequestMethod.POST) + public Result saveLable(@RequestBody(required = false) Lable lable) { + + try { + lable = lableService.saveLable(lable); + } catch (Exception e) { + log.error("鏂板鏍囩澶辫触", e); + return ResultUtil.error("鏂板鏍囩澶辫触!"); + } + return new ResultUtil<>().setData(lable); + } + + /** + * 鍒犻櫎鏍囩锛堢湡鍒犻櫎锛 + * + * @param id + * @return Result + * @author 鐜嬪瘜搴 + * @date 2025/2/26 + */ + @RequestMapping(value = "/deleteLable", method = RequestMethod.POST) + public Result deleteLable(String id) { + + try { + lableService.removeById(id); + } catch (Exception e) { + log.error("鍒犻櫎鏍囩澶辫触", e); + return ResultUtil.error("鍒犻櫎鏍囩澶辫触!"); + } + return ResultUtil.success("鍒犻櫎鏍囩鎴愬姛!"); + } + + /** + * 鏌ヨ搴楅摵涓嬫墍鏈夋爣绛 + * @author 鐜嬪瘜搴 + * @date 2025/2/26 + * @param shopId + * @return Result + */ + @RequestMapping(value = "/getLableListByShopId", method = RequestMethod.POST) + public Result getLableListByShopId(String shopId) { + + try { + List lableList = lableService.getLableListByShopId(shopId); + return new ResultUtil<>().setData(lableList); + } catch (Exception e) { + log.error("鏌ヨ搴楅摵涓嬫墍鏈夋爣绛惧け璐", e); + return ResultUtil.error("鏌ヨ搴楅摵涓嬫墍鏈夋爣绛惧け璐!"); + } + } +} diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/controller/SaleLableController.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/controller/SaleLableController.java new file mode 100644 index 00000000..037ee9c6 --- /dev/null +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/controller/SaleLableController.java @@ -0,0 +1,114 @@ +package cc.hiver.mall.lable.controller; + +import cc.hiver.core.common.utils.ResultUtil; +import cc.hiver.core.common.vo.Result; +import cc.hiver.mall.lable.entity.SaleLable; +import cc.hiver.mall.lable.service.SaleLableService; +import io.swagger.annotations.Api; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import javax.transaction.Transactional; + +/** + * 璁㈠崟-鏍囩鍏宠仈琛ㄦ帶鍒跺眰 + * + * @author 鐜嬪瘜搴 + * @date 2025/2/26 + */ +@Slf4j +@RestController +@Api(tags = "璁㈠崟-鏍囩鍏宠仈琛ㄦ帶鍒跺眰") +@RequestMapping("/hiver/app/saleLable/") +public class SaleLableController { + + @Autowired + private SaleLableService saleLableService; + + /** + * 鏂板/缂栬緫璁㈠崟-鏍囩鍏宠仈 + * + * @param saleLable + * @return Result + * @author 鐜嬪瘜搴 + * @date 2025/2/26 + */ + @RequestMapping(value = "/saveOrEditSaleLable", method = RequestMethod.POST) + public Result saveOrEditSaleLable(@RequestBody(required = false) SaleLable saleLable) { + + try { + saleLable = saleLableService.saveOrEditSaleLable(saleLable); + } catch (Exception e) { + log.error("鏂板璁㈠崟-鏍囩鍏宠仈澶辫触", e); + return ResultUtil.error("鏂板璁㈠崟-鏍囩鍏宠仈澶辫触!"); + } + return new ResultUtil<>().setData(saleLable); + } + + /** + * 鍒犻櫎璁㈠崟-鏍囩鍏宠仈锛堢湡鍒犻櫎锛 + * + * @param id + * @return Result + * @author 鐜嬪瘜搴 + * @date 2025/2/26 + */ + @RequestMapping(value = "/deleteSaleLable", method = RequestMethod.POST) + public Result deleteLable(String id) { + + try { + saleLableService.removeById(id); + } catch (Exception e) { + log.error("鍒犻櫎璁㈠崟-鏍囩鍏宠仈澶辫触", e); + return ResultUtil.error("鍒犻櫎璁㈠崟-鏍囩鍏宠仈澶辫触!"); + } + return ResultUtil.success("鍒犻櫎璁㈠崟-鏍囩鍏宠仈鎴愬姛!"); + } + + @RequestMapping(value = "/deleteBySaleId", method = RequestMethod.POST) + public Result deleteBySaleId(String saleId) { + if(StringUtils.isEmpty(saleId)){ + return ResultUtil.error("璁㈠崟id涓嶈兘涓虹┖!"); + } + try { + saleLableService.deleteBySaleId(saleId); + } catch (Exception e) { + log.error("鍒犻櫎璁㈠崟-鏍囩鍏宠仈澶辫触", e); + return ResultUtil.error("鍒犻櫎璁㈠崟-鏍囩鍏宠仈澶辫触!"); + } + return ResultUtil.success("鍒犻櫎璁㈠崟-鏍囩鍏宠仈鎴愬姛!"); + } + + + /** + * 璁㈠崟鍏宠仈鏍囩 + * + * @param saleId + * @param lableIds + * @return + */ + @Transactional + @RequestMapping(value = "/batchSaveSaleLable", method = RequestMethod.POST) + public Result batchSaveSaleLable(String saleId, String lableIds) { + if(StringUtils.isEmpty(saleId)){ + return ResultUtil.error("璁㈠崟id涓嶈兘涓虹┖!"); + } + if(StringUtils.isEmpty(lableIds)){ + return ResultUtil.error("鏍囩id涓嶈兘涓虹┖!"); + } + try { + // 鍏堝垹锛屽悗澧 + saleLableService.deleteBySaleId(saleId); + saleLableService.batchSaveSaleLable(saleId, lableIds); + } catch (Exception e) { + log.error("鍏宠仈澶辫触", e); + return ResultUtil.error("鍏宠仈澶辫触!"); + } + return ResultUtil.success("鍏宠仈鎴愬姛!"); + } +} diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/entity/Lable.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/entity/Lable.java new file mode 100644 index 00000000..2af5ba4d --- /dev/null +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/entity/Lable.java @@ -0,0 +1,33 @@ +package cc.hiver.mall.lable.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.persistence.Id; + +@Data +@ApiModel(value = "鏍囩琛") +@TableName(value = "t_lable", autoResultMap = true) +public class Lable { + + @Id + @TableId + @ApiModelProperty(value = "鍞竴鏍囪瘑") + private String id; + + @ApiModelProperty(value = "搴楅摵id") + private String shopId; + + @ApiModelProperty(value = "搴楅摵鍚嶇О") + private String shopName; + + @ApiModelProperty(value = "鏍囩鍐呭") + private String lableContent; + + @ApiModelProperty(value = "鏍囩棰滆壊") + private String lableColor; + +} diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/entity/SaleLable.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/entity/SaleLable.java new file mode 100644 index 00000000..01f6c8f7 --- /dev/null +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/entity/SaleLable.java @@ -0,0 +1,22 @@ +package cc.hiver.mall.lable.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.persistence.Id; + +@Data +public class SaleLable { + + @Id + @TableId + @ApiModelProperty(value = "鍞竴鏍囪瘑") + private String id; + + @ApiModelProperty(value = "璁㈠崟id") + private String saleId; + + @ApiModelProperty(value = "鏍囩id") + private String lableId; +} diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/mapper/LableMapper.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/mapper/LableMapper.java new file mode 100644 index 00000000..be16820e --- /dev/null +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/mapper/LableMapper.java @@ -0,0 +1,33 @@ +package cc.hiver.mall.lable.mapper; + +import cc.hiver.mall.lable.entity.Lable; +import cc.hiver.mall.lable.vo.SaleLableVo; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface LableMapper extends BaseMapper { + + /** + * 鏍规嵁saleId鑾峰彇鏍囩淇℃伅 + * + * @param saleIdList + * @return List + * @author 鐜嬪瘜搴 + * @date 2025/2/26 + */ + List getLableListBySaleIdList(@Param("saleIdList") List saleIdList); + + /** + * 鏌ヨ搴楅摵涓嬫墍鏈夋爣绛 + * + * @param shopId + * @return List + * @author 鐜嬪瘜搴 + * @date 2025/2/26 + */ + List getLableListByShopId(@Param("shopId") String shopId); +} diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/mapper/SaleLableMapper.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/mapper/SaleLableMapper.java new file mode 100644 index 00000000..ce0b2f3f --- /dev/null +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/mapper/SaleLableMapper.java @@ -0,0 +1,31 @@ +package cc.hiver.mall.lable.mapper; + +import cc.hiver.mall.lable.entity.SaleLable; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface SaleLableMapper extends BaseMapper { + + /** + * 鏍规嵁璁㈠崟id鍒犻櫎璁㈠崟-鏍囩鍏宠仈 + * + * @param saleId + * @author 鐜嬪瘜搴 + * @date 2025/2/28 + */ + void deleteBySaleId(@Param("saleId") String saleId); + + /** + * 鎵归噺鏂板鍏宠仈鍏崇郴 + * + * @param saleLables + * @return boolean + * @author 鐜嬪瘜搴 + * @date 2025/2/28 + */ + boolean batchSaveSaleLable(@Param("saleLables") List saleLables); +} diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/service/LableService.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/service/LableService.java new file mode 100644 index 00000000..0a3e102d --- /dev/null +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/service/LableService.java @@ -0,0 +1,44 @@ +package cc.hiver.mall.lable.service; + +import cc.hiver.mall.lable.entity.Lable; +import cc.hiver.mall.lable.vo.SaleLableVo; + +import java.util.List; + +public interface LableService { + + /** + * 鏂板/缂栬緫鏍囩 + * @author 鐜嬪瘜搴 + * @date 2025/2/26 + * @param lable + * @return Lable + */ + Lable saveLable(Lable lable); + + /** + * 鍒犻櫎鏍囩锛堢湡鍒犻櫎锛 + * @author 鐜嬪瘜搴 + * @date 2025/2/26 + * @param id + */ + void removeById(String id); + + /** + * 鏍规嵁saleId鑾峰彇鏍囩淇℃伅 + * @author 鐜嬪瘜搴 + * @date 2025/2/26 + * @param saleIdList + * @return List + */ + List getLableListBySaleIdList(List saleIdList); + + /** + * 鏌ヨ搴楅摵涓嬫墍鏈夋爣绛 + * @author 鐜嬪瘜搴 + * @date 2025/2/26 + * @param shopId + * @return List + */ + List getLableListByShopId(String shopId); +} diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/service/SaleLableService.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/service/SaleLableService.java new file mode 100644 index 00000000..55b6d9ef --- /dev/null +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/service/SaleLableService.java @@ -0,0 +1,15 @@ +package cc.hiver.mall.lable.service; + +import cc.hiver.mall.lable.entity.SaleLable; + +public interface SaleLableService { + + SaleLable saveOrEditSaleLable(SaleLable saleLable); + + void removeById(String id); + + void deleteBySaleId(String saleId); + + // 鎵归噺鏂板鍏宠仈 + boolean batchSaveSaleLable(String saleId, String lableIds); +} diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/service/impl/LableServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/service/impl/LableServiceImpl.java new file mode 100644 index 00000000..7e88df28 --- /dev/null +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/service/impl/LableServiceImpl.java @@ -0,0 +1,81 @@ +package cc.hiver.mall.lable.service.impl; + +import cc.hiver.mall.lable.entity.Lable; +import cc.hiver.mall.lable.mapper.LableMapper; +import cc.hiver.mall.lable.service.LableService; +import cc.hiver.mall.lable.vo.SaleLableVo; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.UUID; + +@Service +public class LableServiceImpl extends ServiceImpl implements LableService { + + @Autowired + private LableMapper lableMapper; + + /** + * 鏂板/缂栬緫鏍囩 + * + * @param lable + * @return Lable + * @author 鐜嬪瘜搴 + * @date 2025/2/26 + */ + @Override + public Lable saveLable(Lable lable) { + final String id = lable.getId(); + if (StringUtils.isEmpty(id)) { + // 鏂板 + final String uuid = UUID.randomUUID().toString(); + lable.setId(uuid); + lableMapper.insert(lable); + } else { + // 淇敼 + lableMapper.updateById(lable); + } + return lable; + } + + /** + * 鍒犻櫎鏍囩锛堢湡鍒犻櫎锛 + * + * @param id + * @author 鐜嬪瘜搴 + * @date 2025/2/26 + */ + @Override + public void removeById(String id) { + lableMapper.deleteById(id); + } + + /** + * 鏍规嵁saleId鑾峰彇鏍囩淇℃伅 + * + * @param saleIdList + * @return List + * @author 鐜嬪瘜搴 + * @date 2025/2/26 + */ + @Override + public List getLableListBySaleIdList(List saleIdList) { + return lableMapper.getLableListBySaleIdList(saleIdList); + } + + /** + * 鏌ヨ搴楅摵涓嬫墍鏈夋爣绛 + * + * @param shopId + * @return List + * @author 鐜嬪瘜搴 + * @date 2025/2/26 + */ + @Override + public List getLableListByShopId(String shopId) { + return lableMapper.getLableListByShopId(shopId); + } +} diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/service/impl/SaleLableServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/service/impl/SaleLableServiceImpl.java new file mode 100644 index 00000000..4923d8ba --- /dev/null +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/service/impl/SaleLableServiceImpl.java @@ -0,0 +1,65 @@ +package cc.hiver.mall.lable.service.impl; + +import cc.hiver.core.common.utils.SnowFlakeUtil; +import cc.hiver.mall.lable.entity.SaleLable; +import cc.hiver.mall.lable.mapper.SaleLableMapper; +import cc.hiver.mall.lable.service.SaleLableService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.UUID; + +@Service +public class SaleLableServiceImpl extends ServiceImpl implements SaleLableService { + + @Autowired + private SaleLableMapper saleLableMapper; + + @Override + public SaleLable saveOrEditSaleLable(SaleLable saleLable) { + final String id = saleLable.getId(); + if (StringUtils.isEmpty(id)) { + // 鏂板 + final String uuid = UUID.randomUUID().toString(); + saleLable.setId(uuid); + saleLableMapper.insert(saleLable); + } else { + // 淇敼 + saleLableMapper.updateById(saleLable); + } + return saleLable; + } + + @Override + public void removeById(String id) { + saleLableMapper.deleteById(id); + } + + @Override + public void deleteBySaleId(String saleId) { + saleLableMapper.deleteBySaleId(saleId); + } + + @Override + public boolean batchSaveSaleLable(String saleId, String lableIds) { + // lableIds鏍规嵁閫楀彿鍒嗛殧锛岀劧鍚庣粍鎴怢ist + final String[] split = lableIds.split(","); + final List lableList = new ArrayList<>(); + Collections.addAll(lableList, split); + final List saleLables = new ArrayList<>(); + for (String s : split) { + final SaleLable saleLable = new SaleLable(); + saleLable.setId(String.valueOf(SnowFlakeUtil.nextId())); + saleLable.setSaleId(saleId); + saleLable.setLableId(s); + saleLables.add(saleLable); + } + return saleLableMapper.batchSaveSaleLable(saleLables); + } + +} diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/vo/SaleLableVo.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/vo/SaleLableVo.java new file mode 100644 index 00000000..970dadbb --- /dev/null +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/lable/vo/SaleLableVo.java @@ -0,0 +1,26 @@ +package cc.hiver.mall.lable.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class SaleLableVo { + + @ApiModelProperty(value = "鍞竴鏍囪瘑") + private String id; + + @ApiModelProperty(value = "閿鍞崟id") + private String saleId; + + @ApiModelProperty(value = "搴楅摵id") + private String shopId; + + @ApiModelProperty(value = "搴楅摵鍚嶇О") + private String shopName; + + @ApiModelProperty(value = "鏍囩鍐呭") + private String lableContent; + + @ApiModelProperty(value = "鏍囩棰滆壊") + private String lableColor; +} diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/SaleVO.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/SaleVO.java index 8e22eec9..9d645bdb 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/SaleVO.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/SaleVO.java @@ -43,13 +43,13 @@ public class SaleVO extends HiverBasePageQuery implements Serializable { private PageVo pageVo; @ApiModelProperty(value = "寮濮嬫椂闂") - String startTime; + private String startTime; @ApiModelProperty(value = "缁撴潫鏃堕棿") - String endTime; + private String endTime; @ApiModelProperty(value = "鏌ヨ鏉′欢") - String searchStr; + private String searchStr; /** * 璁㈠崟鐘舵佸紑鍗 @@ -77,8 +77,14 @@ public class SaleVO extends HiverBasePageQuery implements Serializable { private String fromWhere; @ApiModelProperty(value = "鍒犻櫎鏍囪瘑") - String delFlag; + private String delFlag; @ApiModelProperty(value = "瀹㈡埛id(濡傛灉浼犱簡杩欙紝闇瑕佹煡璇㈠鎴风殑璐拱鏁伴噺)") private String customerId; + + @ApiModelProperty(value = "浼0灏辨槸鏍规嵁寮鍗曟椂闂村掑彊锛屼紶1灏辨槸姝e簭") + private String timeOrder; + + @ApiModelProperty(value = "鏄惁閰嶈揣:0:鍚︼紱1锛氭槸") + private String distributionFlag; } \ No newline at end of file diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/purchaseocr/mapper/PurchaseOcrPictureMapper.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/purchaseocr/mapper/PurchaseOcrPictureMapper.java index ec328414..b03d8668 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/purchaseocr/mapper/PurchaseOcrPictureMapper.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/purchaseocr/mapper/PurchaseOcrPictureMapper.java @@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Param; import java.util.List; public interface PurchaseOcrPictureMapper extends BaseMapper { + void batchSave(@Param("purchaseOcrPictureList") List purchaseOcrPictureList); void batchUpdate(@Param("purchaseOcrPictureList") List purchaseOcrPictureAddList); diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/purchaseocr/service/impl/PurchaseOcrPictureServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/purchaseocr/service/impl/PurchaseOcrPictureServiceImpl.java index e4859ed7..b9d296a4 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/purchaseocr/service/impl/PurchaseOcrPictureServiceImpl.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/purchaseocr/service/impl/PurchaseOcrPictureServiceImpl.java @@ -231,15 +231,23 @@ public class PurchaseOcrPictureServiceImpl implements PurchaseOcrPictureService // 灏濊瘯浠庤揣鍙蜂腑鎻愬彇姝g‘鐨勮揣鍙凤紝鍥犱负璐у彿鍙兘鍖呭惈棰滆壊绛変俊鎭 productSn = CommonUtil.getProductSn(productSn); final String productName = object.getString("productName"); - final String priceStr = object.getString("price"); - - BigDecimal price = BigDecimal.ZERO; + final String purchasePriceStr = object.getString("purchasePrice"); + BigDecimal purchasePrice = BigDecimal.ZERO; // 浣跨敤姝e垯琛ㄨ揪寮忔彁鍙栨暟瀛楅儴鍒 final Pattern pattern = Pattern.compile("-?\\d+(\\.\\d+)?"); - final Matcher matcher = pattern.matcher(priceStr); + final Matcher matcher = pattern.matcher(purchasePriceStr); if (matcher.find()) { // 鑾峰彇鍖归厤鍒扮殑鏁板瓧瀛楃涓插苟杞崲涓築igDecimal final String numericPart = matcher.group(); + purchasePrice = new BigDecimal(numericPart); + + } + final String priceStr = object.getString("price"); + BigDecimal price = BigDecimal.ZERO; + final Matcher priceMatcher = pattern.matcher(priceStr); + if (priceMatcher.find()) { + // 鑾峰彇鍖归厤鍒扮殑鏁板瓧瀛楃涓插苟杞崲涓築igDecimal + final String numericPart = priceMatcher.group(); price = new BigDecimal(numericPart); } @@ -280,18 +288,24 @@ public class PurchaseOcrPictureServiceImpl implements PurchaseOcrPictureService purchaseDetail.setProductName(product.getProductName()); purchaseDetail.setShopId(product.getShopId()); purchaseDetail.setCategoryId(categoryId); - purchaseDetail.setPrice(product.getPrice()); - purchaseDetail.setWholesalePrice(product.getWholesalePrice()); + // purchaseDetail.setPrice(product.getPrice()); + // purchaseDetail.setWholesalePrice(product.getWholesalePrice()); purchaseDetail.setProductPicture(product.getProductPicture()); purchaseDetail.setProductSn(product.getProductSn()); purchaseDetail.setProductCount(0); purchaseDetail.setSupplierName(product.getSupplierName()); purchaseDetail.setCustomerCategoryRule(product.getCustomerCategoryRule()); // ai璇煶鍏ュ簱鏃у晢鍝 濡傛灉閫氫箟鍗冮棶杩斿洖鐨勪环鏍间负0锛岃繑鍥炲綋鍓嶉噰璐环 锛岄噰璐环锛歱urchasePrice - if (price.compareTo(BigDecimal.ZERO) == 0) { + if (purchasePrice.compareTo(BigDecimal.ZERO) == 0) { purchaseDetail.setPurchasePrice(product.getPurchasePrice()); } else { - purchaseDetail.setPurchasePrice(price); + purchaseDetail.setPurchasePrice(purchasePrice); + } + // ai璇煶鍏ュ簱鏃у晢鍝 濡傛灉閫氫箟鍗冮棶杩斿洖鐨勪环鏍间负0锛岃繑鍥炲綋鍓嶉浂鍞环 锛岄浂鍞环锛歱rice + if (price.compareTo(BigDecimal.ZERO) == 0) { + purchaseDetail.setPrice(product.getPrice()); + } else { + purchaseDetail.setPrice(price); } // ai璇煶鍏ュ簱鏃у晢鍝 濡傛灉閫氫箟鍗冮棶杩斿洖鐨勪环鏍间负0锛岃繑鍥炲綋鍓嶆壒鍙戜环 锛屾壒鍙戜环锛歸holesalePrice if (wholesalePrice.compareTo(BigDecimal.ZERO) == 0) { @@ -434,7 +448,8 @@ public class PurchaseOcrPictureServiceImpl implements PurchaseOcrPictureService purchaseDetail.setId(StringUtils.isEmpty(productSn) ? productName : productSn); purchaseDetail.setProductName(productName); purchaseDetail.setProductSn(productSn); - purchaseDetail.setPurchasePrice(price); + purchaseDetail.setPrice(price); + purchaseDetail.setPurchasePrice(purchasePrice); purchaseDetail.setWholesalePrice(wholesalePrice); purchaseDetail.setProductCount(0); // 鑾峰彇榛樿鍒嗙被 diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/SaleService.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/SaleService.java index 7ab882a5..8b20827b 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/SaleService.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/SaleService.java @@ -168,4 +168,21 @@ public interface SaleService extends IService { * @return CustomerDataVo */ CustomerDataVo getCustomerSaleInfo(CustomerPageQuery customerPageQuery); + + /** + * 鏍规嵁saleid鏇存柊閰嶈揣鐘舵佺殑 + * @author 鐜嬪瘜搴 + * @date 2025/2/26 + * @param saleId + * @param distributionFlag + */ + void updateDistributionFlag(String saleId, String distributionFlag); + + /** + * 鏇存柊鎵撳嵃娆℃暟+1 + * @author 鐜嬪瘜搴 + * @date 2025/2/26 + * @param saleId + */ + void updatePrintCount(String saleId); } diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/SaleServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/SaleServiceImpl.java index 65e0fb80..1f788395 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/SaleServiceImpl.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/SaleServiceImpl.java @@ -22,6 +22,8 @@ import cc.hiver.mall.debt.entity.Debt; import cc.hiver.mall.debt.service.DebtService; import cc.hiver.mall.deductlog.service.DeductLogService; import cc.hiver.mall.entity.*; +import cc.hiver.mall.lable.service.LableService; +import cc.hiver.mall.lable.vo.SaleLableVo; import cc.hiver.mall.pojo.dto.*; import cc.hiver.mall.pojo.query.CustomerPageQuery; import cc.hiver.mall.pojo.query.SalePageQuery; @@ -122,6 +124,9 @@ public class SaleServiceImpl extends ServiceImpl implements Sa @Autowired private ReturnDetailService returnDetailService; + @Autowired + private LableService lableService; + @Override public void editPayPrice(String id, BigDecimal price, String dealingsWay) { // 淇敼閲囪喘鍗曘佸疄浠樸佹湭浠橀噾棰 @@ -252,14 +257,40 @@ public class SaleServiceImpl extends ServiceImpl implements Sa for (BuyCountVo buyCountVo : buyCount) { buyCountMap.put(buyCountVo.getProductId(), buyCountVo.getBuyCount()); } - if(sale != null && sale.getSaleDetailDTOList() != null){ + if (sale != null && sale.getSaleDetailDTOList() != null) { for (SaleDetailDTO saleDetailDTO : sale.getSaleDetailDTOList()) { - String productId = saleDetailDTO.getProductId(); + final String productId = saleDetailDTO.getProductId(); saleDetailDTO.setBuyCount(buyCountMap.getOrDefault(productId, 0)); } } } + // 鑾峰彇saleId + final List saleIdList = new ArrayList<>(); + for (Sale sale : saleList.getRecords()) { + saleIdList.add(sale.getId()); + } + // 鏍规嵁saleId鑾峰彇鏍囩淇℃伅 + if (!saleIdList.isEmpty()) { + final List lableList = lableService.getLableListBySaleIdList(saleIdList); + // 鏍规嵁saleId鍒嗙粍涓簃ap + final Map> lableMap = new HashMap<>(); + for (SaleLableVo saleLableVo : lableList) { + if (lableMap.containsKey(saleLableVo.getSaleId())) { + lableMap.get(saleLableVo.getSaleId()).add(saleLableVo); + } else { + final List saleLableVoList = new ArrayList<>(); + saleLableVoList.add(saleLableVo); + lableMap.put(saleLableVo.getSaleId(), saleLableVoList); + } + } + // 鏀惧叆杩斿洖鏁版嵁涓 + for (Sale sale : saleList.getRecords()) { + if (lableMap.containsKey(sale.getId())) { + sale.setLableList(lableMap.get(sale.getId())); + } + } + } return saleList; } @@ -435,10 +466,10 @@ public class SaleServiceImpl extends ServiceImpl implements Sa } List customerBuySaleVoList = new ArrayList<>(); // 鑾峰彇鍘嗘閿鍞崟鐨勪俊鎭 - if(StringUtils.isNotEmpty(userId)){ + if (StringUtils.isNotEmpty(userId)) { customerBuySaleVoList = saleMapper.getByUserId(userId); } - if(StringUtils.isNotEmpty(createBy)){ + if (StringUtils.isNotEmpty(createBy)) { customerBuySaleVoList = saleMapper.getByCreUserId(createBy); } final Map customerBuySaleVoMap = new HashMap<>(); @@ -447,7 +478,7 @@ public class SaleServiceImpl extends ServiceImpl implements Sa } if (!productIds.isEmpty()) { // 鑾峰彇鍟嗗搧鍚勮鏍煎敭鍗栫殑鏁伴噺 - final List customerBuyProductDetailLogVos = saleMapper.getCustomerBuyProductLogDetailLog(userId,createBy, salePageQuery.getShopId(), productIds, salePageQuery.getStartDate(), salePageQuery.getEndDate()); + final List customerBuyProductDetailLogVos = saleMapper.getCustomerBuyProductLogDetailLog(userId, createBy, salePageQuery.getShopId(), productIds, salePageQuery.getStartDate(), salePageQuery.getEndDate()); // 杩涜鏁版嵁灏佽Map<鍟嗗搧id,Map<閿鍞崟id,鍟嗗搧鏄庣粏>> final Map>> allMap = new HashMap<>(); @@ -663,7 +694,7 @@ public class SaleServiceImpl extends ServiceImpl implements Sa } @Override - public JSONObject buyAi(String aiMsg, String customerId,String singleProductId) { + public JSONObject buyAi(String aiMsg, String customerId, String singleProductId) { final JSONObject returnJsonObject = new JSONObject(); // 鍙夎浆X 鏂囨湰绾犻敊 浣跨敤姝e垯琛ㄨ揪寮忔浛鎹㈠崟涓垨澶氫釜杩炵画鐨勨滃弶鈥濆瓧绗 aiMsg = replaceAllX(aiMsg); @@ -676,7 +707,7 @@ public class SaleServiceImpl extends ServiceImpl implements Sa final String resultContent = jsonObject.get("resultContent").toString(); final JSONArray json = JSON.parseArray(resultContent); // 鏃у晢鍝佺殑id闆嗗悎 - List oldProductIdList = new ArrayList<>(); + final List oldProductIdList = new ArrayList<>(); for (int i = 0; i < json.size(); i++) { final JSONObject object = json.getJSONObject(i); String productSn = object.getString("productSn"); @@ -697,14 +728,14 @@ public class SaleServiceImpl extends ServiceImpl implements Sa // 瀹氫箟涓涓猰ap,璐у彿涓簁ey,purchaseDetail 涓簐alue final Map purchaseDetailMap = new HashMap<>(); // 鏍规嵁璐у彿鍘绘煡璇㈠晢鍝侊紝濡傛灉 - final List byProductSn = productService.getByProductSn(productSn, shopId,""); + final List byProductSn = productService.getByProductSn(productSn, shopId, ""); if (StringUtils.isNotEmpty(singleProductId) || (byProductSn != null && !byProductSn.isEmpty())) { // 鍘熷垯涓婁竴涓簵閾轰竴涓揣鍙峰搴斾竴涓晢鍝侊紝杩欓噷濡傛灉鏌ュ埌浜嗭紝鐩存帴鎷跨涓涓 Product product = new Product(); - if(!byProductSn.isEmpty()){ + if (!byProductSn.isEmpty()) { product = byProductSn.get(0); } - if(StringUtils.isNotEmpty(singleProductId)){ + if (StringUtils.isNotEmpty(singleProductId)) { // 20240928 app/sale/buyAi鎺ュ彛鍔犱釜鍙傛暟productId锛屽鏋滀紶鍊间簡锛屾煡瑙勬牸搴撳瓨鏁扮殑鏃跺欏氨鏌ヨ繖娆惧晢鍝佺殑 product = productService.getById(singleProductId); } @@ -892,9 +923,9 @@ public class SaleServiceImpl extends ServiceImpl implements Sa } // 濡傛灉瀹㈡埛id涓嶄负绌猴紝閭d箞灏辨煡璇㈠晢鍝佺殑璐拱璁板綍 - if(StringUtils.isNotEmpty(customerId)){ + if (StringUtils.isNotEmpty(customerId)) { // 鑾峰彇瀹㈡埛鐨勮喘涔版鏁 - final List buyCount = buyCount(customerId,oldProductIdList); + final List buyCount = buyCount(customerId, oldProductIdList); // 灏佽涓篗ap final Map buyCountMap = new HashMap<>(); for (BuyCountVo buyCountVo : buyCount) { @@ -1319,34 +1350,35 @@ public class SaleServiceImpl extends ServiceImpl implements Sa */ @Override public List buyCount(String customerId, List productIdList) { - if(StringUtils.isEmpty(customerId) || productIdList.isEmpty()){ + if (StringUtils.isEmpty(customerId) || productIdList.isEmpty()) { return new ArrayList<>(); } - return saleMapper.buyCount(customerId,productIdList); + return saleMapper.buyCount(customerId, productIdList); } /** * 鏌ヨ瀹㈡埛 鎷胯揣锛堟婚噾棰濓級鍟嗗搧鎬绘鏁般佹讳欢鏁 - * @author 鐜嬪瘜搴 - * @date 2024/10/24 + * * @param customerPageQuery * @return CustomerDataVo + * @author 鐜嬪瘜搴 + * @date 2024/10/24 */ @Override public CustomerDataVo getCustomerSaleInfo(CustomerPageQuery customerPageQuery) { final CustomerDataVo customerDataVo = new CustomerDataVo(); // 鏌ヨ瀹㈡埛 鎷胯揣锛堟婚噾棰濓級鍟嗗搧鎬绘鏁 final CustomerDataVo salePrice = saleMapper.getSalePrice(customerPageQuery); - if(salePrice != null){ + if (salePrice != null) { customerDataVo.setSalePrice(salePrice.getSalePrice()); - }else{ + } else { customerDataVo.setSalePrice("0.00"); } // 鏌ヨ瀹㈡埛 鎬讳欢鏁 List saleCount = saleMapper.getSaleCount(customerPageQuery); - if(saleCount == null ){ + if (saleCount == null) { saleCount = new ArrayList<>(); } customerDataVo.setSaleCount(saleCount.size()); @@ -1354,6 +1386,31 @@ public class SaleServiceImpl extends ServiceImpl implements Sa return customerDataVo; } + /** + * 鏍规嵁saleid鏇存柊閰嶈揣鐘舵佺殑 + * + * @param saleId + * @param distributionFlag + * @author 鐜嬪瘜搴 + * @date 2025/2/26 + */ + @Override + public void updateDistributionFlag(String saleId, String distributionFlag) { + saleMapper.updateDistributionFlag(saleId, distributionFlag); + } + + /** + * 鎵撳嵃娆℃暟鏇存柊+1 + * + * @param saleId + * @author 鐜嬪瘜搴 + * @date 2025/2/26 + */ + @Override + public void updatePrintCount(String saleId) { + saleMapper.updatePrintCount(saleId); + } + /** * 浣跨敤姝e垯琛ㄨ揪寮忔浛鎹㈣緭鍏ュ瓧绗︿覆涓繛缁殑鈥滃弶鈥濆瓧绗︿负鐩稿簲鏁伴噺鐨勨淴鈥濆瓧绗︺ * diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/StockServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/StockServiceImpl.java index bfff6906..1c0454d8 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/StockServiceImpl.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/StockServiceImpl.java @@ -1188,6 +1188,8 @@ public class StockServiceImpl extends ServiceImpl implements // 鏇存柊閭d簺鏈叆搴撳氨杩涜閿鍞攢鍞鎯呫佸簱瀛樺饱鍘嗐佸簱瀛樿〃鐨勯噰璐环 saleDetailService.putInUpdatePurchasePrice(purchaseDetails); + // 鍏ュ簱鍗曞姞涓涓瓧娈碉細鏄惁纭鍏ュ簱锛坅pp/stock/putInPriceOfAi锛夎繖涓帴鍙h缃负寰呯‘璁 + purchase.setStoreFlag(PurchaseConstant.STORE_FLAG[0]); //3.鐧昏閲囪喘鍗曚富琛ㄥ拰閲囪喘鍗曟槑缁嗚〃 // log.debug("淇濆瓨鍓嶇殑鍏ュ簱鏃堕棿==="+DateUtil.COMMON_FULL.getDateText(purchase.getCreateTime())+"===="+DateUtil.COMMON_FULL.getDateText(purchase.getPurchaseTime())); final boolean saveOrUpdateFlag; diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/utils/AliOcrUtil.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/utils/AliOcrUtil.java index 3f5102ad..dc095698 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/utils/AliOcrUtil.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/utils/AliOcrUtil.java @@ -891,8 +891,8 @@ public class AliOcrUtil { final Message systemMsg = Message.builder().role(Role.SYSTEM.getValue()).content("You are a helpful assistant.").build(); // questionMsg += "璇峰府鎴戞妸鎵鏈夊唴瀹瑰皝瑁呬负JSON锛宩son鏍煎紡涓猴細[{ \"productSn\": \"璐у彿\", \"productName\": \"鍚嶇О\" , \"price\":\"鍗曚环\",\"attributeList\": [{\"color\":\"棰滆壊\",\"size\":\"灏虹爜\",\"productCount\": \"鏁伴噺\"}] }]銆備互涓嬫槸鍑犵偣瑕佹眰锛 1.鈥滆揣鍙封濅袱涓瓧鍜孿"鍚嶇О\"涓や釜瀛椾腑闂寸殑鍐呭浠h〃productSn鐨勫,濡傛灉娌℃湁鍚嶇О鍒欌滆揣鍙封濅袱涓瓧鍜岄鑹蹭腑闂寸殑鍐呭浠h〃productSn鐨勫硷紝productSn鍙兘鍖呭惈\"鏂癨"銆乗"閫\"銆乗"鏃"銆乗"鎹"銆乗"琛"銆2.\"SYYS鑹瞈"浠h〃鈥滄墍鏈夐鑹测濓紝\"color\"瀛楁杩斿洖鈥淪YYS鑹测濄 3.\"SYCM鐮乗"浠h〃鈥滄墍鏈夊昂鐮佲濓紝\"size\"瀛楁杩斿洖鈥淪YCM鐮佲濄4.濡傛灉娌℃湁鍚嶇О锛宲roductName瀛楁杩斿洖\"\"銆5.鍙緭鍑篔SON鏁版嵁鍗冲彲锛屼笉鐢ㄨ繑鍥炲瓧娈垫弿杩板拰瑙f瀽杩囩▼銆"; - questionMsg += "浣犳槸涓涓湇瑁呰涓氬簱绠′笓瀹讹紝璇峰府鎴戞妸鎵鏈夊唴瀹瑰皝瑁呬负JSON锛宩son鏍煎紡涓猴細[{ \"productSn\": \"璐у彿\", \"productName\": \"鍚嶇О\" , \"attributeList\": [{\"color\":\"棰滆壊\",\"size\":\"灏虹爜\",\"productCount\": \"鏁伴噺\"}], \"price\":\"鍗曚环\" , \"wholesalePrice\":\"鎵瑰彂浠穃" }]\n" + - "1.濡傛灉娌℃湁璇嗗埆鍒癨"price\"鐨勫唴瀹癸紝鍒橽"price\"璧嬪糪"0\"銆傚鏋滄病鏈夎瘑鍒埌\"wholesalePrice\"鐨勫唴瀹癸紝鍒橽"wholesalePrice\"璧嬪糪"0\"銆俓n" + + questionMsg += "浣犳槸涓涓湇瑁呰涓氬簱绠′笓瀹讹紝璇峰府鎴戞妸鎵鏈夊唴瀹瑰皝瑁呬负JSON锛宩son鏍煎紡涓猴細[{ \"productSn\": \"璐у彿\", \"productName\": \"鍚嶇О\" , \"attributeList\": [{\"color\":\"棰滆壊\",\"size\":\"灏虹爜\",\"productCount\": \"鏁伴噺\"}], \"purchasePrice\":\"鍗曚环\" , \"price\":\"闆跺敭浠穃" , \"wholesalePrice\":\"鎵瑰彂浠穃" }]\n" + + "1.濡傛灉娌℃湁璇嗗埆鍒癨"purchasePrice\"鐨勫唴瀹癸紝鍒橽"purchasePrice\"璧嬪糪"0\"銆傚鏋滄病鏈夎瘑鍒埌\"price\"鐨勫唴瀹癸紝鍒橽"price\"璧嬪糪"0\"銆傚鏋滄病鏈夎瘑鍒埌\"wholesalePrice\"鐨勫唴瀹癸紝鍒橽"wholesalePrice\"璧嬪糪"0\"銆俓n" + "2.濡傛灉娌℃湁璇嗗埆鍒癨"productSn\"鐨勫唴瀹癸紝鍒橽"productSn\"璧嬪糪"\"銆俓n" + "3.濡傛灉娌℃湁璇嗗埆鍒癨"productName\"鐨勫唴瀹癸紝鍒橽"productName\"浣跨敤\"productSn\"鐨勫煎~鍏呫俓n" + "4.濡傛灉璇嗗埆鍒板绉嶉鑹诧紝鎸変笉鍚岄鑹叉媶鍒嗚繑鍥炪傚鏋滄病鏈夎瘑鍒埌\"color\"鐨勫唴瀹癸紝鍒橽"color\"璧嬪尖滃潎鑹测濓紝濡傛灉娌℃湁璇嗗埆鍒癨"size\"鐨勫唴瀹癸紝鍒橽"size\"璧嬪尖滃潎鐮佲濓紝杩斿洖涓鏉SON鏁版嵁鍗冲彲銆俓n" + diff --git a/hiver-modules/hiver-mall/src/main/resources/mapper/LableMapper.xml b/hiver-modules/hiver-mall/src/main/resources/mapper/LableMapper.xml new file mode 100644 index 00000000..a6609648 --- /dev/null +++ b/hiver-modules/hiver-mall/src/main/resources/mapper/LableMapper.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + id, shop_id, shop_name, lable_content, lable_color + + + + + + \ No newline at end of file diff --git a/hiver-modules/hiver-mall/src/main/resources/mapper/PurchaseMapper.xml b/hiver-modules/hiver-mall/src/main/resources/mapper/PurchaseMapper.xml index 8c3c5994..b82e4bf0 100644 --- a/hiver-modules/hiver-mall/src/main/resources/mapper/PurchaseMapper.xml +++ b/hiver-modules/hiver-mall/src/main/resources/mapper/PurchaseMapper.xml @@ -21,6 +21,7 @@ + @@ -90,7 +91,7 @@ id, create_by,create_by_name, create_time, del_flag, update_by, update_time, supplier_id,supplier_name, shop_id, total_amount, should_pay, already_pay, no_pay,other_pay, in_storage_status,remark, balance_deduction_amount, - purchase_time + purchase_time,store_flag @@ -307,6 +329,9 @@ purchase_time = #{record.purchaseTime,jdbcType=TIMESTAMP}, + + store_flag = #{record.storeFlag,jdbcType=INTEGER}, + @@ -332,7 +357,8 @@ in_storage_status = #{record.inStorageStatus,jdbcType=INTEGER}, remark = #{record.remark,jdbcType=VARCHAR}, balance_deduction_amount = #{record.balanceDeductionAmount,jdbcType=DECIMAL}, - purchase_time = #{record.purchaseTime,jdbcType=TIMESTAMP} + purchase_time = #{record.purchaseTime,jdbcType=TIMESTAMP}, + store_flag = #{record.storeFlag,jdbcType=INTEGER} @@ -394,6 +420,9 @@ purchase_time = #{purchaseTime,jdbcType=TIMESTAMP}, + + store_flag = #{storeFlag,jdbcType=INTEGER}, + where id = #{id,jdbcType=VARCHAR} @@ -416,7 +445,8 @@ in_storage_status = #{inStorageStatus,jdbcType=INTEGER}, remark = #{remark,jdbcType=INTEGER}, balance_deduction_amount = #{balanceDeductionAmount,jdbcType=DECIMAL}, - purchase_time = #{purchaseTime,jdbcType=TIMESTAMP} + purchase_time = #{purchaseTime,jdbcType=TIMESTAMP}, + store_flag = #{storeFlag,jdbcType=INTEGER} where id = #{id,jdbcType=VARCHAR} diff --git a/hiver-modules/hiver-mall/src/main/resources/mapper/SaleLableMapper.xml b/hiver-modules/hiver-mall/src/main/resources/mapper/SaleLableMapper.xml new file mode 100644 index 00000000..11e59d75 --- /dev/null +++ b/hiver-modules/hiver-mall/src/main/resources/mapper/SaleLableMapper.xml @@ -0,0 +1,27 @@ + + + + + + + + + + id, sale_id, lable_id + + + + delete + from t_sale_lable + where sale_id = #{saleId,jdbcType=VARCHAR} + + + + insert into t_sale_lable (id, sale_id, lable_id) values + + (#{saleLable.id,jdbcType=VARCHAR},#{saleLable.saleId,jdbcType=VARCHAR}, + #{saleLable.lableId,jdbcType=VARCHAR}) + + + + \ No newline at end of file diff --git a/hiver-modules/hiver-mall/src/main/resources/mapper/SaleMapper.xml b/hiver-modules/hiver-mall/src/main/resources/mapper/SaleMapper.xml index 8bbb5cc7..473e9272 100644 --- a/hiver-modules/hiver-mall/src/main/resources/mapper/SaleMapper.xml +++ b/hiver-modules/hiver-mall/src/main/resources/mapper/SaleMapper.xml @@ -45,6 +45,8 @@ + + @@ -107,7 +109,7 @@ id, create_by, create_by_name, create_time, del_flag, update_by, update_by_name, update_time, user_id, user_name, shop_id, shop_name, total_amount, discount, discount_amount, real_amount, debt_deduction_amount, sale_deduction_amount, balance_deduction_amount, already_earn, no_earn, pay_status,pay_type, status, other_expense, transport_type, share_address, receive_address, province, city, area, -trans_company, company_name, product_count, remark, sale_name, company_phone, create_by_phone,mode_of_service,ai_flag,ai_result,ai_not_recognition +trans_company, company_name, product_count, remark, sale_name, company_phone, create_by_phone,mode_of_service,ai_flag,ai_result,ai_not_recognition,print_count,distribution_flag @@ -754,7 +784,7 @@ trans_company, company_name, product_count, remark, sale_name, company_phone, cr ts.shop_id,ts.shop_name,ts.total_amount,ts.discount,ts.discount_amount,ts.real_amount,ts.debt_deduction_amount,ts.sale_deduction_amount,ts.balance_deduction_amount ,ts.already_earn,ts.no_earn,ts.pay_status, ts.pay_type,ts.status,ts.other_expense,ts.transport_type,ts.share_address,ts.receive_address,ts.province,ts.city,ts.area, ts.trans_company,ts.company_name,ts.product_count,ts.remark,ts.sale_name,ts.company_phone,ts.create_by_phone,ts.mode_of_service, - ts.ai_flag,ts.ai_result,ts.ai_not_recognition, + ts.ai_flag,ts.ai_result,ts.ai_not_recognition,ts.print_count,ts.distribution_flag, ss.return_sale_product_count,ss.return_sale_amount from t_sale ts @@ -822,7 +852,7 @@ trans_company, company_name, product_count, remark, sale_name, company_phone, cr ts.sale_deduction_amount,ts.balance_deduction_amount ,ts.already_earn,ts.no_earn,ts.pay_status,ts.pay_type,ts.status, ts.other_expense,ts.transport_type,ts.share_address,ts.receive_address,ts.province,ts.city,ts.area, ts.trans_company,ts.company_name,ts.product_count,ts.remark,ts.sale_name,ts.company_phone,ts.create_by_phone,ts.mode_of_service, - ts.ai_flag,ts.ai_result,ts.ai_not_recognition, + ts.ai_flag,ts.ai_result,ts.ai_not_recognition,ts.print_count,ts.distribution_flag, trs.return_sale_total_amount ,trs.return_sale_product_count, tdr.last_debt_amount FROM @@ -858,7 +888,7 @@ trans_company, company_name, product_count, remark, sale_name, company_phone, cr ) - + and ts.status = #{saleVO.status} @@ -872,7 +902,7 @@ trans_company, company_name, product_count, remark, sale_name, company_phone, cr and ts.status = #{saleVO.status} - + and ts.transport_type = #{saleVO.transportType} @@ -882,13 +912,32 @@ trans_company, company_name, product_count, remark, sale_name, company_phone, cr and ts.create_time BETWEEN #{saleVO.startTime} AND #{saleVO.endTime} + + and ts.distribution_flag = #{saleVO.distributionFlag} + and (ts.user_name like concat('%',#{saleVO.searchStr},'%') or ts.create_by_name like concat('%',#{saleVO.searchStr},'%') or ts.id like concat('%',#{saleVO.searchStr},'%')) - order by ts.create_time desc + + + + order by ts.create_time desc + + + order by ts.create_time asc + + + + order by ts.create_time desc + + + + + order by ts.create_time desc + + + + update t_sale + set + distribution_flag = #{distributionFlag,jdbcType=VARCHAR} + where id = #{saleId,jdbcType=VARCHAR} + + + + update t_sale + set + print_count = COALESCE(print_count, 0) + 1 + where id = #{saleId,jdbcType=VARCHAR} + \ No newline at end of file