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
@@ -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
@@ -148,7 +150,7 @@ trans_company, company_name, product_count, remark, sale_name, company_phone, cr
already_earn, no_earn, pay_status,pay_type,
status, transport_type, share_address,
receive_address, province, city,
- area,sale_name,remark,other_expense,trans_company,company_name,company_phone,product_count,create_by_phone,mode_of_service,ai_flag,ai_result,ai_not_recognition)
+ area,sale_name,remark,other_expense,trans_company,company_name,company_phone,product_count,create_by_phone,mode_of_service,ai_flag,ai_result,ai_not_recognition,print_count,distribution_flag)
values (#{id,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},#{createByName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{delFlag,jdbcType=INTEGER}, #{updateBy,jdbcType=VARCHAR},#{updateByName,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
#{userId,jdbcType=VARCHAR},#{userName,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR},#{shopName,jdbcType=VARCHAR}, #{totalAmount,jdbcType=DECIMAL},
@@ -160,7 +162,7 @@ trans_company, company_name, product_count, remark, sale_name, company_phone, cr
#{area,jdbcType=VARCHAR}, #{saleName,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
#{otherExpense,jdbcType=VARCHAR},#{transCompany,jdbcType=VARCHAR},#{companyName,jdbcType=VARCHAR},#{companyPhone,jdbcType=VARCHAR},
#{productCount,jdbcType=INTEGER},#{createByPhone,jdbcType=VARCHAR},#{modeOfService,jdbcType=VARCHAR},
- #{aiFlag,jdbcType=VARCHAR},#{aiResult,jdbcType=VARCHAR},#{aiNotRecognition,jdbcType=VARCHAR})
+ #{aiFlag,jdbcType=VARCHAR},#{aiResult,jdbcType=VARCHAR},#{aiNotRecognition,jdbcType=VARCHAR},#{printCount,jdbcType=INTEGER},#{distributionFlag,jdbcType=VARCHAR})
insert into t_sale
@@ -276,6 +278,12 @@ trans_company, company_name, product_count, remark, sale_name, company_phone, cr
ai_not_recognition,
+
+ print_count,
+
+
+ distribution_flag,
+
@@ -386,6 +394,12 @@ trans_company, company_name, product_count, remark, sale_name, company_phone, cr
#{aiNotRecognition,jdbcType=VARCHAR},
+
+ #{printCount,jdbcType=INTEGER},
+
+
+ #{distributionFlag,jdbcType=VARCHAR},
+
@@ -509,6 +523,12 @@ trans_company, company_name, product_count, remark, sale_name, company_phone, cr
ai_not_recognition = #{record.aiNotRecognition,jdbcType=VARCHAR},
+
+ print_count = #{record.printCount,jdbcType=INTEGER},
+
+
+ distribution_flag = #{record.distributionFlag,jdbcType=VARCHAR},
+
@@ -552,7 +572,9 @@ trans_company, company_name, product_count, remark, sale_name, company_phone, cr
mode_of_service = #{record.modeOfService,jdbcType=VARCHAR},
ai_flag = #{record.aiFlag,jdbcType=INTEGER},
ai_result = #{record.aiResult,jdbcType=VARCHAR},
- ai_not_recognition = #{record.aiNotRecognition,jdbcType=VARCHAR}
+ ai_not_recognition = #{record.aiNotRecognition,jdbcType=VARCHAR},
+ print_count = #{record.printCount,jdbcType=INTEGER},
+ distribution_flag = #{record.distributionFlag,jdbcType=VARCHAR}
@@ -668,6 +690,12 @@ trans_company, company_name, product_count, remark, sale_name, company_phone, cr
ai_not_recognition = #{aiNotRecognition,jdbcType=VARCHAR},
+
+ print_count = #{printCount,jdbcType=INTEGER},
+
+
+ distribution_flag = #{distributionFlag,jdbcType=VARCHAR},
+
where id = #{id,jdbcType=VARCHAR}
@@ -708,7 +736,9 @@ trans_company, company_name, product_count, remark, sale_name, company_phone, cr
mode_of_service = #{modeOfService,jdbcType=VARCHAR},
ai_flag = #{aiFlag,jdbcType=INTEGER},
ai_result = #{aiResult,jdbcType=VARCHAR},
- ai_not_recognition = #{aiNotRecognition,jdbcType=VARCHAR}
+ ai_not_recognition = #{aiNotRecognition,jdbcType=VARCHAR},
+ print_count = #{printCount,jdbcType=INTEGER},
+ distribution_flag = #{distributionFlag,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
@@ -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
+
@@ -1453,4 +1502,18 @@ GROUP BY
GROUP BY
dd.product_id
+
+
+ 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