Merge remote-tracking branch 'origin/test' into test
# Conflicts: # src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProduct.java # src/main/java/com/chaozhanggui/system/cashierservice/service/OrderService.java # src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java # src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java # src/main/resources/mapper/TbProductMapper.xml
This commit is contained in:
1
pom.xml
1
pom.xml
@@ -14,6 +14,7 @@
|
|||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
<skipTests>true</skipTests>
|
||||||
<maven.compiler.source>8</maven.compiler.source>
|
<maven.compiler.source>8</maven.compiler.source>
|
||||||
<maven.compiler.target>8</maven.compiler.target>
|
<maven.compiler.target>8</maven.compiler.target>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
|||||||
@@ -1,46 +1,27 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.dao;
|
package com.chaozhanggui.system.cashierservice.dao;
|
||||||
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.TbProduct;
|
import com.chaozhanggui.system.cashierservice.entity.TbProduct;
|
||||||
import com.chaozhanggui.system.cashierservice.entity.TbProductWithBLOBs;
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.po.ProConsSkuInfo;
|
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.Param;
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
import org.apache.ibatis.annotations.Update;
|
import org.apache.ibatis.annotations.Update;
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface TbProductMapper {
|
public interface TbProductMapper {
|
||||||
int deleteByPrimaryKey(Integer id);
|
|
||||||
|
|
||||||
int insert(TbProductWithBLOBs record);
|
TbProduct selectByPrimaryKey(Integer id);
|
||||||
|
|
||||||
int insertSelective(TbProductWithBLOBs record);
|
|
||||||
|
|
||||||
TbProductWithBLOBs selectByPrimaryKey(Integer id);
|
|
||||||
|
|
||||||
int updateByPrimaryKeySelective(TbProductWithBLOBs record);
|
|
||||||
|
|
||||||
int updateByPrimaryKeyWithBLOBs(TbProductWithBLOBs record);
|
|
||||||
|
|
||||||
int updateByPrimaryKey(TbProduct record);
|
|
||||||
|
|
||||||
|
|
||||||
List<TbProductWithBLOBs> selectByShopId(@Param("shopId") String shopId,@Param("commdityName") String commdityName);
|
|
||||||
List<TbProductWithBLOBs> selectByShopIdAndCheckGrounding(@Param("shopId") String shopId,@Param("commdityName") String commdityName);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
List<TbProductWithBLOBs> selectByShopIdAndShopType(@Param("shopId") String shopId, @Param("categoryId") String categoryId,@Param("commdityName") String commdityName);
|
|
||||||
List<TbProductWithBLOBs> selectByShopIdAndShopTypeCheckGrounding(@Param("shopId") String shopId, @Param("categoryId") String categoryId,@Param("commdityName") String commdityName);
|
|
||||||
List<TbProductWithBLOBs> selectByShopIdAndShopTypeUnGrounding(@Param("shopId") String shopId,@Param("commdityName") String commdityName);
|
|
||||||
|
|
||||||
|
List<TbProduct> selectByShopId(@Param("shopId") String shopId,@Param("commdityName") String commdityName);
|
||||||
|
List<TbProduct> selectByShopIdAndCheckGrounding(@Param("shopId") String shopId,@Param("commdityName") String commdityName);
|
||||||
|
|
||||||
|
List<TbProduct> selectByShopIdAndShopType(@Param("shopId") String shopId, @Param("categoryId") String categoryId,@Param("commdityName") String commdityName);
|
||||||
|
List<TbProduct> selectByShopIdAndShopTypeCheckGrounding(@Param("shopId") String shopId, @Param("categoryId") String categoryId,@Param("commdityName") String commdityName);
|
||||||
|
List<TbProduct> 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);
|
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);
|
void updateStockById(@Param("productId")Integer productId, @Param("num")Integer num);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ public class TbProductStockDetail implements Serializable {
|
|||||||
|
|
||||||
private String productName;
|
private String productName;
|
||||||
|
|
||||||
private Byte isStock;
|
private Integer isStock;
|
||||||
|
|
||||||
private String specSnap;
|
private String specSnap;
|
||||||
|
|
||||||
@@ -90,11 +90,11 @@ public class TbProductStockDetail implements Serializable {
|
|||||||
this.productName = productName == null ? null : productName.trim();
|
this.productName = productName == null ? null : productName.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Byte getIsStock() {
|
public Integer getIsStock() {
|
||||||
return isStock;
|
return isStock;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIsStock(Byte isStock) {
|
public void setIsStock(Integer isStock) {
|
||||||
this.isStock = isStock;
|
this.isStock = isStock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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<Food> 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -108,7 +108,7 @@ public class ConsMsgConsumer {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TbProductWithBLOBs product = tbProductMapper.selectByPrimaryKey(Integer.valueOf(skuWithBLOBs.getProductId()));
|
TbProduct product = tbProductMapper.selectByPrimaryKey(Integer.valueOf(skuWithBLOBs.getProductId()));
|
||||||
if (Objects.isNull(product)) {
|
if (Objects.isNull(product)) {
|
||||||
log.info("商品信息不存在");
|
log.info("商品信息不存在");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -394,7 +394,7 @@ public class DutyService {
|
|||||||
if (tbProductSku == null) {
|
if (tbProductSku == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
TbProductWithBLOBs product = productMapper.selectByPrimaryKey(Integer.valueOf(tbProductSku.getProductId()));
|
TbProduct product = productMapper.selectByPrimaryKey(Integer.valueOf(tbProductSku.getProductId()));
|
||||||
|
|
||||||
|
|
||||||
if (ObjectUtil.isNotEmpty(product)) {
|
if (ObjectUtil.isNotEmpty(product)) {
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class TbGroupOrderInfoService {
|
|||||||
*/
|
*/
|
||||||
public Result queryById(Integer id) {
|
public Result queryById(Integer id) {
|
||||||
TbGroupOrderInfo tbGroupOrderInfo = tbGroupOrderInfoMapper.queryById(id);
|
TbGroupOrderInfo tbGroupOrderInfo = tbGroupOrderInfoMapper.queryById(id);
|
||||||
TbProductWithBLOBs tbProduct = productMapper.selectByPrimaryKey(tbGroupOrderInfo.getProId());
|
TbProduct tbProduct = productMapper.selectByPrimaryKey(tbGroupOrderInfo.getProId());
|
||||||
TbProductSkuWithBLOBs tbProductSku = skuMapper.selectByProduct(tbGroupOrderInfo.getProId());
|
TbProductSkuWithBLOBs tbProductSku = skuMapper.selectByProduct(tbGroupOrderInfo.getProId());
|
||||||
|
|
||||||
GroupOrderInfoVo productInfo = new GroupOrderInfoVo();
|
GroupOrderInfoVo productInfo = new GroupOrderInfoVo();
|
||||||
|
|||||||
@@ -111,7 +111,7 @@
|
|||||||
over_num, shop_id, source_act_id, source_flow_id, use_start_time,
|
over_num, shop_id, source_act_id, source_flow_id, use_start_time,
|
||||||
use_end_time, create_time, update_time, coupon_json, source)
|
use_end_time, create_time, update_time, coupon_json, source)
|
||||||
values (#{vipUserId}, #{couponId}, #{name}, #{type}, #{proId}, #{fullAmount}, #{discountAmount}, #{num},
|
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})
|
#{updateTime}, #{couponJson}, #{source})
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@
|
|||||||
(#{entity.vipUserId}, #{entity.couponId}, #{entity.name}, #{entity.type}, #{entity.proId},
|
(#{entity.vipUserId}, #{entity.couponId}, #{entity.name}, #{entity.type}, #{entity.proId},
|
||||||
#{entity.fullAmount}, #{entity.discountAmount}, #{entity.num}, #{entity.overNum}, #{entity.shopId},
|
#{entity.fullAmount}, #{entity.discountAmount}, #{entity.num}, #{entity.overNum}, #{entity.shopId},
|
||||||
#{entity.sourceActId}, #{entity.sourceFlowId}, #{entity.useStartTime}, #{entity.useEndTime},
|
#{entity.sourceActId}, #{entity.sourceFlowId}, #{entity.useStartTime}, #{entity.useEndTime},
|
||||||
#{entity.createTime}, #{entity.updateTime}, #{entity.couponJson},#{entity.source})
|
now(), #{entity.updateTime}, #{entity.couponJson},#{entity.source})
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user