Merge #71 into master from cc_20260318_wishlist
feat:订单待确认 审批流去掉 * cc_20260318_wishlist: (22 commits squashed) - feat:心愿单接口 - feat:心愿单接口 - feat:心愿单接口 - feat:心愿单接口 查询当前门店铺位绑定的心愿单 - feat:心愿单接口 状态 - feat:心愿单接口 状态 - feat:心愿单接口 状态 - feat:心愿单接口 状态 - Merge branch 'master' into cc_20260318_wishlist - feat:代码merge 错误处理 - feat:新增storeType - feat:查询逻辑调整 - feat:新增use_ai 赛选 - feat:新增use_ai 赛选 - feat:新增use_ai 赛选 - feat:心愿单状态筛选 - feat:查询当前门店铺位绑定的心愿单 mini - feat:bug修复 - feat:类型调整 - feat:名称 - feat:订单待确认 审批流去掉 - feat:订单待确认 审批流去掉 Signed-off-by: 正新 <accounts_6964c7bcd2a2c377c5bbd01b@mail.teambition.com> Merged-by: 正新 <accounts_6964c7bcd2a2c377c5bbd01b@mail.teambition.com> CR-link: https://codeup.aliyun.com/692ea314dec569489f6f167c/hangzhou/java/custom_zxjp/change/71
This commit is contained in:
@@ -360,6 +360,7 @@ public enum ErrorCodeEnum {
|
|||||||
PAY_FAIL(1610107, "支付失败", null),
|
PAY_FAIL(1610107, "支付失败", null),
|
||||||
DUPLICATE_PAYMENTS(1610108, "订单支付中,请勿重复支付!", null),
|
DUPLICATE_PAYMENTS(1610108, "订单支付中,请勿重复支付!", null),
|
||||||
CURRENT_ORDER_NOT_SUPPORT(1610109, "当前订单状态不支持审批!", null),
|
CURRENT_ORDER_NOT_SUPPORT(1610109, "当前订单状态不支持审批!", null),
|
||||||
|
CURRENT_POINT_BIND_OTHER_WISHLIST(1610110, "当前铺位绑定了其他心愿单!", null),
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ public enum UserRoleEnum {
|
|||||||
INVESTMENT_MANGER(1765266125369L, "招商经理"),
|
INVESTMENT_MANGER(1765266125369L, "招商经理"),
|
||||||
OPERATION_GENERAL_CONSULTANT(1764642515446L,"运营片区总顾问"),
|
OPERATION_GENERAL_CONSULTANT(1764642515446L,"运营片区总顾问"),
|
||||||
ORDER_GROUP(1766387359609L,"订单组"),
|
ORDER_GROUP(1766387359609L,"订单组"),
|
||||||
|
AI_STORE_TYPE_APPROVE(1774252055402L,"AI店型订单审核"),
|
||||||
;
|
;
|
||||||
|
|
||||||
private Long code;
|
private Long code;
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.cool.store.enums.order;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Auther zx_szh
|
||||||
|
* @Date 2026/3/18 14:24
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public enum WishlistStatusEnum {
|
||||||
|
|
||||||
|
AGREE(0, "待完善加盟资质"),
|
||||||
|
COMPLETE_POINT(5, "待绑定铺位"),
|
||||||
|
LI_GUI_APPROVE(10, "待立规审核"),
|
||||||
|
PASS(20, "通过"),
|
||||||
|
REJECT(15, "拒绝"),
|
||||||
|
;
|
||||||
|
|
||||||
|
private final Integer code;
|
||||||
|
private final String desc;
|
||||||
|
|
||||||
|
WishlistStatusEnum(Integer code, String desc) {
|
||||||
|
this.code = code;
|
||||||
|
this.desc = desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDesc() {
|
||||||
|
return desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<Integer, WishlistStatusEnum> MAP = Arrays.stream(values())
|
||||||
|
.collect(Collectors.toMap(WishlistStatusEnum::getCode, Function.identity(), (a, b) -> a));
|
||||||
|
|
||||||
|
public static WishlistStatusEnum of(Integer code) {
|
||||||
|
return MAP.get(code);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -169,7 +169,7 @@ public enum ShopSubStageStatusEnum {
|
|||||||
|
|
||||||
SHOP_SUB_STAGE_STATUS_280(ShopSubStageEnum.SHOP_STAGE_28, 2800, "待选购", Boolean.FALSE),
|
SHOP_SUB_STAGE_STATUS_280(ShopSubStageEnum.SHOP_STAGE_28, 2800, "待选购", Boolean.FALSE),
|
||||||
SHOP_SUB_STAGE_STATUS_281(ShopSubStageEnum.SHOP_STAGE_28, 2810, "待立规审批", Boolean.FALSE),
|
SHOP_SUB_STAGE_STATUS_281(ShopSubStageEnum.SHOP_STAGE_28, 2810, "待立规审批", Boolean.FALSE),
|
||||||
SHOP_SUB_STAGE_STATUS_281_5(ShopSubStageEnum.SHOP_STAGE_28, 2815, "待招商经理审批", Boolean.FALSE),
|
SHOP_SUB_STAGE_STATUS_281_5(ShopSubStageEnum.SHOP_STAGE_28, 2815, "待加盟商确认", Boolean.FALSE),
|
||||||
SHOP_SUB_STAGE_STATUS_282(ShopSubStageEnum.SHOP_STAGE_28, 2820, "待财务确认", Boolean.FALSE),
|
SHOP_SUB_STAGE_STATUS_282(ShopSubStageEnum.SHOP_STAGE_28, 2820, "待财务确认", Boolean.FALSE),
|
||||||
SHOP_SUB_STAGE_STATUS_283(ShopSubStageEnum.SHOP_STAGE_28, 2830, "审批拒绝", Boolean.FALSE),
|
SHOP_SUB_STAGE_STATUS_283(ShopSubStageEnum.SHOP_STAGE_28, 2830, "审批拒绝", Boolean.FALSE),
|
||||||
SHOP_SUB_STAGE_STATUS_284(ShopSubStageEnum.SHOP_STAGE_28, 2840, "待缴费", Boolean.FALSE),
|
SHOP_SUB_STAGE_STATUS_284(ShopSubStageEnum.SHOP_STAGE_28, 2840, "待缴费", Boolean.FALSE),
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.cool.store.mapper.order.StoreWishlistMapper;
|
|||||||
import com.cool.store.vo.order.MiniStoreWishlistListVO;
|
import com.cool.store.vo.order.MiniStoreWishlistListVO;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
import tk.mybatis.mapper.entity.Example;
|
import tk.mybatis.mapper.entity.Example;
|
||||||
|
|
||||||
@@ -25,6 +26,20 @@ public class StoreWishlistDAO {
|
|||||||
return mapper.insertBatch(list) > 0;
|
return mapper.insertBatch(list) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean insert(StoreWishlistDO item) {
|
||||||
|
if (item == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return mapper.insertSelective(item) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int updateByExampleSelective(StoreWishlistDO item) {
|
||||||
|
if (item == null) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return mapper.updateByPrimaryKeySelective(item);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean softDeleteByLineIdAndStoreTypeAndVersion(Long lineId, Long storeTypeId, String versionNo) {
|
public boolean softDeleteByLineIdAndStoreTypeAndVersion(Long lineId, Long storeTypeId, String versionNo) {
|
||||||
if (lineId == null || storeTypeId == null || versionNo == null) {
|
if (lineId == null || storeTypeId == null || versionNo == null) {
|
||||||
return false;
|
return false;
|
||||||
@@ -39,6 +54,27 @@ public class StoreWishlistDAO {
|
|||||||
return mapper.getById(id);
|
return mapper.getById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public StoreWishlistDO getByPointId(Long lineId,Long pointId) {
|
||||||
|
if (lineId == null||pointId==null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return mapper.getByPointId(lineId,pointId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean updateByLineId(Long id) {
|
||||||
|
if (id == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return mapper.updateByLineId(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPointBindWishlistCount( Long pointId, Integer wishlistStatus) {
|
||||||
|
if (pointId == null||wishlistStatus==null) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return mapper.getPointBindWishlistCount(pointId,wishlistStatus);
|
||||||
|
}
|
||||||
|
|
||||||
public List<StoreWishlistDO> listByLineIdAndStoreTypeAndVersion(Long lineId, Long storeTypeId, String versionNo) {
|
public List<StoreWishlistDO> listByLineIdAndStoreTypeAndVersion(Long lineId, Long storeTypeId, String versionNo) {
|
||||||
if (lineId == null || storeTypeId == null || versionNo == null) {
|
if (lineId == null || storeTypeId == null || versionNo == null) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
@@ -53,14 +89,8 @@ public class StoreWishlistDAO {
|
|||||||
return mapper.listByLineId(lineId, storeTypeId);
|
return mapper.listByLineId(lineId, storeTypeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<MiniStoreWishlistListVO> listByVersionList(List<String> versionNoList) {
|
public List<MiniStoreWishlistListVO> listByVersionList(String keyword,Long storeTypeId,Integer wishlistStatus) {
|
||||||
if (CollectionUtils.isEmpty(versionNoList)) {
|
return mapper.listByVersionList(keyword,storeTypeId,wishlistStatus);
|
||||||
return Collections.emptyList();
|
|
||||||
}
|
|
||||||
return mapper.listByVersionList(versionNoList);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getDistinctVersion(String keyword,Long storeTypeId){
|
|
||||||
return mapper.versionNoList(keyword,storeTypeId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package com.cool.store.dao.order;
|
||||||
|
|
||||||
|
import com.cool.store.entity.order.StoreWishlistOptionDO;
|
||||||
|
import com.cool.store.mapper.order.StoreWishlistOptionMapper;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class StoreWishlistOptionDAO {
|
||||||
|
|
||||||
|
private final StoreWishlistOptionMapper mapper;
|
||||||
|
|
||||||
|
public boolean insertBatch(List<StoreWishlistOptionDO> list) {
|
||||||
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return mapper.insertBatch(list) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean softDeleteByWishlistIds(List<Long> wishlistIds) {
|
||||||
|
if (CollectionUtils.isEmpty(wishlistIds)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return mapper.softDeleteByWishlistIds(wishlistIds) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<StoreWishlistOptionDO> listByWishlistIds(List<Long> wishlistIds) {
|
||||||
|
if (CollectionUtils.isEmpty(wishlistIds)) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
return mapper.listByWishlistIds(wishlistIds);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,6 +17,11 @@ public interface StoreWishlistMapper extends Mapper<StoreWishlistDO> {
|
|||||||
|
|
||||||
StoreWishlistDO getById(@Param("id") Long id);
|
StoreWishlistDO getById(@Param("id") Long id);
|
||||||
|
|
||||||
|
StoreWishlistDO getByPointId(@Param("lineId") Long lineId, @Param("pointId") Long pointId);
|
||||||
|
|
||||||
|
|
||||||
|
Integer getPointBindWishlistCount(@Param("pointId") Long pointId, @Param("wishlistStatus") Integer wishlistStatus);
|
||||||
|
|
||||||
List<StoreWishlistDO> listByLineIdAndStoreTypeAndVersion(@Param("lineId") Long lineId,
|
List<StoreWishlistDO> listByLineIdAndStoreTypeAndVersion(@Param("lineId") Long lineId,
|
||||||
@Param("storeTypeId") Long storeTypeId,
|
@Param("storeTypeId") Long storeTypeId,
|
||||||
@Param("versionNo") String versionNo);
|
@Param("versionNo") String versionNo);
|
||||||
@@ -25,7 +30,16 @@ public interface StoreWishlistMapper extends Mapper<StoreWishlistDO> {
|
|||||||
@Param("storeTypeId") Long storeTypeId);
|
@Param("storeTypeId") Long storeTypeId);
|
||||||
|
|
||||||
|
|
||||||
List<MiniStoreWishlistListVO> listByVersionList(@Param("versionNoList") List<String> versionNoList);
|
List<MiniStoreWishlistListVO> listByVersionList(@Param("keyword") String keyword,
|
||||||
|
@Param("storeTypeId") Long storeTypeId,
|
||||||
|
@Param("wishlistStatus") Integer wishlistStatus);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新心愿单状态 将当前加盟商所有的在待完善加盟资质的心愿单状态改为绑定铺位
|
||||||
|
* @param lineId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Boolean updateByLineId(Long lineId) ;
|
||||||
|
|
||||||
|
|
||||||
List<String> versionNoList(@Param("keyword") String keyword, @Param("storeTypeId") Long storeTypeId);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.cool.store.mapper.order;
|
||||||
|
|
||||||
|
import com.cool.store.entity.order.StoreWishlistOptionDO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import tk.mybatis.mapper.common.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface StoreWishlistOptionMapper extends Mapper<StoreWishlistOptionDO> {
|
||||||
|
|
||||||
|
int insertBatch(@Param("list") List<StoreWishlistOptionDO> list);
|
||||||
|
|
||||||
|
int softDeleteByWishlistIds(@Param("wishlistIds") List<Long> wishlistIds);
|
||||||
|
|
||||||
|
List<StoreWishlistOptionDO> listByWishlistIds(@Param("wishlistIds") List<Long> wishlistIds);
|
||||||
|
}
|
||||||
@@ -35,6 +35,12 @@
|
|||||||
<result column="district_code" jdbcType="VARCHAR" property="districtCode"/>
|
<result column="district_code" jdbcType="VARCHAR" property="districtCode"/>
|
||||||
<result column="point_location" jdbcType="VARCHAR" property="pointLocation"/>
|
<result column="point_location" jdbcType="VARCHAR" property="pointLocation"/>
|
||||||
<result column="protection_distance" jdbcType="VARCHAR" property="protectionDistance"/>
|
<result column="protection_distance" jdbcType="VARCHAR" property="protectionDistance"/>
|
||||||
|
<result column="location_desc_code" jdbcType="TINYINT" property="locationDescCode"/>
|
||||||
|
<result column="use_ai" jdbcType="TINYINT" property="useAi"/>
|
||||||
|
<result column="door_inner_depth" jdbcType="DECIMAL" property="doorInnerDepth"/>
|
||||||
|
<result column="door_inner_width" jdbcType="DECIMAL" property="doorInnerWidth"/>
|
||||||
|
<result column="door_inner_height" jdbcType="DECIMAL" property="doorInnerHeight"/>
|
||||||
|
<result column="other_desc" jdbcType="VARCHAR" property="otherDesc"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="allColumn">
|
<sql id="allColumn">
|
||||||
@@ -43,7 +49,8 @@
|
|||||||
development_time, point_status, point_score, select_status, submit_audit_count, point_source, deleted,
|
development_time, point_status, point_score, select_status, submit_audit_count, point_source, deleted,
|
||||||
create_time, update_time,
|
create_time, update_time,
|
||||||
province, city, district, township, opportunity_point_code, opportunity_point_name,
|
province, city, district, township, opportunity_point_code, opportunity_point_name,
|
||||||
province_code, city_code, district_code, point_location,protection_distance
|
province_code, city_code, district_code, point_location,protection_distance,
|
||||||
|
location_desc_code, use_ai, door_inner_depth, door_inner_width, door_inner_height, other_desc
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="getMyPointData" resultType="com.cool.store.vo.point.PointHomePageDataVO">
|
<select id="getMyPointData" resultType="com.cool.store.vo.point.PointHomePageDataVO">
|
||||||
@@ -209,7 +216,7 @@
|
|||||||
select
|
select
|
||||||
<include refid="allColumn"/>
|
<include refid="allColumn"/>
|
||||||
from xfsg_point_info
|
from xfsg_point_info
|
||||||
where deleted = 0 and point_status in (4,5) and development_manager = #{request.developmentManager} and
|
where deleted = 0 and point_status = 5 and development_manager = #{request.developmentManager} and
|
||||||
select_status = 0
|
select_status = 0
|
||||||
<if test="request.pointStatusList != null and request.pointStatusList.size() > 0">
|
<if test="request.pointStatusList != null and request.pointStatusList.size() > 0">
|
||||||
and point_status in
|
and point_status in
|
||||||
@@ -220,6 +227,9 @@
|
|||||||
<if test="request.pointName!=null and request.pointName!=''">
|
<if test="request.pointName!=null and request.pointName!=''">
|
||||||
and point_name like concat('%',#{request.pointName},'%')
|
and point_name like concat('%',#{request.pointName},'%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="request.useAi!=null">
|
||||||
|
and use_ai = #{request.useAi}
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<update id="updateSelectedDevelopmentManager">
|
<update id="updateSelectedDevelopmentManager">
|
||||||
@@ -555,7 +565,13 @@
|
|||||||
province_code = #{request.provinceCode},
|
province_code = #{request.provinceCode},
|
||||||
city_code = #{request.cityCode},
|
city_code = #{request.cityCode},
|
||||||
district_code = #{request.districtCode},
|
district_code = #{request.districtCode},
|
||||||
point_location = #{request.pointLocation}
|
point_location = #{request.pointLocation},
|
||||||
|
location_desc_code = #{request.locationDescCode},
|
||||||
|
use_ai = #{request.useAi},
|
||||||
|
door_inner_depth = #{request.doorInnerDepth},
|
||||||
|
door_inner_width = #{request.doorInnerWidth},
|
||||||
|
door_inner_height = #{request.doorInnerHeight},
|
||||||
|
other_desc = #{request.otherDesc}
|
||||||
where id = #{request.id}
|
where id = #{request.id}
|
||||||
</update>
|
</update>
|
||||||
<update id="updateAddress">
|
<update id="updateAddress">
|
||||||
|
|||||||
@@ -4,10 +4,10 @@
|
|||||||
|
|
||||||
<insert id="insertBatch">
|
<insert id="insertBatch">
|
||||||
INSERT INTO zxjp_store_wishlist
|
INSERT INTO zxjp_store_wishlist
|
||||||
(line_id, store_type_id, option_id, quantity, total_amount, version_no, deleted, create_time, update_time)
|
(line_id, store_type_id, total_amount, version_no, wishlist_status, point_id, deleted, create_time, update_time)
|
||||||
VALUES
|
VALUES
|
||||||
<foreach collection="list" item="item" separator=",">
|
<foreach collection="list" item="item" separator=",">
|
||||||
(#{item.lineId}, #{item.storeTypeId}, #{item.optionId}, #{item.quantity}, #{item.totalAmount}, #{item.versionNo}, 0, NOW(), NOW())
|
(#{item.lineId}, #{item.storeTypeId}, #{item.totalAmount}, #{item.versionNo}, #{item.wishlistStatus}, #{item.pointId}, 0, NOW(), NOW())
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@@ -22,15 +22,41 @@
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
<select id="getById" resultType="com.cool.store.entity.order.StoreWishlistDO">
|
<select id="getById" resultType="com.cool.store.entity.order.StoreWishlistDO">
|
||||||
SELECT id, line_id, store_type_id, option_id, quantity, total_amount, version_no, deleted, create_time, update_time
|
SELECT id, line_id, store_type_id, total_amount, version_no, wishlist_status, point_id, deleted, create_time, update_time
|
||||||
FROM zxjp_store_wishlist
|
FROM zxjp_store_wishlist
|
||||||
WHERE id = #{id}
|
WHERE id = #{id}
|
||||||
AND deleted = 0
|
AND deleted = 0
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getByPointId" resultType="com.cool.store.entity.order.StoreWishlistDO">
|
||||||
|
SELECT id, line_id, store_type_id, total_amount, version_no, wishlist_status, point_id, deleted, create_time, update_time
|
||||||
|
FROM zxjp_store_wishlist
|
||||||
|
where deleted = 0
|
||||||
|
and wishlist_status !=15
|
||||||
|
<if test="lineId!=null">
|
||||||
|
and line_id = #{lineId}
|
||||||
|
</if>
|
||||||
|
<if test="pointId!=null">
|
||||||
|
and point_id = #{pointId}
|
||||||
|
</if>
|
||||||
|
limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getPointBindWishlistCount" resultType="java.lang.Integer">
|
||||||
|
select count(1) from zxjp_store_wishlist
|
||||||
|
where deleted = 0
|
||||||
|
<if test="pointId != null">
|
||||||
|
AND point_id = #{pointId}
|
||||||
|
</if>
|
||||||
|
<if test="wishlistStatus != null">
|
||||||
|
AND wishlist_status != #{wishlistStatus}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="listByLineIdAndStoreTypeAndVersion" resultType="com.cool.store.entity.order.StoreWishlistDO">
|
<select id="listByLineIdAndStoreTypeAndVersion" resultType="com.cool.store.entity.order.StoreWishlistDO">
|
||||||
SELECT id, line_id, store_type_id, option_id, quantity, total_amount, version_no, deleted, create_time, update_time
|
SELECT id, line_id, store_type_id, total_amount, version_no, wishlist_status, point_id, deleted, create_time, update_time
|
||||||
FROM zxjp_store_wishlist
|
FROM zxjp_store_wishlist
|
||||||
WHERE line_id = #{lineId}
|
WHERE line_id = #{lineId}
|
||||||
AND store_type_id = #{storeTypeId}
|
AND store_type_id = #{storeTypeId}
|
||||||
@@ -41,14 +67,17 @@
|
|||||||
|
|
||||||
<select id="listByLineId" resultType="com.cool.store.vo.order.MiniStoreWishlistListVO">
|
<select id="listByLineId" resultType="com.cool.store.vo.order.MiniStoreWishlistListVO">
|
||||||
SELECT
|
SELECT
|
||||||
|
w.id as wishlistId,
|
||||||
w.store_type_id AS storeTypeId,
|
w.store_type_id AS storeTypeId,
|
||||||
st.brand AS brand,
|
st.brand AS brand,
|
||||||
st.store_type_name AS storeTypeName,
|
st.store_type_name AS storeTypeName,
|
||||||
st.store_type AS storeType,
|
st.store_type AS storeType,
|
||||||
st.image_url AS imageUrl,
|
st.image_url AS imageUrl,
|
||||||
MIN(w.create_time) AS createTime,
|
w.create_time AS createTime,
|
||||||
MAX(w.total_amount) AS totalAmount,
|
w.total_amount AS totalAmount,
|
||||||
w.version_no AS versionNo
|
w.version_no AS versionNo,
|
||||||
|
w.point_id as pointId,
|
||||||
|
w.wishlist_status as wishlistStatus
|
||||||
FROM zxjp_store_wishlist w
|
FROM zxjp_store_wishlist w
|
||||||
LEFT JOIN zxjp_store_type st ON st.id = w.store_type_id
|
LEFT JOIN zxjp_store_type st ON st.id = w.store_type_id
|
||||||
WHERE w.line_id = #{lineId}
|
WHERE w.line_id = #{lineId}
|
||||||
@@ -56,48 +85,50 @@
|
|||||||
<if test="storeTypeId != null">
|
<if test="storeTypeId != null">
|
||||||
AND w.store_type_id = #{storeTypeId}
|
AND w.store_type_id = #{storeTypeId}
|
||||||
</if>
|
</if>
|
||||||
GROUP BY w.version_no
|
|
||||||
ORDER BY w.create_time DESC
|
ORDER BY w.create_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="listByVersionList" resultType="com.cool.store.vo.order.MiniStoreWishlistListVO">
|
<select id="listByVersionList" resultType="com.cool.store.vo.order.MiniStoreWishlistListVO">
|
||||||
SELECT
|
SELECT
|
||||||
|
w.id as wishlistId,
|
||||||
w.store_type_id AS storeTypeId,
|
w.store_type_id AS storeTypeId,
|
||||||
w.line_id as lineId,
|
w.line_id as lineId,
|
||||||
st.brand AS brand,
|
st.brand AS brand,
|
||||||
st.store_type_name AS storeTypeName,
|
st.store_type_name AS storeTypeName,
|
||||||
st.store_type AS storeType,
|
st.store_type AS storeType,
|
||||||
st.image_url AS imageUrl,
|
st.image_url AS imageUrl,
|
||||||
MIN(w.create_time) AS createTime,
|
w.create_time AS createTime,
|
||||||
MAX(w.total_amount) AS totalAmount,
|
w.total_amount AS totalAmount,
|
||||||
w.version_no AS versionNo
|
w.version_no AS versionNo,
|
||||||
|
w.point_id as pointId,
|
||||||
|
w.wishlist_status as wishlistStatus
|
||||||
FROM zxjp_store_wishlist w
|
FROM zxjp_store_wishlist w
|
||||||
LEFT JOIN zxjp_store_type st ON st.id = w.store_type_id
|
LEFT JOIN zxjp_store_type st ON st.id = w.store_type_id
|
||||||
WHERE w.deleted = 0
|
|
||||||
<if test="versionNoList != null and versionNoList.size>0">
|
|
||||||
and
|
|
||||||
<foreach collection="versionNoList" item="versionNo" separator="," open="w.version_no in (" close=")">
|
|
||||||
#{versionNo}
|
|
||||||
</foreach>
|
|
||||||
</if>
|
|
||||||
GROUP BY w.version_no
|
|
||||||
ORDER BY w.create_time DESC
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="versionNoList" resultType="java.lang.String">
|
|
||||||
SELECT DISTINCT version_no
|
|
||||||
FROM zxjp_store_wishlist a
|
|
||||||
<if test="keyword!=null and keyword !=''">
|
<if test="keyword!=null and keyword !=''">
|
||||||
left join xfsg_line_info b on a.line_id = b.id
|
left join xfsg_line_info b on w.line_id = b.id
|
||||||
</if>
|
</if>
|
||||||
WHERE a.deleted = 0
|
WHERE w.deleted = 0
|
||||||
<if test="storeTypeId!=null">
|
<if test="storeTypeId != null">
|
||||||
and a.store_type_id = #{storeTypeId}
|
AND w.store_type_id = #{storeTypeId}
|
||||||
|
</if>
|
||||||
|
<if test="wishlistStatus != null">
|
||||||
|
AND w.wishlist_status = #{wishlistStatus}
|
||||||
</if>
|
</if>
|
||||||
<if test="keyword!=null and keyword !=''">
|
<if test="keyword!=null and keyword !=''">
|
||||||
and (b.username like concat("%", #{keyword}, "%") or b.mobile like concat("%", #{keyword}, "%"))
|
and (b.username like concat("%", #{keyword}, "%") or b.mobile like concat("%", #{keyword}, "%"))
|
||||||
</if>
|
</if>
|
||||||
ORDER BY version_no desc
|
ORDER BY w.create_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<update id="updateByLineId">
|
||||||
|
UPDATE zxjp_store_wishlist
|
||||||
|
SET wishlist_status = 5,
|
||||||
|
update_time = NOW()
|
||||||
|
WHERE wishlist_status = 0
|
||||||
|
and line_id = #{lineId}
|
||||||
|
AND deleted = 0
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.cool.store.mapper.order.StoreWishlistOptionMapper">
|
||||||
|
|
||||||
|
<insert id="insertBatch">
|
||||||
|
INSERT INTO zxjp_store_wishlist_option
|
||||||
|
(wishlist_id, option_id, quantity, deleted, create_time, update_time)
|
||||||
|
VALUES
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(#{item.wishlistId}, #{item.optionId}, #{item.quantity}, 0, NOW(), NOW())
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="softDeleteByWishlistIds">
|
||||||
|
UPDATE zxjp_store_wishlist_option
|
||||||
|
SET deleted = 1,
|
||||||
|
update_time = NOW()
|
||||||
|
WHERE deleted = 0
|
||||||
|
AND wishlist_id IN
|
||||||
|
<foreach collection="wishlistIds" item="wishlistId" open="(" separator="," close=")">
|
||||||
|
#{wishlistId}
|
||||||
|
</foreach>
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id="listByWishlistIds" resultType="com.cool.store.entity.order.StoreWishlistOptionDO">
|
||||||
|
SELECT id, wishlist_id, option_id, quantity, deleted, create_time, update_time
|
||||||
|
FROM zxjp_store_wishlist_option
|
||||||
|
WHERE deleted = 0
|
||||||
|
AND wishlist_id IN
|
||||||
|
<foreach collection="wishlistIds" item="wishlistId" open="(" separator="," close=")">
|
||||||
|
#{wishlistId}
|
||||||
|
</foreach>
|
||||||
|
ORDER BY id ASC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -176,4 +176,40 @@ public class PointInfoDO {
|
|||||||
|
|
||||||
@Column(name = "protection_distance")
|
@Column(name = "protection_distance")
|
||||||
private Integer protectionDistance;
|
private Integer protectionDistance;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 位置描述 字典表
|
||||||
|
*/
|
||||||
|
@Column(name = "location_desc_code")
|
||||||
|
private String locationDescCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否用于正新AI店(1是0否)
|
||||||
|
*/
|
||||||
|
@Column(name = "use_ai")
|
||||||
|
private Integer useAi;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门内净深(m)
|
||||||
|
*/
|
||||||
|
@Column(name = "door_inner_depth")
|
||||||
|
private java.math.BigDecimal doorInnerDepth;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门内净宽(m)
|
||||||
|
*/
|
||||||
|
@Column(name = "door_inner_width")
|
||||||
|
private java.math.BigDecimal doorInnerWidth;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门内净高(m)
|
||||||
|
*/
|
||||||
|
@Column(name = "door_inner_height")
|
||||||
|
private java.math.BigDecimal doorInnerHeight;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 其他说明
|
||||||
|
*/
|
||||||
|
@Column(name = "other_desc")
|
||||||
|
private String otherDesc;
|
||||||
}
|
}
|
||||||
@@ -30,18 +30,18 @@ public class StoreWishlistDO {
|
|||||||
@Column(name = "store_type_id")
|
@Column(name = "store_type_id")
|
||||||
private Long storeTypeId;
|
private Long storeTypeId;
|
||||||
|
|
||||||
@Column(name = "option_id")
|
|
||||||
private Long optionId;
|
|
||||||
|
|
||||||
@Column(name = "quantity")
|
|
||||||
private BigDecimal quantity;
|
|
||||||
|
|
||||||
@Column(name = "total_amount")
|
@Column(name = "total_amount")
|
||||||
private BigDecimal totalAmount;
|
private BigDecimal totalAmount;
|
||||||
|
|
||||||
@Column(name = "version_no")
|
@Column(name = "version_no")
|
||||||
private String versionNo;
|
private String versionNo;
|
||||||
|
|
||||||
|
@Column(name = "wishlist_status")
|
||||||
|
private Integer wishlistStatus;
|
||||||
|
|
||||||
|
@Column(name = "point_id")
|
||||||
|
private Long pointId;
|
||||||
|
|
||||||
@Column(name = "deleted")
|
@Column(name = "deleted")
|
||||||
private Integer deleted;
|
private Integer deleted;
|
||||||
|
|
||||||
@@ -50,4 +50,6 @@ public class StoreWishlistDO {
|
|||||||
|
|
||||||
@Column(name = "update_time")
|
@Column(name = "update_time")
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
|
private String remark;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.cool.store.entity.order;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.GenerationType;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Table(name = "zxjp_store_wishlist_option")
|
||||||
|
public class StoreWishlistOptionDO {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Column(name = "wishlist_id")
|
||||||
|
private Long wishlistId;
|
||||||
|
|
||||||
|
@Column(name = "option_id")
|
||||||
|
private Long optionId;
|
||||||
|
|
||||||
|
@Column(name = "quantity")
|
||||||
|
private BigDecimal quantity;
|
||||||
|
|
||||||
|
@Column(name = "deleted")
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@Column(name = "create_time")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@Column(name = "update_time")
|
||||||
|
private Date updateTime;
|
||||||
|
}
|
||||||
@@ -11,6 +11,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import javax.validation.constraints.Max;
|
import javax.validation.constraints.Max;
|
||||||
import javax.validation.constraints.Min;
|
import javax.validation.constraints.Min;
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@@ -255,6 +256,24 @@ public class AddPointDetailRequest {
|
|||||||
@ApiModelProperty("保护距离")
|
@ApiModelProperty("保护距离")
|
||||||
private Integer protectionDistance;
|
private Integer protectionDistance;
|
||||||
|
|
||||||
|
@ApiModelProperty("位置描述 字典表")
|
||||||
|
private String locationDescCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否用于正新AI店(1是0否)")
|
||||||
|
private Integer useAi;
|
||||||
|
|
||||||
|
@ApiModelProperty("门内净深(m)")
|
||||||
|
private BigDecimal doorInnerDepth;
|
||||||
|
|
||||||
|
@ApiModelProperty("门内净宽(m)")
|
||||||
|
private BigDecimal doorInnerWidth;
|
||||||
|
|
||||||
|
@ApiModelProperty("门内净高(m)")
|
||||||
|
private BigDecimal doorInnerHeight;
|
||||||
|
|
||||||
|
@ApiModelProperty("其他说明")
|
||||||
|
private String otherDesc;
|
||||||
|
|
||||||
public static PointDetailInfoDO convertDO(AddPointDetailRequest request) {
|
public static PointDetailInfoDO convertDO(AddPointDetailRequest request) {
|
||||||
PointDetailInfoDO result = new PointDetailInfoDO();
|
PointDetailInfoDO result = new PointDetailInfoDO();
|
||||||
result.setBusinessStatus(request.getBusinessStatus());
|
result.setBusinessStatus(request.getBusinessStatus());
|
||||||
@@ -323,6 +342,12 @@ public class AddPointDetailRequest {
|
|||||||
result.setDistrict(request.getDistrict());
|
result.setDistrict(request.getDistrict());
|
||||||
result.setTownship(request.getTownship());
|
result.setTownship(request.getTownship());
|
||||||
result.setProtectionDistance(request.getProtectionDistance());
|
result.setProtectionDistance(request.getProtectionDistance());
|
||||||
|
result.setLocationDescCode(request.getLocationDescCode());
|
||||||
|
result.setUseAi(request.getUseAi());
|
||||||
|
result.setDoorInnerDepth(request.getDoorInnerDepth());
|
||||||
|
result.setDoorInnerWidth(request.getDoorInnerWidth());
|
||||||
|
result.setDoorInnerHeight(request.getDoorInnerHeight());
|
||||||
|
result.setOtherDesc(request.getOtherDesc());
|
||||||
if(StringUtils.isAnyBlank(result.getProvince(),result.getCity(), result.getDistrict(), result.getTownship())){
|
if(StringUtils.isAnyBlank(result.getProvince(),result.getCity(), result.getDistrict(), result.getTownship())){
|
||||||
GeoMapUtil.AddressInfo addressInfo = GeoMapUtil.reverseGeoCoding(result.getLatitude(), result.getLongitude());
|
GeoMapUtil.AddressInfo addressInfo = GeoMapUtil.reverseGeoCoding(result.getLatitude(), result.getLongitude());
|
||||||
if(Objects.nonNull(addressInfo)){
|
if(Objects.nonNull(addressInfo)){
|
||||||
|
|||||||
@@ -23,12 +23,17 @@ public class RecommendPointPageRequest extends PageBasicInfo {
|
|||||||
@ApiModelProperty(value = "拓展专员", hidden = true)
|
@ApiModelProperty(value = "拓展专员", hidden = true)
|
||||||
private String developmentManager;
|
private String developmentManager;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "线索ID", hidden = true)
|
||||||
|
private Long lineId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "铺位状态列表", hidden = true)
|
@ApiModelProperty(value = "铺位状态列表", hidden = true)
|
||||||
private List<Integer> pointStatusList;
|
private List<Integer> pointStatusList;
|
||||||
|
|
||||||
@ApiModelProperty(value = "铺位名称 模糊搜索")
|
@ApiModelProperty(value = "铺位名称 模糊搜索")
|
||||||
private String pointName;
|
private String pointName;
|
||||||
|
|
||||||
|
private Integer useAi;
|
||||||
|
|
||||||
public List<Integer> getPointStatusList() {
|
public List<Integer> getPointStatusList() {
|
||||||
List<Integer> pointStatusList = new ArrayList<>();
|
List<Integer> pointStatusList = new ArrayList<>();
|
||||||
if (pointStatus != null) {
|
if (pointStatus != null) {
|
||||||
|
|||||||
@@ -89,6 +89,12 @@ public class UpdatePointDetailRequest extends AddPointDetailRequest {
|
|||||||
result.setDistrict(request.getDistrict());
|
result.setDistrict(request.getDistrict());
|
||||||
result.setTownship(request.getTownship());
|
result.setTownship(request.getTownship());
|
||||||
result.setProtectionDistance(request.getProtectionDistance());
|
result.setProtectionDistance(request.getProtectionDistance());
|
||||||
|
result.setLocationDescCode(request.getLocationDescCode());
|
||||||
|
result.setUseAi(request.getUseAi());
|
||||||
|
result.setDoorInnerDepth(request.getDoorInnerDepth());
|
||||||
|
result.setDoorInnerWidth(request.getDoorInnerWidth());
|
||||||
|
result.setDoorInnerHeight(request.getDoorInnerHeight());
|
||||||
|
result.setOtherDesc(request.getOtherDesc());
|
||||||
if(StringUtils.isAnyBlank(result.getProvince(),result.getCity(), result.getDistrict(), result.getTownship())){
|
if(StringUtils.isAnyBlank(result.getProvince(),result.getCity(), result.getDistrict(), result.getTownship())){
|
||||||
GeoMapUtil.AddressInfo addressInfo = GeoMapUtil.reverseGeoCoding(result.getLatitude(), result.getLongitude());
|
GeoMapUtil.AddressInfo addressInfo = GeoMapUtil.reverseGeoCoding(result.getLatitude(), result.getLongitude());
|
||||||
if(Objects.nonNull(addressInfo)){
|
if(Objects.nonNull(addressInfo)){
|
||||||
|
|||||||
@@ -15,12 +15,9 @@ import javax.validation.constraints.NotNull;
|
|||||||
@Data
|
@Data
|
||||||
public class MiniStoreWishlistDelRequest {
|
public class MiniStoreWishlistDelRequest {
|
||||||
|
|
||||||
@ApiModelProperty("店型ID")
|
@ApiModelProperty("心愿单ID")
|
||||||
@NotNull
|
@NotNull
|
||||||
private Long storeTypeId;
|
private Long wishlistId;
|
||||||
|
|
||||||
@ApiModelProperty("版本号")
|
|
||||||
@NotBlank
|
|
||||||
private String versionNo;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import java.util.List;
|
|||||||
@Data
|
@Data
|
||||||
public class MiniStoreWishlistSaveRequest {
|
public class MiniStoreWishlistSaveRequest {
|
||||||
|
|
||||||
@ApiModelProperty("版本号")
|
@ApiModelProperty("心愿单ID-修改")
|
||||||
private String versionNo;
|
private Long wishlistId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "店型ID", required = true)
|
@ApiModelProperty(value = "店型ID", required = true)
|
||||||
@NotNull(message = "店型ID不能为空")
|
@NotNull(message = "店型ID不能为空")
|
||||||
|
|||||||
@@ -15,5 +15,6 @@ public class WishAllListRequest extends PageBasicInfo {
|
|||||||
|
|
||||||
private Long storeTypeId;
|
private Long storeTypeId;
|
||||||
|
|
||||||
|
private Integer wishlistStatus;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.cool.store.request.order;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Auther zx_szh
|
||||||
|
* @Date 2026/3/19 10:22
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WishlistAuditRequest {
|
||||||
|
|
||||||
|
@ApiModelProperty("心愿单ID")
|
||||||
|
private Long wishlistId;
|
||||||
|
@ApiModelProperty("1-通过 0-拒绝")
|
||||||
|
private Integer auditStatus;
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.cool.store.request.order;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Auther zx_szh
|
||||||
|
* @Date 2026/3/18 16:08
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WishlistBindPointRequest {
|
||||||
|
|
||||||
|
@ApiModelProperty("点位ID")
|
||||||
|
@NotNull
|
||||||
|
private Long pointId;
|
||||||
|
@ApiModelProperty("心愿单ID")
|
||||||
|
@NotNull
|
||||||
|
private Long wishlistId;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -43,6 +43,8 @@ public class MiniStoreOrderDetailVO {
|
|||||||
@ApiModelProperty("门店类型")
|
@ApiModelProperty("门店类型")
|
||||||
private Integer storeType;
|
private Integer storeType;
|
||||||
|
|
||||||
|
private String storeTypeName;
|
||||||
|
|
||||||
@ApiModelProperty("下单时间")
|
@ApiModelProperty("下单时间")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,16 @@ public class MiniStoreWishlistDetailVO {
|
|||||||
@ApiModelProperty("总金额")
|
@ApiModelProperty("总金额")
|
||||||
private BigDecimal totalAmount;
|
private BigDecimal totalAmount;
|
||||||
|
|
||||||
|
private Long pointId;
|
||||||
|
|
||||||
|
private Long shopId;
|
||||||
|
|
||||||
|
private Integer storeType;
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private Integer wishlistStatus;
|
||||||
|
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
private String partnerName;
|
private String partnerName;
|
||||||
|
|||||||
@@ -12,9 +12,18 @@ import java.util.List;
|
|||||||
@Data
|
@Data
|
||||||
public class MiniStoreWishlistListVO {
|
public class MiniStoreWishlistListVO {
|
||||||
|
|
||||||
|
@ApiModelProperty("心愿单ID")
|
||||||
|
private Long wishlistId;
|
||||||
|
|
||||||
@ApiModelProperty("店型ID")
|
@ApiModelProperty("店型ID")
|
||||||
private Long storeTypeId;
|
private Long storeTypeId;
|
||||||
|
|
||||||
|
private Long pointId;
|
||||||
|
|
||||||
|
private Long shopId;
|
||||||
|
|
||||||
|
private Integer wishlistStatus;
|
||||||
|
|
||||||
private Long lineId;
|
private Long lineId;
|
||||||
|
|
||||||
private String partnerName;
|
private String partnerName;
|
||||||
|
|||||||
@@ -284,6 +284,24 @@ public class PointDetailVO {
|
|||||||
@ApiModelProperty("保护距离")
|
@ApiModelProperty("保护距离")
|
||||||
private Integer protectionDistance;
|
private Integer protectionDistance;
|
||||||
|
|
||||||
|
@ApiModelProperty("位置描述 字典表")
|
||||||
|
private String locationDescCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否用于正新AI店(1是0否)")
|
||||||
|
private Integer useAi;
|
||||||
|
|
||||||
|
@ApiModelProperty("门内净深(m)")
|
||||||
|
private java.math.BigDecimal doorInnerDepth;
|
||||||
|
|
||||||
|
@ApiModelProperty("门内净宽(m)")
|
||||||
|
private java.math.BigDecimal doorInnerWidth;
|
||||||
|
|
||||||
|
@ApiModelProperty("门内净高(m)")
|
||||||
|
private java.math.BigDecimal doorInnerHeight;
|
||||||
|
|
||||||
|
@ApiModelProperty("其他说明")
|
||||||
|
private String otherDesc;
|
||||||
|
|
||||||
public static PointDetailVO convertVO(PointInfoDO pointInfo, PointDetailInfoDO pointDetailInfo) {
|
public static PointDetailVO convertVO(PointInfoDO pointInfo, PointDetailInfoDO pointDetailInfo) {
|
||||||
PointDetailVO result = new PointDetailVO();
|
PointDetailVO result = new PointDetailVO();
|
||||||
result.setPointId(pointInfo.getId());
|
result.setPointId(pointInfo.getId());
|
||||||
@@ -371,6 +389,12 @@ public class PointDetailVO {
|
|||||||
result.setDistrictCode(pointInfo.getDistrictCode());
|
result.setDistrictCode(pointInfo.getDistrictCode());
|
||||||
result.setLocation(pointInfo.getPointLocation());
|
result.setLocation(pointInfo.getPointLocation());
|
||||||
result.setProtectionDistance(pointInfo.getProtectionDistance());
|
result.setProtectionDistance(pointInfo.getProtectionDistance());
|
||||||
|
result.setLocationDescCode(pointInfo.getLocationDescCode());
|
||||||
|
result.setUseAi(pointInfo.getUseAi());
|
||||||
|
result.setDoorInnerDepth(pointInfo.getDoorInnerDepth());
|
||||||
|
result.setDoorInnerWidth(pointInfo.getDoorInnerWidth());
|
||||||
|
result.setDoorInnerHeight(pointInfo.getDoorInnerHeight());
|
||||||
|
result.setOtherDesc(pointInfo.getOtherDesc());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.cool.store.request.*;
|
|||||||
import com.cool.store.request.point.AddPointFinancialDataRequest;
|
import com.cool.store.request.point.AddPointFinancialDataRequest;
|
||||||
import com.cool.store.request.point.UpdatePointFinancialDataRequest;
|
import com.cool.store.request.point.UpdatePointFinancialDataRequest;
|
||||||
import com.cool.store.vo.LinePointBaseInfoVO;
|
import com.cool.store.vo.LinePointBaseInfoVO;
|
||||||
|
import com.cool.store.vo.PartnerUserInfoVO;
|
||||||
import com.cool.store.vo.point.*;
|
import com.cool.store.vo.point.*;
|
||||||
import com.cool.store.vo.shop.RentInfoToDoVO;
|
import com.cool.store.vo.shop.RentInfoToDoVO;
|
||||||
import com.cool.store.vo.shop.ShopPointBaseInfoVO;
|
import com.cool.store.vo.shop.ShopPointBaseInfoVO;
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ public interface ShopService {
|
|||||||
*/
|
*/
|
||||||
Integer initShop(LineInfoDO lineInfo);
|
Integer initShop(LineInfoDO lineInfo);
|
||||||
|
|
||||||
|
Long initAiShop(LineInfoDO lineInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取首页数据
|
* 获取首页数据
|
||||||
* @param lineId
|
* @param lineId
|
||||||
|
|||||||
@@ -326,12 +326,12 @@ public class DeskServiceImpl implements DeskService {
|
|||||||
List<Integer> subStageStatusList = new ArrayList<>();
|
List<Integer> subStageStatusList = new ArrayList<>();
|
||||||
List<Long> userRoleIds = enterpriseUserRoleMapper.getUserRoleIds(user.getUserId());
|
List<Long> userRoleIds = enterpriseUserRoleMapper.getUserRoleIds(user.getUserId());
|
||||||
//两个角色都包含
|
//两个角色都包含
|
||||||
if (userRoleIds.contains(UserRoleEnum.HEAD_OF_DESIGN.getCode())&&userRoleIds.contains(UserRoleEnum.FINANCE.getCode())){
|
if (userRoleIds.contains(UserRoleEnum.AI_STORE_TYPE_APPROVE.getCode())&&userRoleIds.contains(UserRoleEnum.FINANCE.getCode())){
|
||||||
subStageStatusList.add(SHOP_SUB_STAGE_STATUS_281.getShopSubStageStatus());
|
subStageStatusList.add(SHOP_SUB_STAGE_STATUS_281.getShopSubStageStatus());
|
||||||
subStageStatusList.add(SHOP_SUB_STAGE_STATUS_282.getShopSubStageStatus());
|
subStageStatusList.add(SHOP_SUB_STAGE_STATUS_282.getShopSubStageStatus());
|
||||||
}
|
}
|
||||||
//加盟内勤 待确认
|
//立规 待确认
|
||||||
if (userRoleIds.contains(UserRoleEnum.HEAD_OF_DESIGN.getCode())){
|
if (userRoleIds.contains(UserRoleEnum.AI_STORE_TYPE_APPROVE.getCode())){
|
||||||
subStageStatusList.add(SHOP_SUB_STAGE_STATUS_281.getShopSubStageStatus());
|
subStageStatusList.add(SHOP_SUB_STAGE_STATUS_281.getShopSubStageStatus());
|
||||||
}
|
}
|
||||||
//如果是财务 待财务确认
|
//如果是财务 待财务确认
|
||||||
|
|||||||
@@ -236,6 +236,9 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean skipIntentAgreement(Long lineId, LoginUserInfo user) {
|
public Boolean skipIntentAgreement(Long lineId, LoginUserInfo user) {
|
||||||
|
if (user==null){
|
||||||
|
user = new LoginUserInfo();
|
||||||
|
}
|
||||||
log.info("skipIntentAgreement lineId:{},操作人:{}", lineId, user.getName());
|
log.info("skipIntentAgreement lineId:{},操作人:{}", lineId, user.getName());
|
||||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(lineId);
|
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(lineId);
|
||||||
if (lineInfo == null) {
|
if (lineInfo == null) {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.cool.store.service.impl;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.cool.store.constants.CommonConstants;
|
import com.cool.store.constants.CommonConstants;
|
||||||
import com.cool.store.dao.*;
|
import com.cool.store.dao.*;
|
||||||
|
import com.cool.store.dao.order.StoreWishlistDAO;
|
||||||
import com.cool.store.entity.*;
|
import com.cool.store.entity.*;
|
||||||
import com.cool.store.enums.*;
|
import com.cool.store.enums.*;
|
||||||
import com.cool.store.exception.ServiceException;
|
import com.cool.store.exception.ServiceException;
|
||||||
@@ -66,6 +67,8 @@ public class JoinIntentionServiceImpl extends LineFlowService implements JoinInt
|
|||||||
CommonService commonService;
|
CommonService commonService;
|
||||||
@Resource
|
@Resource
|
||||||
HyPartnerUserInfoDAO hyPartnerUserInfoDAO;
|
HyPartnerUserInfoDAO hyPartnerUserInfoDAO;
|
||||||
|
@Resource
|
||||||
|
StoreWishlistDAO wishlistDAO;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -147,6 +150,8 @@ public class JoinIntentionServiceImpl extends LineFlowService implements JoinInt
|
|||||||
hyPartnerUserInfoDO.setDownstreamSystemSalting(salt);
|
hyPartnerUserInfoDO.setDownstreamSystemSalting(salt);
|
||||||
hyPartnerUserInfoDO.setUpdateTime(new Date());
|
hyPartnerUserInfoDO.setUpdateTime(new Date());
|
||||||
hyPartnerUserInfoDAO.updatePasswordByPartnerId(hyPartnerUserInfoDO);
|
hyPartnerUserInfoDAO.updatePasswordByPartnerId(hyPartnerUserInfoDO);
|
||||||
|
log.info("auditPass:大区老总审核通过");
|
||||||
|
wishlistDAO.updateByLineId(lineInfo.getId());
|
||||||
}
|
}
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -840,6 +840,10 @@ public class PointServiceImpl implements PointService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageInfo<PointPageVO> getRecommendPointList(RecommendPointPageRequest request) {
|
public PageInfo<PointPageVO> getRecommendPointList(RecommendPointPageRequest request) {
|
||||||
|
if (StringUtils.isEmpty(request.getDevelopmentManager())){
|
||||||
|
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
|
||||||
|
request.setDevelopmentManager(lineInfo.getInvestmentManager());
|
||||||
|
}
|
||||||
List<PointPageVO> resultList = new ArrayList();
|
List<PointPageVO> resultList = new ArrayList();
|
||||||
Page<PCPointListDTO> pointPage = pointInfoDAO.getRecommendPointList(request);
|
Page<PCPointListDTO> pointPage = pointInfoDAO.getRecommendPointList(request);
|
||||||
if (Objects.nonNull(pointPage) && CollectionUtils.isNotEmpty(pointPage.getResult())) {
|
if (Objects.nonNull(pointPage) && CollectionUtils.isNotEmpty(pointPage.getResult())) {
|
||||||
|
|||||||
@@ -3,12 +3,16 @@ package com.cool.store.service.impl;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.cool.store.constants.CommonConstants;
|
import com.cool.store.constants.CommonConstants;
|
||||||
import com.cool.store.dao.*;
|
import com.cool.store.dao.*;
|
||||||
|
import com.cool.store.dao.order.StoreOrderDAO;
|
||||||
|
import com.cool.store.dao.store.StoreTypeDAO;
|
||||||
import com.cool.store.dto.OpenInfoDTO;
|
import com.cool.store.dto.OpenInfoDTO;
|
||||||
import com.cool.store.dto.Preparation.PreparationDTO;
|
import com.cool.store.dto.Preparation.PreparationDTO;
|
||||||
import com.cool.store.dto.Preparation.ScheduleDTO;
|
import com.cool.store.dto.Preparation.ScheduleDTO;
|
||||||
import com.cool.store.dto.ShopNameAndCodeDTO;
|
import com.cool.store.dto.ShopNameAndCodeDTO;
|
||||||
import com.cool.store.dto.UserDTO;
|
import com.cool.store.dto.UserDTO;
|
||||||
import com.cool.store.entity.*;
|
import com.cool.store.entity.*;
|
||||||
|
import com.cool.store.entity.order.StoreOrderDO;
|
||||||
|
import com.cool.store.entity.store.StoreTypeDO;
|
||||||
import com.cool.store.enums.*;
|
import com.cool.store.enums.*;
|
||||||
import com.cool.store.enums.point.*;
|
import com.cool.store.enums.point.*;
|
||||||
import com.cool.store.enums.point.ShopStatusEnum;
|
import com.cool.store.enums.point.ShopStatusEnum;
|
||||||
@@ -119,6 +123,9 @@ public class ShopServiceImpl implements ShopService {
|
|||||||
ShopAccountService shopAccountService;
|
ShopAccountService shopAccountService;
|
||||||
@Resource
|
@Resource
|
||||||
PushService pushService;
|
PushService pushService;
|
||||||
|
@Autowired
|
||||||
|
private StoreOrderDAO storeOrderDAO;
|
||||||
|
private StoreTypeDAO storeTypeDAO;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -171,6 +178,46 @@ public class ShopServiceImpl implements ShopService {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long initAiShop(LineInfoDO lineInfo) {
|
||||||
|
if (Objects.isNull(lineInfo)) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
|
||||||
|
}
|
||||||
|
List<ShopInfoDO> shopList = shopInfoDAO.getShopList(lineInfo.getId());
|
||||||
|
int shopSize = shopList.size();
|
||||||
|
List<ShopInfoDO> addShopList = new ArrayList<>();
|
||||||
|
ShopInfoDO shopInfo = new ShopInfoDO();
|
||||||
|
shopInfo.setRegionId(lineInfo.getRegionId());
|
||||||
|
shopInfo.setLineId(lineInfo.getId());
|
||||||
|
shopInfo.setPartnerId(lineInfo.getPartnerId());
|
||||||
|
//初始化
|
||||||
|
shopInfo.setWantShopAreaId(lineInfo.getWantShopAreaId());
|
||||||
|
shopInfo.setDevelopmentManager(lineInfo.getDevelopmentManager());
|
||||||
|
shopInfo.setFranchiseBrand(lineInfo.getFranchiseBrand());
|
||||||
|
shopInfo.setJoinMode(lineInfo.getJoinMode());
|
||||||
|
shopInfo.setStoreNum(RandomEightCharCodeUtils.getCode());
|
||||||
|
shopInfo.setSupervisorUserId(lineInfo.getInvestmentManager());
|
||||||
|
shopInfo.setShopName("AI店铺" + NumberConverter.convertArabicToChinese(shopSize + 1));
|
||||||
|
shopInfo.setCreateTime(new Date());
|
||||||
|
shopInfo.setUseStandardStore(lineInfo.getUseStandardStore());
|
||||||
|
shopInfo.setInvestmentManager(lineInfo.getInvestmentManager());
|
||||||
|
shopInfo.setInvestRegionId(lineInfo.getInvestRegionId());
|
||||||
|
addShopList.add(shopInfo);
|
||||||
|
shopInfoDAO.batchAddShop(addShopList);
|
||||||
|
List<Long> shopIds = addShopList.stream().map(ShopInfoDO::getId).collect(Collectors.toList());
|
||||||
|
Integer result = shopStageInfoDAO.initShopStageInfo(lineInfo, addShopList, true);
|
||||||
|
//初始化平台账号
|
||||||
|
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(lineInfo.getPartnerId());
|
||||||
|
shopAccountDAO.initShopAccount(hyPartnerUserInfoDO, shopIds);
|
||||||
|
HashMap<String, String> map = new HashMap<>();
|
||||||
|
map.put("partnerUsername", lineInfo.getUsername());
|
||||||
|
map.put("partnerMobile", lineInfo.getMobile());
|
||||||
|
commonService.sendQWMessage(Collections.singletonList(lineInfo.getInvestmentManager()),
|
||||||
|
MessageEnum.MESSAGE_21,
|
||||||
|
map);
|
||||||
|
return shopInfo.getId();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Auther: wangshuo
|
* @Auther: wangshuo
|
||||||
* @Date: 2025/1/13
|
* @Date: 2025/1/13
|
||||||
@@ -883,6 +930,7 @@ public class ShopServiceImpl implements ShopService {
|
|||||||
case SHOP_SUB_STAGE_STATUS_280:
|
case SHOP_SUB_STAGE_STATUS_280:
|
||||||
case SHOP_SUB_STAGE_STATUS_283:
|
case SHOP_SUB_STAGE_STATUS_283:
|
||||||
case SHOP_SUB_STAGE_STATUS_284:
|
case SHOP_SUB_STAGE_STATUS_284:
|
||||||
|
case SHOP_SUB_STAGE_STATUS_281_5:
|
||||||
return Collections.singletonList(new UserDTO(lineInfo.getUsername(), lineInfo.getMobile()));
|
return Collections.singletonList(new UserDTO(lineInfo.getUsername(), lineInfo.getMobile()));
|
||||||
|
|
||||||
case SHOP_SUB_STAGE_STATUS_11:
|
case SHOP_SUB_STAGE_STATUS_11:
|
||||||
@@ -988,7 +1036,7 @@ public class ShopServiceImpl implements ShopService {
|
|||||||
case SHOP_SUB_STAGE_STATUS_172:
|
case SHOP_SUB_STAGE_STATUS_172:
|
||||||
return getUsersByRoleAndRegion(ORDER_GROUP, shopInfo.getRegionId());
|
return getUsersByRoleAndRegion(ORDER_GROUP, shopInfo.getRegionId());
|
||||||
case SHOP_SUB_STAGE_STATUS_281:
|
case SHOP_SUB_STAGE_STATUS_281:
|
||||||
return getUsersByRolesAndRegion(Arrays.asList(JOIN_OFFICE), shopInfo.getInvestRegionId());
|
return getUsersByRole(AI_STORE_TYPE_APPROVE);
|
||||||
default:
|
default:
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,10 +50,15 @@ public interface MiniStoreOrderService {
|
|||||||
|
|
||||||
Boolean deleted(MiniStoreWishlistDelRequest miniStoreWishlistDelRequest,PartnerUserInfoVO userInfoVO);
|
Boolean deleted(MiniStoreWishlistDelRequest miniStoreWishlistDelRequest,PartnerUserInfoVO userInfoVO);
|
||||||
|
|
||||||
MiniStoreWishlistDetailVO wishlistDetail(Long storeTypeId,String versionNo, Long lineId);
|
MiniStoreWishlistDetailVO wishlistDetail(Long wishlistId);
|
||||||
|
|
||||||
List<MiniStoreWishlistListVO> wishlistList(PartnerUserInfoVO userInfoVO);
|
List<MiniStoreWishlistListVO> wishlistList(PartnerUserInfoVO userInfoVO);
|
||||||
|
|
||||||
PageInfo<MiniStoreWishlistListVO> wishAllList(WishAllListRequest request);
|
PageInfo<MiniStoreWishlistListVO> wishAllList(WishAllListRequest request);
|
||||||
|
|
||||||
|
Boolean wishlistBindPoint(WishlistBindPointRequest request);
|
||||||
|
|
||||||
|
Boolean wishlistApprove(WishlistAuditRequest request,LoginUserInfo userInfo);
|
||||||
|
|
||||||
|
MiniStoreWishlistDetailVO getCurrentShopBindWishlist(Long shopId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,9 +15,11 @@ import com.cool.store.dao.order.PreAllocationRecordDAO;
|
|||||||
import com.cool.store.dao.order.StoreOrderDAO;
|
import com.cool.store.dao.order.StoreOrderDAO;
|
||||||
import com.cool.store.dao.order.StoreOrderOptionSnapshotDAO;
|
import com.cool.store.dao.order.StoreOrderOptionSnapshotDAO;
|
||||||
import com.cool.store.dao.order.StoreWishlistDAO;
|
import com.cool.store.dao.order.StoreWishlistDAO;
|
||||||
|
import com.cool.store.dao.order.StoreWishlistOptionDAO;
|
||||||
import com.cool.store.dao.store.StoreTypeDAO;
|
import com.cool.store.dao.store.StoreTypeDAO;
|
||||||
import com.cool.store.dao.store.StoreTypeOptionDAO;
|
import com.cool.store.dao.store.StoreTypeOptionDAO;
|
||||||
import com.cool.store.dao.wallet.WalletTradeDAO;
|
import com.cool.store.dao.wallet.WalletTradeDAO;
|
||||||
|
import com.cool.store.dto.PointInfoDTO;
|
||||||
import com.cool.store.entity.*;
|
import com.cool.store.entity.*;
|
||||||
import com.cool.store.entity.config.ConfigOptionDO;
|
import com.cool.store.entity.config.ConfigOptionDO;
|
||||||
import com.cool.store.entity.dict.SysDictTableDO;
|
import com.cool.store.entity.dict.SysDictTableDO;
|
||||||
@@ -26,6 +28,7 @@ import com.cool.store.entity.order.PreAllocationRecordDO;
|
|||||||
import com.cool.store.entity.order.StoreOrderDO;
|
import com.cool.store.entity.order.StoreOrderDO;
|
||||||
import com.cool.store.entity.order.StoreOrderOptionSnapshotDO;
|
import com.cool.store.entity.order.StoreOrderOptionSnapshotDO;
|
||||||
import com.cool.store.entity.order.StoreWishlistDO;
|
import com.cool.store.entity.order.StoreWishlistDO;
|
||||||
|
import com.cool.store.entity.order.StoreWishlistOptionDO;
|
||||||
import com.cool.store.entity.store.StoreTypeDO;
|
import com.cool.store.entity.store.StoreTypeDO;
|
||||||
import com.cool.store.entity.store.StoreTypeOptionDO;
|
import com.cool.store.entity.store.StoreTypeOptionDO;
|
||||||
import com.cool.store.entity.wallet.WalletTradeDO;
|
import com.cool.store.entity.wallet.WalletTradeDO;
|
||||||
@@ -33,15 +36,21 @@ import com.cool.store.enums.*;
|
|||||||
import com.cool.store.enums.fees.AllocationPayStatusEnum;
|
import com.cool.store.enums.fees.AllocationPayStatusEnum;
|
||||||
import com.cool.store.enums.fees.WalletFeeItemEnum;
|
import com.cool.store.enums.fees.WalletFeeItemEnum;
|
||||||
import com.cool.store.enums.order.StoreOrderStatusEnum;
|
import com.cool.store.enums.order.StoreOrderStatusEnum;
|
||||||
|
import com.cool.store.enums.order.WishlistStatusEnum;
|
||||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||||
import com.cool.store.enums.wallet.WalletTradeModuleEnum;
|
import com.cool.store.enums.wallet.WalletTradeModuleEnum;
|
||||||
import com.cool.store.exception.ServiceException;
|
import com.cool.store.exception.ServiceException;
|
||||||
import com.cool.store.dto.wallet.BatchTransferDTO;
|
import com.cool.store.dto.wallet.BatchTransferDTO;
|
||||||
import com.cool.store.mapper.ShopAuditInfoMapper;
|
import com.cool.store.mapper.ShopAuditInfoMapper;
|
||||||
|
import com.cool.store.request.PointRecommendLineRequest;
|
||||||
|
import com.cool.store.request.SelectPointRequest;
|
||||||
|
import com.cool.store.request.SysRoleRequest;
|
||||||
import com.cool.store.request.order.*;
|
import com.cool.store.request.order.*;
|
||||||
import com.cool.store.request.dict.DictColumnQueryRequest;
|
import com.cool.store.request.dict.DictColumnQueryRequest;
|
||||||
import com.cool.store.request.wallet.BatchTransferRequest;
|
import com.cool.store.request.wallet.BatchTransferRequest;
|
||||||
import com.cool.store.service.OperationLogService;
|
import com.cool.store.service.OperationLogService;
|
||||||
|
import com.cool.store.service.PointService;
|
||||||
|
import com.cool.store.service.ShopService;
|
||||||
import com.cool.store.service.UserAuthMappingService;
|
import com.cool.store.service.UserAuthMappingService;
|
||||||
import com.cool.store.service.dict.DictColumnService;
|
import com.cool.store.service.dict.DictColumnService;
|
||||||
import com.cool.store.service.order.MiniStoreOrderService;
|
import com.cool.store.service.order.MiniStoreOrderService;
|
||||||
@@ -68,9 +77,11 @@ import io.swagger.models.auth.In;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.MessageFormat;
|
import java.text.MessageFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
@@ -93,6 +104,7 @@ public class MiniStoreOrderServiceImpl implements MiniStoreOrderService {
|
|||||||
private final StoreOrderDAO storeOrderDAO;
|
private final StoreOrderDAO storeOrderDAO;
|
||||||
private final StoreOrderOptionSnapshotDAO snapshotDAO;
|
private final StoreOrderOptionSnapshotDAO snapshotDAO;
|
||||||
private final StoreWishlistDAO storeWishlistDAO;
|
private final StoreWishlistDAO storeWishlistDAO;
|
||||||
|
private final StoreWishlistOptionDAO storeWishlistOptionDAO;
|
||||||
private final ShopInfoDAO shopInfoDAO;
|
private final ShopInfoDAO shopInfoDAO;
|
||||||
private final LineInfoDAO lineInfoDAO;
|
private final LineInfoDAO lineInfoDAO;
|
||||||
private final StoreTypeDAO storeTypeDAO;
|
private final StoreTypeDAO storeTypeDAO;
|
||||||
@@ -114,6 +126,10 @@ public class MiniStoreOrderServiceImpl implements MiniStoreOrderService {
|
|||||||
private final OperationLogDAO operationLogDAO;
|
private final OperationLogDAO operationLogDAO;
|
||||||
private final ConfigItemCategoryDAO configItemCategoryDAO;
|
private final ConfigItemCategoryDAO configItemCategoryDAO;
|
||||||
private final ConfigItemDAO configItemDAO;
|
private final ConfigItemDAO configItemDAO;
|
||||||
|
private final QualificationsInfoDAO qualificationsInfoDAO;
|
||||||
|
private final PointService pointService;
|
||||||
|
private final PointInfoDAO pointInfoDAO;
|
||||||
|
private final ShopService shopService;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -329,10 +345,11 @@ public class MiniStoreOrderServiceImpl implements MiniStoreOrderService {
|
|||||||
operationLogService.addOperationLog(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_280, user.getPartnerId(), user.getUsername(),
|
operationLogService.addOperationLog(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_280, user.getPartnerId(), user.getUsername(),
|
||||||
OperationTypeEnum.OPERATION_TYPE_0, "店型选购提交", OperationStatusEnum.PROCESSED);
|
OperationTypeEnum.OPERATION_TYPE_0, "店型选购提交", OperationStatusEnum.PROCESSED);
|
||||||
|
|
||||||
List<EnterpriseUserDO> users = userAuthMappingService.getUserIdByRoleEnumAndRegionId(Collections.singletonList(UserRoleEnum.JOIN_OFFICE),
|
SysRoleRequest sysRoleRequest = new SysRoleRequest();
|
||||||
shopInfo.getInvestRegionId());
|
sysRoleRequest.setRoleName(AI_STORE_TYPE_APPROVE.getDesc());
|
||||||
|
List<EnterpriseUserDO> userListByRole = userAuthMappingService.findUserListByRole(sysRoleRequest, false);
|
||||||
operationLogService.addOperationLog(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_281,
|
operationLogService.addOperationLog(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_281,
|
||||||
user.getPartnerId(), users,
|
user.getPartnerId(), userListByRole,
|
||||||
OperationTypeEnum.OPERATION_TYPE_1, "店型选购待立规审批", OperationStatusEnum.NOT_PROCESSED, 1);
|
OperationTypeEnum.OPERATION_TYPE_1, "店型选购待立规审批", OperationStatusEnum.NOT_PROCESSED, 1);
|
||||||
|
|
||||||
return order.getId();
|
return order.getId();
|
||||||
@@ -349,11 +366,14 @@ public class MiniStoreOrderServiceImpl implements MiniStoreOrderService {
|
|||||||
|
|
||||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(order.getShopId());
|
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(order.getShopId());
|
||||||
|
|
||||||
|
StoreTypeDO storeType = storeTypeDAO.getById(order.getStoreTypeId());
|
||||||
|
|
||||||
MiniStoreOrderDetailVO vo = new MiniStoreOrderDetailVO();
|
MiniStoreOrderDetailVO vo = new MiniStoreOrderDetailVO();
|
||||||
|
|
||||||
MiniStoreOrderDetailVO.OrderInfoVO orderInfo = new MiniStoreOrderDetailVO.OrderInfoVO();
|
MiniStoreOrderDetailVO.OrderInfoVO orderInfo = new MiniStoreOrderDetailVO.OrderInfoVO();
|
||||||
orderInfo.setStoreType(order.getStoreType());
|
orderInfo.setStoreType(order.getStoreType());
|
||||||
orderInfo.setStoreTypeId(order.getStoreTypeId());
|
orderInfo.setStoreTypeId(order.getStoreTypeId());
|
||||||
|
orderInfo.setStoreTypeName(storeType.getStoreTypeName());
|
||||||
orderInfo.setOrderNo(order.getOrderNo());
|
orderInfo.setOrderNo(order.getOrderNo());
|
||||||
orderInfo.setOrderId(order.getId());
|
orderInfo.setOrderId(order.getId());
|
||||||
orderInfo.setShopId(order.getShopId());
|
orderInfo.setShopId(order.getShopId());
|
||||||
@@ -557,15 +577,6 @@ public class MiniStoreOrderServiceImpl implements MiniStoreOrderService {
|
|||||||
//处理审批记录 通过
|
//处理审批记录 通过
|
||||||
handleAudit(order.getShopId(),user,0,request.getRemark(),ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_281);
|
handleAudit(order.getShopId(),user,0,request.getRemark(),ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_281);
|
||||||
|
|
||||||
List<EnterpriseUserDO> users = userAuthMappingService.getUserIdByRoleEnumAndRegionId(Arrays.asList(HEAD_OF_DESIGN), shopInfoDAO.getShopInfo(order.getShopId()).getRegionId());
|
|
||||||
List<String> userIds = new ArrayList<>();
|
|
||||||
if (CollectionUtils.isNotEmpty(users)) {
|
|
||||||
userIds = users.stream().map(EnterpriseUserDO::getUserId).collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
operationLogService.addOperationLog(order.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_281_5,
|
|
||||||
user.getUserId(), users,
|
|
||||||
OperationTypeEnum.OPERATION_TYPE_1, "店型选配待招商经理审批", OperationStatusEnum.NOT_PROCESSED);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if (INVEST_MANAGER_CONFIRM.getCode().equals(currentStatus)){
|
if (INVEST_MANAGER_CONFIRM.getCode().equals(currentStatus)){
|
||||||
order.setStatus(FINANCIAL_CONFIRM.getCode());
|
order.setStatus(FINANCIAL_CONFIRM.getCode());
|
||||||
@@ -574,9 +585,6 @@ public class MiniStoreOrderServiceImpl implements MiniStoreOrderService {
|
|||||||
//修改阶段数据
|
//修改阶段数据
|
||||||
shopStageInfoDAO.updateShopStageInfo(order.getShopId(),ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_282);
|
shopStageInfoDAO.updateShopStageInfo(order.getShopId(),ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_282);
|
||||||
|
|
||||||
//处理审批记录 通过
|
|
||||||
handleAudit(order.getShopId(),user,0,request.getRemark(),ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_281_5);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
@@ -603,12 +611,10 @@ public class MiniStoreOrderServiceImpl implements MiniStoreOrderService {
|
|||||||
ShopSubStageStatusEnum current = null;
|
ShopSubStageStatusEnum current = null;
|
||||||
if (WAIT_CONFIRM.getCode().equals(currentStatus)){
|
if (WAIT_CONFIRM.getCode().equals(currentStatus)){
|
||||||
current = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_281;
|
current = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_281;
|
||||||
}
|
|
||||||
if (INVEST_MANAGER_CONFIRM.getCode().equals(currentStatus)){
|
|
||||||
current = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_281_5;
|
|
||||||
}
|
|
||||||
//处理审批记录
|
//处理审批记录
|
||||||
handleAudit(order.getShopId(),userInfo,1,request.getRemark(),current);
|
handleAudit(order.getShopId(),userInfo,1,request.getRemark(),current);
|
||||||
|
}
|
||||||
|
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -825,11 +831,11 @@ public class MiniStoreOrderServiceImpl implements MiniStoreOrderService {
|
|||||||
operationLogService.addOperationLog(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_280, user.getPartnerId(), user.getUsername(),
|
operationLogService.addOperationLog(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_280, user.getPartnerId(), user.getUsername(),
|
||||||
OperationTypeEnum.OPERATION_TYPE_0, "店型选购提交", OperationStatusEnum.PROCESSED);
|
OperationTypeEnum.OPERATION_TYPE_0, "店型选购提交", OperationStatusEnum.PROCESSED);
|
||||||
|
|
||||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(order.getShopId());
|
SysRoleRequest sysRoleRequest = new SysRoleRequest();
|
||||||
List<EnterpriseUserDO> users = userAuthMappingService.getUserIdByRoleEnumAndRegionId(Collections.singletonList(UserRoleEnum.JOIN_OFFICE),
|
sysRoleRequest.setRoleName(AI_STORE_TYPE_APPROVE.getDesc());
|
||||||
shopInfo.getInvestRegionId());
|
List<EnterpriseUserDO> userListByRole = userAuthMappingService.findUserListByRole(sysRoleRequest, false);
|
||||||
operationLogService.addOperationLog(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_281,
|
operationLogService.addOperationLog(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_281,
|
||||||
user.getPartnerId(), users,
|
user.getPartnerId(), userListByRole,
|
||||||
OperationTypeEnum.OPERATION_TYPE_1, "店型选购待立规审批", OperationStatusEnum.NOT_PROCESSED, 1);
|
OperationTypeEnum.OPERATION_TYPE_1, "店型选购待立规审批", OperationStatusEnum.NOT_PROCESSED, 1);
|
||||||
|
|
||||||
return order.getId();
|
return order.getId();
|
||||||
@@ -1292,12 +1298,14 @@ public class MiniStoreOrderServiceImpl implements MiniStoreOrderService {
|
|||||||
optionMap = options.stream().collect(Collectors.toMap(ConfigOptionDO::getId, Function.identity(), (a, b) -> a));
|
optionMap = options.stream().collect(Collectors.toMap(ConfigOptionDO::getId, Function.identity(), (a, b) -> a));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request.getVersionNo() != null) {
|
if (request.getWishlistId() != null) {
|
||||||
storeWishlistDAO.softDeleteByLineIdAndStoreTypeAndVersion(userInfoVO.getLineId(), request.getStoreTypeId(), request.getVersionNo());
|
MiniStoreWishlistDelRequest miniStoreWishlistDelRequest = new MiniStoreWishlistDelRequest();
|
||||||
|
miniStoreWishlistDelRequest.setWishlistId(request.getWishlistId());
|
||||||
|
//删除逻辑
|
||||||
|
deleted(miniStoreWishlistDelRequest,null);
|
||||||
}
|
}
|
||||||
|
|
||||||
String versionNo = generateOrderNo();
|
String versionNo = generateOrderNo();
|
||||||
List<StoreWishlistDO> saveList = new ArrayList<>();
|
|
||||||
BigDecimal totalAmount = BigDecimal.ZERO;
|
BigDecimal totalAmount = BigDecimal.ZERO;
|
||||||
|
|
||||||
BigDecimal storeFixedAmount = safe(storeType.getFranchiseFee())
|
BigDecimal storeFixedAmount = safe(storeType.getFranchiseFee())
|
||||||
@@ -1326,67 +1334,279 @@ public class MiniStoreOrderServiceImpl implements MiniStoreOrderService {
|
|||||||
BigDecimal quantity = selected.getQuantity();
|
BigDecimal quantity = selected.getQuantity();
|
||||||
BigDecimal defaultQty = binding.getDefaultQuantity();
|
BigDecimal defaultQty = binding.getDefaultQuantity();
|
||||||
BigDecimal amount = BigDecimal.ZERO;
|
BigDecimal amount = BigDecimal.ZERO;
|
||||||
//原价
|
|
||||||
BigDecimal originalPrice = cfg.getOriginalOptionPrice();
|
BigDecimal originalPrice = cfg.getOriginalOptionPrice();
|
||||||
if(quantity.compareTo(defaultQty)<=0){
|
if (quantity.compareTo(defaultQty) <= 0) {
|
||||||
amount = price.multiply(quantity);
|
amount = price.multiply(quantity);
|
||||||
}else {
|
} else {
|
||||||
// 店型优惠价*默认数量 + 原价 *(选择数量-默认数量)
|
|
||||||
amount = price.multiply(defaultQty).add(originalPrice.multiply(quantity.subtract(defaultQty)));
|
amount = price.multiply(defaultQty).add(originalPrice.multiply(quantity.subtract(defaultQty)));
|
||||||
}
|
}
|
||||||
totalAmount = totalAmount.add(amount);
|
totalAmount = totalAmount.add(amount);
|
||||||
|
|
||||||
saveList.add(StoreWishlistDO.builder()
|
|
||||||
.lineId(userInfoVO.getLineId())
|
|
||||||
.storeTypeId(request.getStoreTypeId())
|
|
||||||
.optionId(selected.getOptionId())
|
|
||||||
.quantity(selected.getQuantity())
|
|
||||||
.totalAmount(BigDecimal.ZERO)
|
|
||||||
.versionNo(versionNo)
|
|
||||||
.deleted(0)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
totalAmount = storeFixedAmount.add(totalAmount);
|
totalAmount = storeFixedAmount.add(totalAmount);
|
||||||
|
|
||||||
for (StoreWishlistDO row : saveList) {
|
StoreWishlistDO wishlist = StoreWishlistDO.builder()
|
||||||
row.setTotalAmount(totalAmount);
|
.lineId(userInfoVO.getLineId())
|
||||||
|
.storeTypeId(request.getStoreTypeId())
|
||||||
|
.totalAmount(totalAmount)
|
||||||
|
.versionNo(versionNo)
|
||||||
|
.wishlistStatus(getWishlistStatus(userInfoVO.getLineId()))
|
||||||
|
.deleted(0)
|
||||||
|
.build();
|
||||||
|
storeWishlistDAO.insert(wishlist);
|
||||||
|
|
||||||
|
List<StoreWishlistOptionDO> optionSaveList = new ArrayList<>();
|
||||||
|
for (MiniStoreWishlistSaveRequest.SelectedOption selected : request.getSelectedOptions()) {
|
||||||
|
optionSaveList.add(StoreWishlistOptionDO.builder()
|
||||||
|
.wishlistId(wishlist.getId())
|
||||||
|
.optionId(selected.getOptionId())
|
||||||
|
.quantity(selected.getQuantity())
|
||||||
|
.deleted(0)
|
||||||
|
.build());
|
||||||
}
|
}
|
||||||
storeWishlistDAO.insertBatch(saveList);
|
storeWishlistOptionDAO.insertBatch(optionSaveList);
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取线索阶段
|
||||||
|
* @param lineId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private Integer getWishlistStatus(Long lineId){
|
||||||
|
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(lineId);
|
||||||
|
if (lineInfo.getWorkflowSubStageStatus()>=WorkflowSubStageStatusEnum.INTENT_5.getCode()){
|
||||||
|
return WishlistStatusEnum.COMPLETE_POINT.getCode();
|
||||||
|
}
|
||||||
|
return WishlistStatusEnum.AGREE.getCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean deleted(MiniStoreWishlistDelRequest request, PartnerUserInfoVO userInfoVO) {
|
public Boolean deleted(MiniStoreWishlistDelRequest request, PartnerUserInfoVO userInfoVO) {
|
||||||
storeWishlistDAO.softDeleteByLineIdAndStoreTypeAndVersion(userInfoVO.getLineId(),request.getStoreTypeId(),request.getVersionNo());
|
StoreWishlistDO storewishlist = storeWishlistDAO.getById(request.getWishlistId());
|
||||||
|
if (storewishlist==null){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||||
|
}
|
||||||
|
storewishlist.setDeleted(1);
|
||||||
|
storeWishlistDAO.updateByExampleSelective(storewishlist);
|
||||||
|
//更新配置项数据
|
||||||
|
storeWishlistOptionDAO.softDeleteByWishlistIds(Arrays.asList(request.getWishlistId()));
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MiniStoreWishlistDetailVO wishlistDetail(Long storeTypeId,String versionNo, Long lineId) {
|
public MiniStoreWishlistDetailVO wishlistDetail(Long wishlistId) {
|
||||||
if (lineId == null) {
|
StoreWishlistDO storeWishlistDO = storeWishlistDAO.getById(wishlistId);
|
||||||
|
if (storeWishlistDO==null){
|
||||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||||
}
|
}
|
||||||
|
return convert(storeWishlistDO);
|
||||||
|
}
|
||||||
|
|
||||||
List<StoreWishlistDO> rows = storeWishlistDAO.listByLineIdAndStoreTypeAndVersion(lineId, storeTypeId, versionNo);
|
@Override
|
||||||
if (CollectionUtils.isEmpty(rows)){
|
public List<MiniStoreWishlistListVO> wishlistList( PartnerUserInfoVO userInfoVO) {
|
||||||
|
if (userInfoVO == null || userInfoVO.getLineId() == null) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
List<MiniStoreWishlistListVO> wishlistList = storeWishlistDAO.listByLineId(userInfoVO.getLineId(), null);
|
||||||
|
if (CollectionUtils.isEmpty(wishlistList)) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Long> wishlistIds = wishlistList.stream().map(MiniStoreWishlistListVO::getWishlistId).filter(Objects::nonNull).collect(Collectors.toList());
|
||||||
|
List<StoreWishlistOptionDO> optionRows = storeWishlistOptionDAO.listByWishlistIds(wishlistIds);
|
||||||
|
|
||||||
|
Map<Long, List<StoreWishlistOptionDO>> map = optionRows.stream().collect(Collectors.groupingBy(StoreWishlistOptionDO::getWishlistId));
|
||||||
|
|
||||||
|
List<Long> optionIds = optionRows.stream().distinct().map(StoreWishlistOptionDO::getOptionId).collect(Collectors.toList());
|
||||||
|
Map<Long, ConfigOptionDO> optionMap = new HashMap<>();
|
||||||
|
if (CollectionUtils.isNotEmpty(optionIds)) {
|
||||||
|
List<ConfigOptionDO> options = configOptionDAO.listActiveByIds(optionIds);
|
||||||
|
optionMap = options.stream().collect(Collectors.toMap(ConfigOptionDO::getId, Function.identity(), (a, b) -> a));
|
||||||
|
}
|
||||||
|
List<Long> pointList = wishlistList.stream().filter(x -> x.getPointId() != null).map(MiniStoreWishlistListVO::getPointId).collect(Collectors.toList());
|
||||||
|
List<PointInfoDO> pointDOList = pointInfoDAO.getPointListByIds(pointList);
|
||||||
|
Map<Long, Long> pointMap = pointDOList.stream().filter(x -> x.getShopId() != null).collect(Collectors.toMap(PointInfoDO::getId, PointInfoDO::getShopId));
|
||||||
|
|
||||||
|
for (MiniStoreWishlistListVO item : wishlistList) {
|
||||||
|
List<StoreWishlistOptionDO> storeWishlistOptionDOS = map.get(item.getWishlistId());
|
||||||
|
List<MiniStoreWishlistListVO.OptionVO> optionList = new ArrayList<>();
|
||||||
|
if (item.getPointId()!=null){
|
||||||
|
item.setShopId(pointMap.get(item.getPointId()));
|
||||||
|
}
|
||||||
|
for (StoreWishlistOptionDO row : storeWishlistOptionDOS) {
|
||||||
|
MiniStoreWishlistListVO.OptionVO vo = new MiniStoreWishlistListVO.OptionVO();
|
||||||
|
vo.setOptionId(row.getOptionId());
|
||||||
|
vo.setQuantity(row.getQuantity());
|
||||||
|
ConfigOptionDO cfg = optionMap.get(row.getOptionId());
|
||||||
|
if (cfg != null) {
|
||||||
|
vo.setOptionName(cfg.getOptionName());
|
||||||
|
vo.setOptionPrice(cfg.getOptionPrice());
|
||||||
|
vo.setImageUrl(cfg.getImageUrl());
|
||||||
|
}
|
||||||
|
optionList.add(vo);
|
||||||
|
}
|
||||||
|
item.setOptions(optionList);
|
||||||
|
}
|
||||||
|
|
||||||
|
return wishlistList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<MiniStoreWishlistListVO> wishAllList(WishAllListRequest request) {
|
||||||
|
PageHelper.startPage(request.getPageNum(),request.getPageSize());
|
||||||
|
List<MiniStoreWishlistListVO> wishlist = storeWishlistDAO.listByVersionList(request.getKeyword(), request.getStoreTypeId(),request.getWishlistStatus());
|
||||||
|
if (CollectionUtils.isEmpty(wishlist)){
|
||||||
|
return new PageInfo<>();
|
||||||
|
}
|
||||||
|
PageInfo<MiniStoreWishlistListVO> result = new PageInfo<>(wishlist);
|
||||||
|
List<Long> lineIdList = wishlist.stream().map(MiniStoreWishlistListVO::getLineId).collect(Collectors.toList());
|
||||||
|
List<LineInfoDO> lineList = lineInfoDAO.getByLineIds(lineIdList);
|
||||||
|
Map<Long, LineInfoDO> map = lineList.stream().collect(Collectors.toMap(LineInfoDO::getId, data -> data));
|
||||||
|
|
||||||
|
List<Long> wishlistIds = wishlist.stream().map(MiniStoreWishlistListVO::getWishlistId).filter(Objects::nonNull).collect(Collectors.toList());
|
||||||
|
List<StoreWishlistOptionDO> optionRows = storeWishlistOptionDAO.listByWishlistIds(wishlistIds);
|
||||||
|
|
||||||
|
Map<Long, List<StoreWishlistOptionDO>> wishlistOptionMap = optionRows.stream().collect(Collectors.groupingBy(StoreWishlistOptionDO::getWishlistId));
|
||||||
|
|
||||||
|
List<Long> optionIds = optionRows.stream().distinct().map(StoreWishlistOptionDO::getOptionId).collect(Collectors.toList());
|
||||||
|
Map<Long, ConfigOptionDO> optionMap = new HashMap<>();
|
||||||
|
if (CollectionUtils.isNotEmpty(optionIds)) {
|
||||||
|
List<ConfigOptionDO> options = configOptionDAO.listActiveByIds(optionIds);
|
||||||
|
optionMap = options.stream().collect(Collectors.toMap(ConfigOptionDO::getId, Function.identity(), (a, b) -> a));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (MiniStoreWishlistListVO item : wishlist) {
|
||||||
|
LineInfoDO lineInfoDO = map.get(item.getLineId());
|
||||||
|
if (lineInfoDO != null) {
|
||||||
|
item.setPartnerMobile(lineInfoDO.getMobile());
|
||||||
|
item.setPartnerName(lineInfoDO.getUsername());
|
||||||
|
}
|
||||||
|
List<StoreWishlistOptionDO> storeWishlistOptionDOS = wishlistOptionMap.get(item.getWishlistId());
|
||||||
|
|
||||||
|
List<MiniStoreWishlistListVO.OptionVO> optionList = new ArrayList<>();
|
||||||
|
for (StoreWishlistOptionDO row : storeWishlistOptionDOS) {
|
||||||
|
MiniStoreWishlistListVO.OptionVO vo = new MiniStoreWishlistListVO.OptionVO();
|
||||||
|
vo.setOptionId(row.getOptionId());
|
||||||
|
vo.setQuantity(row.getQuantity());
|
||||||
|
ConfigOptionDO cfg = optionMap.get(row.getOptionId());
|
||||||
|
if (cfg != null) {
|
||||||
|
vo.setOptionName(cfg.getOptionName());
|
||||||
|
vo.setOptionPrice(cfg.getOptionPrice());
|
||||||
|
vo.setImageUrl(cfg.getImageUrl());
|
||||||
|
}
|
||||||
|
optionList.add(vo);
|
||||||
|
}
|
||||||
|
item.setOptions(optionList);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean wishlistBindPoint(WishlistBindPointRequest request) {
|
||||||
|
StoreWishlistDO storeWishlist = storeWishlistDAO.getById(request.getWishlistId());
|
||||||
|
if (!WishlistStatusEnum.COMPLETE_POINT.getCode().equals(storeWishlist.getWishlistStatus())){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.TASK_STATUS_NOT_ALLOW_OPERATE);
|
||||||
|
}
|
||||||
|
//校验铺位是否关联了其他心愿单 且心愿单不是拒绝状态
|
||||||
|
Integer pointBindWishlistCount = storeWishlistDAO.getPointBindWishlistCount(request.getPointId(), WishlistStatusEnum.REJECT.getCode());
|
||||||
|
if (pointBindWishlistCount>0){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.CURRENT_POINT_BIND_OTHER_WISHLIST);
|
||||||
|
}
|
||||||
|
storeWishlist.setPointId(request.getPointId());
|
||||||
|
storeWishlist.setWishlistStatus(WishlistStatusEnum.LI_GUI_APPROVE.getCode());
|
||||||
|
storeWishlistDAO.updateByExampleSelective(storeWishlist);
|
||||||
|
return Boolean.TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Boolean wishlistApprove(WishlistAuditRequest request, LoginUserInfo userInfo) {
|
||||||
|
log.info("wishlistApprove:{},审批人:{}",JSONObject.toJSONString(request),userInfo.getName());
|
||||||
|
//查看心愿单状态
|
||||||
|
StoreWishlistDO wishlistDO = storeWishlistDAO.getById(request.getWishlistId());
|
||||||
|
if (wishlistDO==null){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE);
|
||||||
|
}
|
||||||
|
if (!WishlistStatusEnum.LI_GUI_APPROVE.getCode().equals(wishlistDO.getWishlistStatus())){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.TASK_STATUS_NOT_ALLOW_OPERATE);
|
||||||
|
}
|
||||||
|
Integer wishlistStatus = null;
|
||||||
|
//通过
|
||||||
|
if (request.getAuditStatus()==1){
|
||||||
|
//查看线索阶段是否完成 如果没有完成 直接跳过意向金和意向协议阶段
|
||||||
|
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(wishlistDO.getLineId());
|
||||||
|
if (Objects.isNull(lineInfo.getRegionId())||lineInfo.getRegionId() == 0){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.LINE_REGION_NOT_EXIST);
|
||||||
|
}
|
||||||
|
lineInfo.setWorkflowStage(WorkflowStageEnum.STORE.getCode());
|
||||||
|
lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_125.getCode());
|
||||||
|
lineInfo.setDevelopmentManager(lineInfo.getInvestmentManager());
|
||||||
|
lineInfoDAO.updateLineInfo(lineInfo);
|
||||||
|
//初始化店铺 AI店
|
||||||
|
lineInfo.setUseStandardStore(1);
|
||||||
|
Long shopId = shopService.initAiShop(lineInfo);
|
||||||
|
//选址阶段直接完成
|
||||||
|
PointRecommendLineRequest recommendLineRequest = new PointRecommendLineRequest();
|
||||||
|
recommendLineRequest.setShopIds(Arrays.asList(Long.valueOf(shopId)));
|
||||||
|
recommendLineRequest.setPointId(wishlistDO.getPointId());
|
||||||
|
recommendLineRequest.setDevelopmentManager(lineInfo.getDevelopmentManager());
|
||||||
|
//推荐逻辑
|
||||||
|
pointService.pointRecommendLine(recommendLineRequest);
|
||||||
|
SelectPointRequest selectPointRequest = new SelectPointRequest();
|
||||||
|
selectPointRequest.setPointId(wishlistDO.getPointId());
|
||||||
|
selectPointRequest.setLineId(wishlistDO.getLineId());
|
||||||
|
selectPointRequest.setShopId(shopId);
|
||||||
|
//选址
|
||||||
|
pointService.lineSelectPoint(selectPointRequest);
|
||||||
|
//修改心愿单状态
|
||||||
|
wishlistStatus = WishlistStatusEnum.PASS.getCode();
|
||||||
|
}
|
||||||
|
if (request.getAuditStatus()==0){
|
||||||
|
wishlistStatus = WishlistStatusEnum.REJECT.getCode();
|
||||||
|
}
|
||||||
|
wishlistDO.setWishlistStatus(wishlistStatus);
|
||||||
|
wishlistDO.setRemark(request.getRemark());
|
||||||
|
wishlistDO.setUpdateTime(new Date());
|
||||||
|
storeWishlistDAO.updateByExampleSelective(wishlistDO);
|
||||||
|
return Boolean.TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MiniStoreWishlistDetailVO getCurrentShopBindWishlist(Long shopId) {
|
||||||
|
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||||
|
if (shopInfo == null) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE);
|
||||||
|
}
|
||||||
|
if (shopInfo.getPointId()==null){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
StoreWishlistDO storelistDO = storeWishlistDAO.getByPointId(shopInfo.getLineId(), shopInfo.getPointId());
|
||||||
|
return convert(storelistDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private MiniStoreWishlistDetailVO convert(StoreWishlistDO storeWishlistDO){
|
||||||
|
if (storeWishlistDO==null){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
MiniStoreWishlistDetailVO vo = new MiniStoreWishlistDetailVO();
|
MiniStoreWishlistDetailVO vo = new MiniStoreWishlistDetailVO();
|
||||||
vo.setStoreTypeId(storeTypeId);
|
vo.setStoreTypeId(storeWishlistDO.getStoreTypeId());
|
||||||
vo.setVersionNo(versionNo);
|
vo.setId(storeWishlistDO.getId());
|
||||||
StoreWishlistDO storeWishlistDO = rows.get(0);
|
vo.setVersionNo(storeWishlistDO.getVersionNo());
|
||||||
if (storeWishlistDO!=null){
|
|
||||||
vo.setTotalAmount(storeWishlistDO.getTotalAmount());
|
vo.setTotalAmount(storeWishlistDO.getTotalAmount());
|
||||||
|
vo.setPointId(storeWishlistDO.getPointId());
|
||||||
|
vo.setWishlistStatus(storeWishlistDO.getWishlistStatus());
|
||||||
vo.setCreateTime(storeWishlistDO.getCreateTime());
|
vo.setCreateTime(storeWishlistDO.getCreateTime());
|
||||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(storeWishlistDO.getLineId());
|
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(storeWishlistDO.getLineId());
|
||||||
if (lineInfo!=null){
|
if (lineInfo != null) {
|
||||||
vo.setPartnerMobile(lineInfo.getMobile());
|
vo.setPartnerMobile(lineInfo.getMobile());
|
||||||
vo.setPartnerName(lineInfo.getUsername());
|
vo.setPartnerName(lineInfo.getUsername());
|
||||||
}
|
}
|
||||||
}
|
StoreTypeDO storeTypeDO = storeTypeDAO.getById(storeWishlistDO.getStoreTypeId());
|
||||||
|
|
||||||
StoreTypeDO storeTypeDO = storeTypeDAO.getById(storeTypeId);
|
|
||||||
MiniStoreWishlistDetailVO.FeeInfoVO feeInfo = new MiniStoreWishlistDetailVO.FeeInfoVO();
|
MiniStoreWishlistDetailVO.FeeInfoVO feeInfo = new MiniStoreWishlistDetailVO.FeeInfoVO();
|
||||||
feeInfo.setFranchiseFee(storeTypeDO.getFranchiseFee());
|
feeInfo.setFranchiseFee(storeTypeDO.getFranchiseFee());
|
||||||
feeInfo.setBrandUsageFee(storeTypeDO.getBrandUsageFee());
|
feeInfo.setBrandUsageFee(storeTypeDO.getBrandUsageFee());
|
||||||
@@ -1397,8 +1617,20 @@ public class MiniStoreOrderServiceImpl implements MiniStoreOrderService {
|
|||||||
feeInfo.setFirstOrderFee(storeTypeDO.getFirstOrderFee());
|
feeInfo.setFirstOrderFee(storeTypeDO.getFirstOrderFee());
|
||||||
vo.setFeeInfoVO(feeInfo);
|
vo.setFeeInfoVO(feeInfo);
|
||||||
vo.setStoreTypeName(storeTypeDO.getStoreTypeName());
|
vo.setStoreTypeName(storeTypeDO.getStoreTypeName());
|
||||||
|
vo.setStoreType(storeTypeDO.getStoreType());
|
||||||
|
|
||||||
List<Long> optionIds = rows.stream().map(StoreWishlistDO::getOptionId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
|
if (storeWishlistDO.getPointId()!=null){
|
||||||
|
PointInfoDO pointInfoDO = pointInfoDAO.getPointInfoById(storeWishlistDO.getPointId());
|
||||||
|
vo.setShopId(pointInfoDO.getShopId());
|
||||||
|
}
|
||||||
|
|
||||||
|
List<StoreWishlistOptionDO> optionRows = storeWishlistOptionDAO.listByWishlistIds(Arrays.asList(storeWishlistDO.getId()));
|
||||||
|
if (CollectionUtils.isEmpty(optionRows)) {
|
||||||
|
vo.setOptions(Collections.emptyList());
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Long> optionIds = optionRows.stream().map(StoreWishlistOptionDO::getOptionId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
|
||||||
Map<Long, ConfigOptionDO> optionMap = new HashMap<>();
|
Map<Long, ConfigOptionDO> optionMap = new HashMap<>();
|
||||||
List<ConfigOptionDO> options = new ArrayList<>();
|
List<ConfigOptionDO> options = new ArrayList<>();
|
||||||
if (CollectionUtils.isNotEmpty(optionIds)) {
|
if (CollectionUtils.isNotEmpty(optionIds)) {
|
||||||
@@ -1406,7 +1638,7 @@ public class MiniStoreOrderServiceImpl implements MiniStoreOrderService {
|
|||||||
optionMap = options.stream().collect(Collectors.toMap(ConfigOptionDO::getId, Function.identity(), (a, b) -> a));
|
optionMap = options.stream().collect(Collectors.toMap(ConfigOptionDO::getId, Function.identity(), (a, b) -> a));
|
||||||
}
|
}
|
||||||
|
|
||||||
List<StoreTypeOptionDO> bindings = storeTypeOptionDAO.listByStoreTypeId(storeTypeId);
|
List<StoreTypeOptionDO> bindings = storeTypeOptionDAO.listByStoreTypeId(storeWishlistDO.getStoreTypeId());
|
||||||
Map<Long, StoreTypeOptionDO> bindingMap = bindings.stream()
|
Map<Long, StoreTypeOptionDO> bindingMap = bindings.stream()
|
||||||
.collect(Collectors.toMap(StoreTypeOptionDO::getOptionId, Function.identity(), (a, b) -> a));
|
.collect(Collectors.toMap(StoreTypeOptionDO::getOptionId, Function.identity(), (a, b) -> a));
|
||||||
|
|
||||||
@@ -1417,7 +1649,7 @@ public class MiniStoreOrderServiceImpl implements MiniStoreOrderService {
|
|||||||
Map<String, String> itemCodeMap = configItemDAO.nameMap(itemCodeList);
|
Map<String, String> itemCodeMap = configItemDAO.nameMap(itemCodeList);
|
||||||
|
|
||||||
List<MiniStoreWishlistDetailVO.OptionVO> list = new ArrayList<>();
|
List<MiniStoreWishlistDetailVO.OptionVO> list = new ArrayList<>();
|
||||||
for (StoreWishlistDO row : rows) {
|
for (StoreWishlistOptionDO row : optionRows) {
|
||||||
MiniStoreWishlistDetailVO.OptionVO item = new MiniStoreWishlistDetailVO.OptionVO();
|
MiniStoreWishlistDetailVO.OptionVO item = new MiniStoreWishlistDetailVO.OptionVO();
|
||||||
BigDecimal quantity = row.getQuantity();
|
BigDecimal quantity = row.getQuantity();
|
||||||
item.setOptionId(row.getOptionId());
|
item.setOptionId(row.getOptionId());
|
||||||
@@ -1431,16 +1663,14 @@ public class MiniStoreOrderServiceImpl implements MiniStoreOrderService {
|
|||||||
item.setCategoryCode(cfg.getCategoryCode());
|
item.setCategoryCode(cfg.getCategoryCode());
|
||||||
item.setItemCode(cfg.getItemCode());
|
item.setItemCode(cfg.getItemCode());
|
||||||
}
|
}
|
||||||
if (storeTypeOptionDO!=null){
|
if (storeTypeOptionDO != null && cfg != null) {
|
||||||
BigDecimal price = storeTypeOptionDO.getOptionPrice();
|
BigDecimal price = storeTypeOptionDO.getOptionPrice();
|
||||||
BigDecimal amount = BigDecimal.ZERO;
|
BigDecimal amount = BigDecimal.ZERO;
|
||||||
BigDecimal defaultQty = storeTypeOptionDO.getDefaultQuantity();
|
BigDecimal defaultQty = storeTypeOptionDO.getDefaultQuantity();
|
||||||
//原价
|
|
||||||
BigDecimal originalPrice = cfg.getOriginalOptionPrice();
|
BigDecimal originalPrice = cfg.getOriginalOptionPrice();
|
||||||
if(quantity.compareTo(defaultQty)<=0){
|
if (quantity.compareTo(defaultQty) <= 0) {
|
||||||
amount = price.multiply(quantity);
|
amount = price.multiply(quantity);
|
||||||
}else {
|
} else {
|
||||||
// 店型优惠价*默认数量 + 原价 *(选择数量-默认数量)
|
|
||||||
amount = price.multiply(defaultQty).add(originalPrice.multiply(quantity.subtract(defaultQty)));
|
amount = price.multiply(defaultQty).add(originalPrice.multiply(quantity.subtract(defaultQty)));
|
||||||
}
|
}
|
||||||
item.setOptionPrice(price);
|
item.setOptionPrice(price);
|
||||||
@@ -1454,100 +1684,6 @@ public class MiniStoreOrderServiceImpl implements MiniStoreOrderService {
|
|||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<MiniStoreWishlistListVO> wishlistList( PartnerUserInfoVO userInfoVO) {
|
|
||||||
if (userInfoVO == null || userInfoVO.getLineId() == null) {
|
|
||||||
return Collections.emptyList();
|
|
||||||
}
|
|
||||||
List<MiniStoreWishlistListVO> wishlist = storeWishlistDAO.listByLineId(userInfoVO.getLineId(), null);
|
|
||||||
if (CollectionUtils.isEmpty(wishlist)) {
|
|
||||||
return Collections.emptyList();
|
|
||||||
}
|
|
||||||
|
|
||||||
for (MiniStoreWishlistListVO item : wishlist) {
|
|
||||||
List<StoreWishlistDO> rows = storeWishlistDAO.listByLineIdAndStoreTypeAndVersion(userInfoVO.getLineId(), item.getStoreTypeId(), item.getVersionNo());
|
|
||||||
if (CollectionUtils.isEmpty(rows)) {
|
|
||||||
item.setOptions(Collections.emptyList());
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Long> optionIds = rows.stream().map(StoreWishlistDO::getOptionId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
|
|
||||||
Map<Long, ConfigOptionDO> optionMap = new HashMap<>();
|
|
||||||
if (CollectionUtils.isNotEmpty(optionIds)) {
|
|
||||||
List<ConfigOptionDO> options = configOptionDAO.listActiveByIds(optionIds);
|
|
||||||
optionMap = options.stream().collect(Collectors.toMap(ConfigOptionDO::getId, Function.identity(), (a, b) -> a));
|
|
||||||
}
|
|
||||||
|
|
||||||
List<MiniStoreWishlistListVO.OptionVO> optionList = new ArrayList<>();
|
|
||||||
for (StoreWishlistDO row : rows) {
|
|
||||||
MiniStoreWishlistListVO.OptionVO vo = new MiniStoreWishlistListVO.OptionVO();
|
|
||||||
vo.setOptionId(row.getOptionId());
|
|
||||||
vo.setQuantity(row.getQuantity());
|
|
||||||
ConfigOptionDO cfg = optionMap.get(row.getOptionId());
|
|
||||||
if (cfg != null) {
|
|
||||||
vo.setOptionName(cfg.getOptionName());
|
|
||||||
vo.setOptionPrice(cfg.getOptionPrice());
|
|
||||||
vo.setImageUrl(cfg.getImageUrl());
|
|
||||||
}
|
|
||||||
optionList.add(vo);
|
|
||||||
}
|
|
||||||
item.setOptions(optionList);
|
|
||||||
}
|
|
||||||
|
|
||||||
return wishlist;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageInfo<MiniStoreWishlistListVO> wishAllList(WishAllListRequest request) {
|
|
||||||
PageHelper.startPage(request.getPageNum(),request.getPageSize());
|
|
||||||
List<String> distinctVersion = storeWishlistDAO.getDistinctVersion(request.getKeyword(),request.getStoreTypeId());
|
|
||||||
if (CollectionUtils.isEmpty(distinctVersion)){
|
|
||||||
return new PageInfo<>();
|
|
||||||
}
|
|
||||||
PageInfo result = new PageInfo<>(distinctVersion);
|
|
||||||
List<MiniStoreWishlistListVO> wishlist = storeWishlistDAO.listByVersionList(distinctVersion);
|
|
||||||
|
|
||||||
List<Long> lineIdList = wishlist.stream().map(MiniStoreWishlistListVO::getLineId).collect(Collectors.toList());
|
|
||||||
List<LineInfoDO> lineList = lineInfoDAO.getByLineIds(lineIdList);
|
|
||||||
Map<Long, LineInfoDO> map = lineList.stream().collect(Collectors.toMap(LineInfoDO::getId, data -> data));
|
|
||||||
for (MiniStoreWishlistListVO item : wishlist) {
|
|
||||||
LineInfoDO lineInfoDO = map.get(item.getLineId());
|
|
||||||
if (lineInfoDO!=null){
|
|
||||||
item.setPartnerMobile(lineInfoDO.getMobile());
|
|
||||||
item.setPartnerName(lineInfoDO.getUsername());
|
|
||||||
}
|
|
||||||
List<StoreWishlistDO> rows = storeWishlistDAO.listByLineIdAndStoreTypeAndVersion(item.getLineId(), item.getStoreTypeId(), item.getVersionNo());
|
|
||||||
if (CollectionUtils.isEmpty(rows)) {
|
|
||||||
item.setOptions(Collections.emptyList());
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Long> optionIds = rows.stream().map(StoreWishlistDO::getOptionId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
|
|
||||||
Map<Long, ConfigOptionDO> optionMap = new HashMap<>();
|
|
||||||
if (CollectionUtils.isNotEmpty(optionIds)) {
|
|
||||||
List<ConfigOptionDO> options = configOptionDAO.listActiveByIds(optionIds);
|
|
||||||
optionMap = options.stream().collect(Collectors.toMap(ConfigOptionDO::getId, Function.identity(), (a, b) -> a));
|
|
||||||
}
|
|
||||||
|
|
||||||
List<MiniStoreWishlistListVO.OptionVO> optionList = new ArrayList<>();
|
|
||||||
for (StoreWishlistDO row : rows) {
|
|
||||||
MiniStoreWishlistListVO.OptionVO vo = new MiniStoreWishlistListVO.OptionVO();
|
|
||||||
vo.setOptionId(row.getOptionId());
|
|
||||||
vo.setQuantity(row.getQuantity());
|
|
||||||
ConfigOptionDO cfg = optionMap.get(row.getOptionId());
|
|
||||||
if (cfg != null) {
|
|
||||||
vo.setOptionName(cfg.getOptionName());
|
|
||||||
vo.setOptionPrice(cfg.getOptionPrice());
|
|
||||||
vo.setImageUrl(cfg.getImageUrl());
|
|
||||||
}
|
|
||||||
optionList.add(vo);
|
|
||||||
}
|
|
||||||
item.setOptions(optionList);
|
|
||||||
}
|
|
||||||
result.setList(wishlist);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private BigDecimal safe(BigDecimal v) {
|
private BigDecimal safe(BigDecimal v) {
|
||||||
return v == null ? BigDecimal.ZERO : v;
|
return v == null ? BigDecimal.ZERO : v;
|
||||||
|
|||||||
@@ -2,10 +2,7 @@ package com.cool.store.controller.webb;
|
|||||||
|
|
||||||
import com.cool.store.context.CurrentUserHolder;
|
import com.cool.store.context.CurrentUserHolder;
|
||||||
import com.cool.store.context.PartnerUserHolder;
|
import com.cool.store.context.PartnerUserHolder;
|
||||||
import com.cool.store.request.order.OrderAuditRecordRequest;
|
import com.cool.store.request.order.*;
|
||||||
import com.cool.store.request.order.PCStoreOrderOptionQuantityUpdateRequest;
|
|
||||||
import com.cool.store.request.order.PCStoreOrderQueryRequest;
|
|
||||||
import com.cool.store.request.order.WishAllListRequest;
|
|
||||||
import com.cool.store.response.ResponseResult;
|
import com.cool.store.response.ResponseResult;
|
||||||
import com.cool.store.service.order.MiniStoreOrderService;
|
import com.cool.store.service.order.MiniStoreOrderService;
|
||||||
import com.cool.store.vo.order.*;
|
import com.cool.store.vo.order.*;
|
||||||
@@ -78,11 +75,8 @@ public class StoreOrderController {
|
|||||||
|
|
||||||
@ApiOperation("心愿单详情")
|
@ApiOperation("心愿单详情")
|
||||||
@GetMapping("/wishlist/detail")
|
@GetMapping("/wishlist/detail")
|
||||||
public ResponseResult<MiniStoreWishlistDetailVO> wishlistDetail(@RequestParam("storeTypeId") Long storeTypeId,
|
public ResponseResult<MiniStoreWishlistDetailVO> wishlistDetail(@RequestParam("wishlistId") Long wishlistId) {
|
||||||
@RequestParam("lineId") Long lineId,
|
return ResponseResult.success(miniStoreOrderService.wishlistDetail(wishlistId));
|
||||||
@RequestParam("versionNo") String versionNo) {
|
|
||||||
|
|
||||||
return ResponseResult.success(miniStoreOrderService.wishlistDetail(storeTypeId,versionNo, lineId));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("PC心愿单列表")
|
@ApiOperation("PC心愿单列表")
|
||||||
@@ -91,4 +85,16 @@ public class StoreOrderController {
|
|||||||
return ResponseResult.success(miniStoreOrderService.wishAllList( request));
|
return ResponseResult.success(miniStoreOrderService.wishAllList( request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("心愿单待立规审批")
|
||||||
|
@PostMapping("/wishlist/wishlistApprove")
|
||||||
|
public ResponseResult<Boolean> wishlistApprove(@RequestBody @Valid WishlistAuditRequest request) {
|
||||||
|
return ResponseResult.success(miniStoreOrderService.wishlistApprove(request,CurrentUserHolder.getUser()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询当前门店铺位绑定的心愿单")
|
||||||
|
@GetMapping("/wishlist/getCurrentShopBindWishlist")
|
||||||
|
public ResponseResult<MiniStoreWishlistDetailVO> getCurrentShopBindWishlist(@RequestParam("shopId") Long shopId) {
|
||||||
|
return ResponseResult.success(miniStoreOrderService.getCurrentShopBindWishlist(shopId));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.cool.store.controller.webc;
|
package com.cool.store.controller.webc;
|
||||||
|
|
||||||
|
import com.cool.store.context.CurrentUserHolder;
|
||||||
import com.cool.store.context.PartnerUserHolder;
|
import com.cool.store.context.PartnerUserHolder;
|
||||||
import com.cool.store.dto.OpenInfoDTO;
|
import com.cool.store.dto.OpenInfoDTO;
|
||||||
import com.cool.store.request.*;
|
import com.cool.store.request.*;
|
||||||
@@ -10,10 +11,7 @@ import com.cool.store.response.ShopResponse;
|
|||||||
import com.cool.store.service.PointService;
|
import com.cool.store.service.PointService;
|
||||||
import com.cool.store.service.ShopService;
|
import com.cool.store.service.ShopService;
|
||||||
import com.cool.store.vo.PartnerUserInfoVO;
|
import com.cool.store.vo.PartnerUserInfoVO;
|
||||||
import com.cool.store.vo.point.MiniPointPageVO;
|
import com.cool.store.vo.point.*;
|
||||||
import com.cool.store.vo.point.PointDetailVO;
|
|
||||||
import com.cool.store.vo.point.PointFinancialDataVO;
|
|
||||||
import com.cool.store.vo.point.ShopRentInfoVO;
|
|
||||||
import com.cool.store.vo.shop.MiniShopPageVO;
|
import com.cool.store.vo.shop.MiniShopPageVO;
|
||||||
import com.cool.store.vo.shop.ShopStageInfoVO;
|
import com.cool.store.vo.shop.ShopStageInfoVO;
|
||||||
import com.cool.store.vo.shop.ShopStageVO;
|
import com.cool.store.vo.shop.ShopStageVO;
|
||||||
@@ -170,4 +168,12 @@ public class MiniShopController {
|
|||||||
public ResponseResult<OpenInfoDTO> getShopOpenInfo(@RequestParam("shopId")Long shopId) {
|
public ResponseResult<OpenInfoDTO> getShopOpenInfo(@RequestParam("shopId")Long shopId) {
|
||||||
return ResponseResult.success(shopService.getShopOpenInfo(shopId));
|
return ResponseResult.success(shopService.getShopOpenInfo(shopId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("选址人员获取可推荐铺位列表")
|
||||||
|
@PostMapping("/getRecommendPointList")
|
||||||
|
public ResponseResult<PageInfo<PointPageVO>> getRecommendPointList(@RequestBody @Validated RecommendPointPageRequest request) {
|
||||||
|
request.setLineId(PartnerUserHolder.getUser().getLineId());
|
||||||
|
request.setUseAi(1);
|
||||||
|
return ResponseResult.success(pointService.getRecommendPointList(request));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,9 +103,8 @@ public class MiniStoreOrderController {
|
|||||||
|
|
||||||
@ApiOperation("心愿单详情")
|
@ApiOperation("心愿单详情")
|
||||||
@GetMapping("/wishlist/detail")
|
@GetMapping("/wishlist/detail")
|
||||||
public ResponseResult<MiniStoreWishlistDetailVO> wishlistDetail(@RequestParam("storeTypeId") Long storeTypeId,
|
public ResponseResult<MiniStoreWishlistDetailVO> wishlistDetail(@RequestParam("wishlistId") Long wishlistId) {
|
||||||
@RequestParam("versionNo") String versionNo) {
|
return ResponseResult.success(miniStoreOrderService.wishlistDetail(wishlistId));
|
||||||
return ResponseResult.success(miniStoreOrderService.wishlistDetail(storeTypeId,versionNo, PartnerUserHolder.getUser().getLineId()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("心愿单列表")
|
@ApiOperation("心愿单列表")
|
||||||
@@ -114,4 +113,22 @@ public class MiniStoreOrderController {
|
|||||||
return ResponseResult.success(miniStoreOrderService.wishlistList( PartnerUserHolder.getUser()));
|
return ResponseResult.success(miniStoreOrderService.wishlistList( PartnerUserHolder.getUser()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("心愿单绑定铺位")
|
||||||
|
@PostMapping("/wishlist/wishlistBindPoint")
|
||||||
|
public ResponseResult<Boolean> wishlistBindPoint(@RequestBody @Valid WishlistBindPointRequest request) {
|
||||||
|
return ResponseResult.success(miniStoreOrderService.wishlistBindPoint(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询当前门店铺位绑定的心愿单")
|
||||||
|
@GetMapping("/wishlist/getCurrentShopBindWishlist")
|
||||||
|
public ResponseResult<MiniStoreWishlistDetailVO> getCurrentShopBindWishlist(@RequestParam("shopId") Long shopId) {
|
||||||
|
return ResponseResult.success(miniStoreOrderService.getCurrentShopBindWishlist(shopId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("订单 加盟商确认")
|
||||||
|
@PostMapping("/passOrder")
|
||||||
|
public ResponseResult<Boolean> passOrder(@RequestBody OrderAuditRecordRequest request) {
|
||||||
|
return ResponseResult.success(miniStoreOrderService.passOrder(request, null));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user