diff --git a/pom.xml b/pom.xml index 3debfd4..41b1491 100644 --- a/pom.xml +++ b/pom.xml @@ -14,6 +14,7 @@ 1.0.0 + true 8 8 UTF-8 diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductMapper.java index f563f93..29711bd 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductMapper.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductMapper.java @@ -1,46 +1,27 @@ package com.chaozhanggui.system.cashierservice.dao; import com.chaozhanggui.system.cashierservice.entity.TbProduct; -import com.chaozhanggui.system.cashierservice.entity.TbProductWithBLOBs; import com.chaozhanggui.system.cashierservice.entity.po.ProConsSkuInfo; -import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; -import org.springframework.stereotype.Component; import java.math.BigDecimal; import java.util.List; public interface TbProductMapper { - int deleteByPrimaryKey(Integer id); - int insert(TbProductWithBLOBs record); - - int insertSelective(TbProductWithBLOBs record); - - TbProductWithBLOBs selectByPrimaryKey(Integer id); - - int updateByPrimaryKeySelective(TbProductWithBLOBs record); - - int updateByPrimaryKeyWithBLOBs(TbProductWithBLOBs record); - - int updateByPrimaryKey(TbProduct record); - - - List selectByShopId(@Param("shopId") String shopId,@Param("commdityName") String commdityName); - List selectByShopIdAndCheckGrounding(@Param("shopId") String shopId,@Param("commdityName") String commdityName); - - - - List selectByShopIdAndShopType(@Param("shopId") String shopId, @Param("categoryId") String categoryId,@Param("commdityName") String commdityName); - List selectByShopIdAndShopTypeCheckGrounding(@Param("shopId") String shopId, @Param("categoryId") String categoryId,@Param("commdityName") String commdityName); - List selectByShopIdAndShopTypeUnGrounding(@Param("shopId") String shopId,@Param("commdityName") String commdityName); + TbProduct selectByPrimaryKey(Integer id); + List selectByShopId(@Param("shopId") String shopId,@Param("commdityName") String commdityName); + List selectByShopIdAndCheckGrounding(@Param("shopId") String shopId,@Param("commdityName") String commdityName); + List selectByShopIdAndShopType(@Param("shopId") String shopId, @Param("categoryId") String categoryId,@Param("commdityName") String commdityName); + List selectByShopIdAndShopTypeCheckGrounding(@Param("shopId") String shopId, @Param("categoryId") String categoryId,@Param("commdityName") String commdityName); + List selectByShopIdAndShopTypeUnGrounding(@Param("shopId") String shopId,@Param("commdityName") String commdityName); Integer countOrderByshopIdAndProductId(@Param("shopId") String shopId, @Param("productId") String productId, @Param("masterId") String masterId,@Param("day") String day, @Param("tableId") String tableId); - + @Update("update tb_product set stock_number = stock_number - #{num,jdbcType=INTEGER} where id = #{productId}") void updateStockById(@Param("productId")Integer productId, @Param("num")Integer num); diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductStockDetail.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductStockDetail.java index 1328ac2..bdda082 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductStockDetail.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductStockDetail.java @@ -12,7 +12,7 @@ public class TbProductStockDetail implements Serializable { private String productName; - private Byte isStock; + private Integer isStock; private String specSnap; @@ -90,11 +90,11 @@ public class TbProductStockDetail implements Serializable { this.productName = productName == null ? null : productName.trim(); } - public Byte getIsStock() { + public Integer getIsStock() { return isStock; } - public void setIsStock(Byte isStock) { + public void setIsStock(Integer isStock) { this.isStock = isStock; } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductWithBLOBs.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductWithBLOBs.java deleted file mode 100644 index 3302de2..0000000 --- a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductWithBLOBs.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.chaozhanggui.system.cashierservice.entity; - -import lombok.Getter; - -import java.io.Serializable; -import java.util.List; - -@Getter -public class TbProductWithBLOBs extends TbProduct implements Serializable { - private Object groundingSpecInfo; - private String images; - - private String video; - - private String notice; - - private String groupSnap; - - private String specInfo; - - private String selectSpec; - - private List skuList; - - private static final long serialVersionUID = 1L; - - public void setGroundingSpecInfo(Object groundingSpecInfo) { - this.groundingSpecInfo = groundingSpecInfo; - } - - public void setSkuList(List skuList) { - this.skuList = skuList; - } - - public void setImages(String images) { - this.images = images == null ? null : images.trim(); - } - - public void setVideo(String video) { - this.video = video == null ? null : video.trim(); - } - - public void setNotice(String notice) { - this.notice = notice == null ? null : notice.trim(); - } - - public void setGroupSnap(String groupSnap) { - this.groupSnap = groupSnap == null ? null : groupSnap.trim(); - } - - public void setSpecInfo(String specInfo) { - this.specInfo = specInfo == null ? null : specInfo.trim(); - } - - public void setSelectSpec(String selectSpec) { - this.selectSpec = selectSpec == null ? null : selectSpec.trim(); - } -} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/ProductGroupVo.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/ProductGroupVo.java new file mode 100644 index 0000000..61d7a28 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/ProductGroupVo.java @@ -0,0 +1,34 @@ +package com.chaozhanggui.system.cashierservice.entity.vo; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class ProductGroupVo { + + private Integer count; + //选几个 + private Integer number; + //类别 + private String title; + + //食物 + private List goods=new ArrayList<>(); + + @Data + @JsonIgnoreProperties(ignoreUnknown = true) + public static class Food { + private Integer proId; + private String proName; + private Integer skuId; + private String skuName; + private BigDecimal price; + private String number; + private String unitName; + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/ConsMsgConsumer.java b/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/ConsMsgConsumer.java index 80bae3a..ae0f4bc 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/ConsMsgConsumer.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/ConsMsgConsumer.java @@ -108,7 +108,7 @@ public class ConsMsgConsumer { return; } - TbProductWithBLOBs product = tbProductMapper.selectByPrimaryKey(Integer.valueOf(skuWithBLOBs.getProductId())); + TbProduct product = tbProductMapper.selectByPrimaryKey(Integer.valueOf(skuWithBLOBs.getProductId())); if (Objects.isNull(product)) { log.info("商品信息不存在"); return; diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/DutyService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/DutyService.java index 8f0553d..98d1cc6 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/DutyService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/DutyService.java @@ -394,7 +394,7 @@ public class DutyService { if (tbProductSku == null) { return; } - TbProductWithBLOBs product = productMapper.selectByPrimaryKey(Integer.valueOf(tbProductSku.getProductId())); + TbProduct product = productMapper.selectByPrimaryKey(Integer.valueOf(tbProductSku.getProductId())); if (ObjectUtil.isNotEmpty(product)) { diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/TbGroupOrderInfoService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/TbGroupOrderInfoService.java index 742a52a..06d2d7b 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/TbGroupOrderInfoService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/TbGroupOrderInfoService.java @@ -50,7 +50,7 @@ public class TbGroupOrderInfoService { */ public Result queryById(Integer id) { TbGroupOrderInfo tbGroupOrderInfo = tbGroupOrderInfoMapper.queryById(id); - TbProductWithBLOBs tbProduct = productMapper.selectByPrimaryKey(tbGroupOrderInfo.getProId()); + TbProduct tbProduct = productMapper.selectByPrimaryKey(tbGroupOrderInfo.getProId()); TbProductSkuWithBLOBs tbProductSku = skuMapper.selectByProduct(tbGroupOrderInfo.getProId()); GroupOrderInfoVo productInfo = new GroupOrderInfoVo(); diff --git a/src/main/resources/mapper/TbActivateInRecordMapper.xml b/src/main/resources/mapper/TbActivateInRecordMapper.xml index 8e742aa..cce9f16 100644 --- a/src/main/resources/mapper/TbActivateInRecordMapper.xml +++ b/src/main/resources/mapper/TbActivateInRecordMapper.xml @@ -111,7 +111,7 @@ over_num, shop_id, source_act_id, source_flow_id, use_start_time, use_end_time, create_time, update_time, coupon_json, source) values (#{vipUserId}, #{couponId}, #{name}, #{type}, #{proId}, #{fullAmount}, #{discountAmount}, #{num}, - #{overNum}, #{shopId}, #{sourceActId}, #{sourceFlowId}, #{useStartTime}, #{useEndTime}, #{createTime}, + #{overNum}, #{shopId}, #{sourceActId}, #{sourceFlowId}, #{useStartTime}, #{useEndTime}, now(), #{updateTime}, #{couponJson}, #{source}) @@ -124,7 +124,7 @@ (#{entity.vipUserId}, #{entity.couponId}, #{entity.name}, #{entity.type}, #{entity.proId}, #{entity.fullAmount}, #{entity.discountAmount}, #{entity.num}, #{entity.overNum}, #{entity.shopId}, #{entity.sourceActId}, #{entity.sourceFlowId}, #{entity.useStartTime}, #{entity.useEndTime}, - #{entity.createTime}, #{entity.updateTime}, #{entity.couponJson},#{entity.source}) + now(), #{entity.updateTime}, #{entity.couponJson},#{entity.source})