Merge remote-tracking branch 'origin/test' into test

This commit is contained in:
张松
2024-12-04 13:35:42 +08:00
9 changed files with 109 additions and 69 deletions

View File

@@ -18,7 +18,6 @@ public interface TbProductMapper {
TbProduct selectById(Integer id);
List<TbProduct> selectByIdIn(@Param("ids") String ids);
List<TbProduct> selectByIdInAndCheck(@Param("ids") String ids);
List<TbProduct> selectHot(@Param("shopId") String shopId,@Param("list") Set<Integer> proIds);

View File

@@ -1,20 +1,23 @@
package com.chaozhanggui.system.cashierservice.entity;
import com.chaozhanggui.system.cashierservice.entity.vo.ProductGroupVo;
import lombok.Data;
import org.springframework.data.annotation.Transient;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalTime;
import java.io.Serializable;
import java.util.List;
/**
* (TbProduct)实体类
*
* @author ww
* @since 2024-11-18 14:41:53
* @since 2024-11-19 15:52:20
*/
@Data
public class TbProduct implements Serializable {
private static final long serialVersionUID = -40921077034892720L;
private static final long serialVersionUID = 876918627328411456L;
/**
* id
*/
@@ -27,11 +30,6 @@ public class TbProduct implements Serializable {
* 商品规格
*/
private Integer specId;
/**
* 商户Id
*/
private String merchantId;
private String shopId;
/**
* 商品名称
@@ -42,7 +40,7 @@ public class TbProduct implements Serializable {
*/
private String shortTitle;
/**
* 商品类型(属性):REAL- 实物商品 VIR---虚拟商品
* 普通商品 normal 套餐商品 package 称重商品 weigh 团购券 coupon
*/
private String type;
/**
@@ -76,10 +74,6 @@ public class TbProduct implements Serializable {
* 0--待审核 1审核通过 -1审核失败 -2违规下架
*/
private Integer status;
/**
* 审核失败原因
*/
private String failMsg;
/**
* 是否热销
*/
@@ -104,14 +98,14 @@ public class TbProduct implements Serializable {
* 是否暂停销售
*/
private Integer isPauseSale;
/**
* 是否删除0不删1删除
*/
private Integer isDelete;
private Long createdAt;
private Long updatedAt;
/**
* 0 固定套餐 1可选套餐
*/
private Integer groupType;
/**
* 套餐内容
*/
@@ -152,6 +146,42 @@ public class TbProduct implements Serializable {
* 库存警戒线
*/
private Integer warnLine;
/**
* 堂食 table 自取 dine 配送 delivery 快递 express
*/
private String showType;
/**
* 称重 价格/千克
*/
private BigDecimal weight;
/**
* 是否允许临时改价
*/
private Integer isTempPrice;
/**
* 日销售上限
*/
private Integer dayLimit;
/**
* 每单销售上限
*/
private Integer singleOrderLimit;
/**
* 每人销售上限
*/
private Integer singlePeopleLimit;
/**
* 周 数组 周一,周二,周日
*/
private String days;
/**
* 可用开始时间
*/
private LocalTime startTime;
/**
* 可用结束时间
*/
private LocalTime endTime;
private String cartNumber="0";
@@ -163,6 +193,6 @@ public class TbProduct implements Serializable {
@Transient
private TbProductSkuResult productSkuResult;
private List<ProductGroupVo> proGroupVo;
}

View File

@@ -1,6 +1,7 @@
package com.chaozhanggui.system.cashierservice.entity;
import com.chaozhanggui.system.cashierservice.entity.dto.BasePageDto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
@@ -55,10 +56,11 @@ public class TbShopShareRecord extends BasePageDto implements Serializable {
/**
* 生效时间/获得奖励的时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date rewardTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updateTime;
}

View File

@@ -1299,6 +1299,9 @@ public class PayService {
orderInfo.setPaidTime(System.currentTimeMillis());
tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo);
// 消费送积分
tbMemberPointsService.consumeAwardPoints(Long.valueOf(orderInfo.getMemberId()), Long.valueOf(orderInfo.getId()));
JSONObject jsonObject = new JSONObject();
jsonObject.put("token", 0);
jsonObject.put("type", "wxcreate");
@@ -1520,7 +1523,7 @@ public class PayService {
//充值送积分
TbActivate activate = tbActivateMapper.selectByAmountScope(tbShopUser.getShopId(), memberIn.getAmount());
if (ObjectUtil.isNotNull(activate)) {
tbMemberPointsService.addPoints(Convert.toLong(tbShopUser.getId()), activate.getGiftAmount(), StrUtil.format("充值¥{}送{}积分", memberIn.getAmount(), activate.getGiftAmount()), null, memberIn.getOrderNo());
tbMemberPointsService.addPoints(Convert.toLong(tbShopUser.getId()), activate.getGiftPoints(), StrUtil.format("充值¥{}送{}积分", memberIn.getAmount(), activate.getGiftPoints()), null, memberIn.getOrderNo());
}
JSONObject jsonObject = new JSONObject();
@@ -1722,7 +1725,7 @@ public class PayService {
//充值送积分
TbActivate activate = tbActivateMapper.selectByAmountScope(tbShopUser.getShopId(), memberIn.getAmount());
if (ObjectUtil.isNotNull(activate)) {
tbMemberPointsService.addPoints(Convert.toLong(tbShopUser.getId()), activate.getGiftAmount(), StrUtil.format("充值¥{}送{}积分", memberIn.getAmount(), activate.getGiftAmount()), null, memberIn.getOrderNo());
tbMemberPointsService.addPoints(Convert.toLong(tbShopUser.getId()), activate.getGiftPoints(), StrUtil.format("充值¥{}送{}积分", memberIn.getAmount(), activate.getGiftPoints()), null, memberIn.getOrderNo());
}
JSONObject jsonObject = new JSONObject();
jsonObject.put("shopId", memberIn.getShopId());

View File

@@ -254,12 +254,17 @@ public class ProductService {
});
groupList.sort(Comparator.comparingInt(TbProductGroup::getIsSale).reversed());
//热销
TbProductGroup hot = new TbProductGroup();
hot.setName("热销");
List<TbProduct> hots = tbProductMapper.selectHot(shopId,proSets);
hot.setProducts(handleDate(hots,true,1,false, shopInfo));
groupList.add(0, hot);
// //热销
// TbProductGroup hot = new TbProductGroup();
// hot.setName("热销");
// List<TbProduct> hots = null;
// if (proSets.isEmpty()) {
// hots = new ArrayList<>();
// }else {
// hots = tbProductMapper.selectHot(shopId,proSets);
// }
// hot.setProducts(handleDate(hots,true,1,false, shopInfo));
// groupList.add(0, hot);
concurrentMap.put("productInfo", groupList);
}
@@ -472,6 +477,9 @@ public class ProductService {
boolean isMemberPrice = shopInfo.getIsMemberPrice() != null && shopInfo.getIsMemberPrice() == 1;
if (!CollectionUtils.isEmpty(products)) {
products.parallelStream().forEach(it -> {
if("package".equals(it.getType())){
it.setProGroupVo(JSONUtil.parseListTNewList(it.getGroupSnap(), ProductGroupVo.class));
}
TbShopUnit tbShopUnit = unitMapper.selectByPrimaryKey(Integer.valueOf(it.getUnitId()));
it.setUnitSnap(tbShopUnit != null ? tbShopUnit.getName() : "");
if(check){

View File

@@ -76,9 +76,10 @@ public class TbShopShareRecordServiceImpl implements TbShopShareRecordService {
records = tbShopShareRecordMapper.queryIsNoSuccess(tbShopShareRecord);
}
for (TbShopShareRecord shareRecord : records) {
shareRecord.setInvitedName(userInfoMapper.selectNameByPrimaryKey(shareRecord.getInvitedId()));
shareRecord.setBeInvitedName(userInfoMapper.selectNameByPrimaryKey(shareRecord.getBeInvitedId()));
}
result.put("records", new PageInfo<>());
result.put("records", new PageInfo<>(records));
return result;
}

View File

@@ -207,14 +207,14 @@ id, vip_user_id, coupon_id, name, type, pro_id, full_amount, discount_amount, nu
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into tb_activate_in_record(vip_user_id, coupon_id, name, type, pro_id, full_amount, discount_amount, num, 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}, #{updateTime}, #{couponJson} , #{source})
values (#{vipUserId}, #{couponId}, #{name}, #{type}, #{proId}, #{fullAmount}, #{discountAmount}, #{num}, #{overNum}, #{shopId}, #{sourceActId}, #{sourceFlowId}, #{useStartTime}, #{useEndTime}, now(), #{updateTime}, #{couponJson} , #{source})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into tb_activate_in_record(vip_user_id, coupon_id, name, type, pro_id, full_amount, discount_amount, num, over_num, shop_id, source_act_id, source_flow_id, use_start_time, use_end_time, create_time, update_time, coupon_json, source)
values
<foreach collection="entities" item="entity" separator=",">
(#{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})
(#{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},now(), #{entity.updateTime}, #{entity.couponJson}, #{entity.source})
</foreach>
</insert>
@@ -279,7 +279,7 @@ id, vip_user_id, coupon_id, name, type, pro_id, full_amount, discount_amount, nu
<update id="updateOverNum">
update tb_activate_in_record
set over_num = #{overNum}
set over_num = #{overNum} ,update_time = now()
where id = #{id}
</update>

View File

@@ -244,6 +244,7 @@
FROM
tb_product_group
where shop_id=#{shopId} and is_show=1
and product_ids != '[]'
<if test="groupId != null and groupId != ''">
and id = #{groupId}
</if>

View File

@@ -6,28 +6,28 @@
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="categoryId" column="category_id" jdbcType="VARCHAR"/>
<result property="specId" column="spec_id" jdbcType="INTEGER"/>
<result property="merchantId" column="merchant_id" jdbcType="VARCHAR"/>
<result property="shopId" column="shop_id" jdbcType="VARCHAR"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="shortTitle" column="short_title" jdbcType="VARCHAR"/>
<result property="type" column="type" jdbcType="VARCHAR"/>
<result property="packFee" column="pack_fee" jdbcType="DECIMAL"/>
<result property="lowPrice" column="low_price" jdbcType="DECIMAL"/>
<result property="lowMemberPrice" column="low_member_price" jdbcType="DECIMAL"/>
<result property="packFee" column="pack_fee" jdbcType="NUMERIC"/>
<result property="lowPrice" column="low_price" jdbcType="NUMERIC"/>
<result property="unitId" column="unit_id" jdbcType="INTEGER"/>
<result property="coverImg" column="cover_img" jdbcType="VARCHAR"/>
<result property="images" column="images" jdbcType="VARCHAR"/>
<result property="sort" column="sort" jdbcType="INTEGER"/>
<result property="status" column="status" jdbcType="INTEGER"/>
<result property="failMsg" column="fail_msg" jdbcType="VARCHAR"/>
<result property="isHot" column="is_hot" jdbcType="INTEGER"/>
<result property="typeEnum" column="type_enum" jdbcType="VARCHAR"/>
<result property="isDel" column="is_del" jdbcType="INTEGER"/>
<result property="isStock" column="is_stock" jdbcType="INTEGER"/>
<result property="isPauseSale" column="is_pause_sale" jdbcType="INTEGER"/>
<result property="isDelete" column="is_delete" jdbcType="INTEGER"/>
<result property="createdAt" column="created_at" jdbcType="INTEGER"/>
<result property="updatedAt" column="updated_at" jdbcType="INTEGER"/>
<result property="groupType" column="group_type" jdbcType="INTEGER"/>
<result property="groupSnap" column="group_snap" jdbcType="VARCHAR"/>
<result property="specInfo" column="spec_info" jdbcType="VARCHAR"/>
<result property="selectSpec" column="select_spec" jdbcType="VARCHAR"/>
<result property="specTableHeaders" column="spec_table_headers" jdbcType="VARCHAR"/>
<result property="groupCategoryId" column="group_category_id" jdbcType="VARCHAR"/>
<result property="realSalesNumber" column="real_sales_number" jdbcType="INTEGER"/>
@@ -35,14 +35,26 @@
<result property="isGrounding" column="is_grounding" jdbcType="INTEGER"/>
<result property="isRefundStock" column="is_refund_stock" jdbcType="INTEGER"/>
<result property="warnLine" column="warn_line" jdbcType="INTEGER"/>
<result property="showType" column="show_type" jdbcType="VARCHAR"/>
<result property="weight" column="weight" jdbcType="NUMERIC"/>
<result property="isTempPrice" column="is_temp_price" jdbcType="INTEGER"/>
<result property="dayLimit" column="day_limit" jdbcType="INTEGER"/>
<result property="singleOrderLimit" column="single_order_limit" jdbcType="INTEGER"/>
<result property="singlePeopleLimit" column="single_people_limit" jdbcType="INTEGER"/>
<result property="days" column="days" jdbcType="VARCHAR"/>
<result property="startTime" column="start_time" jdbcType="VARCHAR"/>
<result property="endTime" column="end_time" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
id
, category_id, spec_id, merchant_id, shop_id, name, short_title, type, pack_fee, low_price, low_member_price,
unit_id, cover_img, images, sort, status, fail_msg, is_hot, type_enum, is_del, is_stock, is_pause_sale, is_delete,
created_at, updated_at, group_snap, spec_info, select_spec,
spec_table_headers, group_category_id, real_sales_number, stock_number, is_grounding, is_refund_stock, warn_line </sql>
, category_id, spec_id, shop_id, name, short_title, type, pack_fee,
low_price, unit_id, cover_img, images, sort, status, fail_msg, is_hot, type_enum,
is_del, is_stock, is_pause_sale, created_at, updated_at, group_type, group_snap,
spec_info, select_spec, spec_table_headers, group_category_id, real_sales_number,
stock_number, is_grounding, is_refund_stock, warn_line, show_type, weight, is_temp_price,
day_limit, single_order_limit, single_people_limit, days, start_time, end_time </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
@@ -50,23 +62,14 @@
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByIdIn" resultMap="BaseResultMap">
select min(sku.suit) as suit, tb.*
from tb_product tb
LEFT JOIN tb_product_sku sku ON tb.id = sku.product_id
where tb.id in (${ids})
and sku.is_del = 0
group by tb.id
order by tb.sort asc
</select>
<select id="selectByIdInAndCheck" resultMap="BaseResultMap">
select min(sku.suit) as suit, tb.*, sum(sku.real_sales_number) as stockNumber
from tb_product tb
LEFT JOIN tb_product_sku sku ON tb.id = sku.product_id and sku.is_del = 0
where tb.id in (${ids})
and tb.is_grounding = 1
and tb.type_enum!='group' and tb.status = 1
and tb.is_grounding = 1 and tb.type!='coupon' and tb.type != 'weigh' and tb.status = 1 and tb.is_del = 0
and tb.days LIKE concat('%',DAYNAME(CURRENT_DATE),'%') and tb.start_time &lt;= CURRENT_TIMESTAMP and tb.end_time &gt;= CURRENT_TIMESTAMP
group by tb.id
order by tb.sort asc
</select>
@@ -77,9 +80,8 @@
LEFT JOIN tb_product_sku sku ON tb.id = sku.product_id
JOIN (SELECT product_id ,SUM(real_sales_number) as realSalesNumber
FROM tb_product_sku
WHERE shop_id = #{shopId}
and is_del = 0
AND product_id IN
WHERE
shop_id = #{shopId} and is_del = 0 AND product_id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
@@ -87,7 +89,8 @@
ORDER BY realSalesNumber DESC LIMIT 3) AS top_products ON tb.id = top_products.product_id
where
tb.status = 1
and tb.type_enum != 'group'
and tb.type != 'coupon' and tb.is_del = 0
and tb.days LIKE concat('%',DAYNAME(CURRENT_DATE),'%') and tb.start_time &lt;= CURRENT_TIMESTAMP and tb.end_time &gt;= CURRENT_TIMESTAMP
and tb.is_grounding = 1
group by tb.id
order by stockNumber desc
@@ -102,17 +105,12 @@
and tb.shop_id = #{shopId}
and tb.status = 1
and tb.is_grounding = 1
and tb.type_enum != 'group'
and tb.type != 'coupon' and tb.type != 'weigh' and tb.is_del = 0
and tb.days LIKE concat('%',DAYNAME(CURRENT_DATE),'%') and tb.start_time &lt;= CURRENT_TIMESTAMP and tb.end_time &gt;= CURRENT_TIMESTAMP
group by tb.id
order by tb.sort asc
</select>
<!-- <select id="selectByIdIn" resultMap="BaseResultMap">-->
<!-- select *-->
<!-- from tb_product-->
<!-- where id in (${ids}) and is_show_mall =1 order by sort asc-->
<!-- </select>-->
<select id="selectById" resultType="com.chaozhanggui.system.cashierservice.entity.TbProduct">
select
<include refid="Base_Column_List"/>
@@ -184,8 +182,7 @@
LEFT JOIN tb_shop_info AS info ON info.id = pro.shop_id
<where>
info.`status`='1'
# AND pro.is_combo = '1'
AND pro.type_enum = 'group'
AND pro.type = 'coupon'
AND (info.cities = #{cities} or info.districts = #{cities})
<if test="proName != null and proName != ''">
AND pro.`name` LIKE concat('%',#{proName,jdbcType=VARCHAR},'%')
@@ -233,8 +230,7 @@
LEFT JOIN tb_shop_info AS info ON info.id = `order`.shop_id
<where>
info.`status`='1'
# AND pro.is_combo = '1'
AND pro.type_enum = 'group'
AND pro.type = 'coupon'
AND (info.cities = #{cities} or info.districts = #{cities})
<if test="proName != null and proName != ''">
AND pro.`name` LIKE concat('%',#{proName,jdbcType=VARCHAR},'%')