Merge branch 'xzj' of gitee.com:darlk/ShengTangManage into develop
This commit is contained in:
commit
12607455a0
stdiet-custom/src/main
java/com/stdiet/custom
domain
service/impl
resources/mapper/custom
stdiet-ui/src
@ -6,8 +6,6 @@ import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.stdiet.common.annotation.Excel;
|
||||
import com.stdiet.common.core.domain.BaseEntity;
|
||||
|
||||
@ -51,6 +49,7 @@ public class SysOrder extends BaseEntity {
|
||||
|
||||
private String status;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date startTime;
|
||||
|
||||
private Date pauseTime;
|
||||
@ -77,6 +76,10 @@ public class SysOrder extends BaseEntity {
|
||||
@Excel(name = "售前")
|
||||
private String preSale;
|
||||
|
||||
/** 售中ID */
|
||||
@Excel(name = "售中ID")
|
||||
private Long onSaleId;
|
||||
|
||||
/**
|
||||
* 售后
|
||||
*/
|
||||
@ -93,9 +96,6 @@ public class SysOrder extends BaseEntity {
|
||||
*/
|
||||
private Long nutritionistId;
|
||||
|
||||
//营养师数组,比例拆分单时需要两个营养师,非持久化字段
|
||||
private Long[] nutritionistIdList;
|
||||
|
||||
/**
|
||||
* 营养师
|
||||
*/
|
||||
@ -223,7 +223,7 @@ public class SysOrder extends BaseEntity {
|
||||
/**
|
||||
* 服务天数
|
||||
*/
|
||||
@Excel(name = "服务结束时间", width = 30)
|
||||
@Excel(name = "服务天数", width = 30)
|
||||
private Integer serverDay;
|
||||
|
||||
/**
|
||||
@ -234,33 +234,41 @@ public class SysOrder extends BaseEntity {
|
||||
//查询参数
|
||||
private Integer amountFlag;
|
||||
|
||||
/**
|
||||
* 订单类型 0普通单 1比例拆分单 2售后二开提成单
|
||||
*/
|
||||
/** 订单类型 0普通单 1比例拆分单 2体验单 */
|
||||
@Excel(name = "订单类型 0普通单 1比例拆分单 2体验单")
|
||||
private String orderType;
|
||||
|
||||
/**
|
||||
* 订单次数类型 0一开单 1二开单
|
||||
*/
|
||||
/** 订单次数类型 0一开单 1二开单 */
|
||||
@Excel(name = "订单次数类型 0一开单 1二开单")
|
||||
private String orderCountType;
|
||||
|
||||
/**
|
||||
* 订单金额类型 0全款单 1定金单 2尾款单
|
||||
*/
|
||||
/** 订单金额类型 0全款单 1定金单 2尾款单 */
|
||||
@Excel(name = "订单金额类型 0全款单 1定金单 2尾款单")
|
||||
private String orderMoneyType;
|
||||
|
||||
/**
|
||||
* 拆分订单中的主订单id,非拆分订单时,该id都为0
|
||||
*/
|
||||
/** 拆分订单中的主订单id,非拆分订单时,该id都为0 */
|
||||
@Excel(name = "拆分订单中的主订单id,非拆分订单时,该id都为0")
|
||||
private Long mainOrderId;
|
||||
|
||||
//订单类型数组,用于接收订单类型、订单次数类型、订单金额类型,非持久化字段
|
||||
private Long[] orderTypeList;
|
||||
/** 售后二开提成单, 0非提成单 1提成单 */
|
||||
@Excel(name = "售后二开提成单, 0非提成单 1提成单")
|
||||
private Integer afterSaleCommissOrder;
|
||||
|
||||
//是否自动创建售后二开提成单,非持久化字段
|
||||
/** 删除标记 */
|
||||
private Integer delFlag;
|
||||
|
||||
//订单类型数组,用于接收订单类型、订单次数类型、订单金额类型,非持久化字段
|
||||
private Integer[] orderTypeList;
|
||||
|
||||
//是否自动创建售后二开提成单,0否 1是,非持久化字段
|
||||
private Integer secondAfterSaleFlag;
|
||||
|
||||
//营养师数组,比例拆分单时需要两个营养师,非持久化字段
|
||||
private Long[] nutritionistIdList;
|
||||
|
||||
//拆分比例,如:1,9就是按照比例10%、90%拆分,非持久化字段
|
||||
private Integer[] nutritionistRate;
|
||||
private String nutritionistRate;
|
||||
|
||||
|
||||
|
||||
}
|
@ -27,6 +27,7 @@ public class AsyncCommonServiceImpl implements AsyncCommonService {
|
||||
@Autowired
|
||||
private SysFoodHeatStatisticsMapper sysFoodHeatStatisticsMapper;
|
||||
|
||||
public static final long sleepTime = 5000; //异步线程睡眠时间,毫秒
|
||||
|
||||
/**
|
||||
* 异步更新每个食材对应的蛋白质、脂肪、碳水的质量
|
||||
@ -34,6 +35,11 @@ public class AsyncCommonServiceImpl implements AsyncCommonService {
|
||||
@Override
|
||||
@Async
|
||||
public void updateFoodNutritionalQualityAndHeat(Long customerHeatId){
|
||||
try {
|
||||
Thread.sleep(sleepTime);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
SysCustomerHeatStatistics sysCustomerHeatStatistics = sysCustomerHeatStatisticsMapper.selectSysCustomerHeatStatisticsById(customerHeatId);
|
||||
if(sysCustomerHeatStatistics != null && sysCustomerHeatStatistics.getFoodHeatStatisticsList() != null
|
||||
&& sysCustomerHeatStatistics.getFoodHeatStatisticsList().size() > 0){
|
||||
|
@ -76,10 +76,12 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService {
|
||||
LocalDate serverStartDate = DateUtils.dateToLocalDate(sysOrder.getStartTime());
|
||||
//订单总服务月数
|
||||
int serverMonth = sysOrder.getServeTimeId() != null ? sysOrder.getServeTimeId().intValue()/30 : 0;
|
||||
//服务天数(不满一个月的零头)
|
||||
int serverSmallDay = sysOrder.getServeTimeId().intValue()%30 - (serverMonth > 0 ? 0 : 1);
|
||||
//赠送时长
|
||||
int giveDay = sysOrder.getGiveServeDay() != null ? sysOrder.getGiveServeDay().intValue() : 0;
|
||||
//服务到期时间(加赠送时间,不加暂停时间)
|
||||
serverEndDate = serverStartDate.plusMonths(serverMonth).plusDays(giveDay);
|
||||
serverEndDate = serverStartDate.plusMonths(serverMonth).plusDays(giveDay+serverSmallDay);
|
||||
List<SysOrderPause> pausesList = sysOrder.getOrderPauseList();
|
||||
if(pausesList == null){
|
||||
if(sysOrder.getOrderId() != null){
|
||||
@ -90,12 +92,10 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService {
|
||||
pausesList = new ArrayList<>();
|
||||
}
|
||||
}
|
||||
//System.out.println("结束时间:"+serverEndDate);
|
||||
//每年每月暂停天数,key为年份加月份,如:2021年1月=20211
|
||||
Map<String, Integer> everyYearMonthPauseDay = getEveryYearMonthPauseDay(pausesList, serverStartDate, serverEndDate);
|
||||
//该笔订单暂停总天数
|
||||
int pauseTotalDay = getTotalByMap(everyYearMonthPauseDay);
|
||||
//System.out.println("暂停天数:"+pauseTotalDay);
|
||||
//服务到期时间加上暂停时间
|
||||
serverEndDate = serverEndDate.plusDays(pauseTotalDay);
|
||||
}
|
||||
@ -278,10 +278,12 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService {
|
||||
LocalDate serverStartDate = DateUtils.dateToLocalDate(sysOrder.getStartTime());
|
||||
//订单总服务月数
|
||||
int serverMonth = sysOrder.getServeTimeId().intValue()/30;
|
||||
//服务天数(不满一个月的零头)
|
||||
int serverSmallDay = sysOrder.getServeTimeId().intValue()%30 - (serverMonth > 0 ? 0 : 1);
|
||||
//赠送时长
|
||||
int giveDay = sysOrder.getGiveServeDay().intValue();
|
||||
//服务到期时间(加赠送时间,不加暂停时间)
|
||||
LocalDate serverEndDate = serverStartDate.plusMonths(serverMonth).plusDays(giveDay);
|
||||
LocalDate serverEndDate = serverStartDate.plusMonths(serverMonth).plusDays(giveDay+serverSmallDay);
|
||||
//订单金额
|
||||
BigDecimal orderAmount = sysOrder.getAmount();
|
||||
//每年每月暂停天数,key为年份加月份,如:2021年1月=20211
|
||||
@ -355,9 +357,6 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService {
|
||||
//服务到期时间刷新
|
||||
serverEndDate = serverEndDate.plusDays(totalDay);
|
||||
}
|
||||
/*for(String key : pauseMap.keySet()){
|
||||
System.out.println(key+":"+pauseMap.get(key).intValue());
|
||||
}*/
|
||||
return pauseMap;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.stdiet.custom.service.impl;
|
||||
|
||||
import com.stdiet.common.annotation.Excel;
|
||||
import com.stdiet.common.utils.DateUtils;
|
||||
import com.stdiet.common.utils.SecurityUtils;
|
||||
import com.stdiet.custom.domain.SysOrder;
|
||||
@ -76,14 +77,101 @@ public class SysOrderServiceImpl implements ISysOrderService {
|
||||
//计算服务到期时间
|
||||
setOrderServerEndDate(sysOrder);
|
||||
sysOrder.setOrderId(Long.parseLong(DateUtils.parseDateToStr(DateUtils.YYYYMMDDHHMMSS, orderTime)));
|
||||
int row = sysOrderMapper.insertSysOrder(sysOrder);
|
||||
// if (row > 0) {
|
||||
// //异步生成食谱计划
|
||||
// sysRecipesPlanService.regenerateRecipesPlan(sysOrder.getOrderId());
|
||||
// }
|
||||
//获取订单类型
|
||||
Integer[] orderType = sysOrder.getOrderTypeList();
|
||||
if(orderType == null || orderType.length != 3){
|
||||
return 0;
|
||||
}
|
||||
sysOrder.setOrderType(String.valueOf(orderType[0]));
|
||||
sysOrder.setOrderCountType(String.valueOf(orderType[1]));
|
||||
sysOrder.setOrderMoneyType(String.valueOf(orderType[2]));
|
||||
int row = 0;
|
||||
//普通单
|
||||
if("0".equals(sysOrder.getOrderType())){
|
||||
sysOrder.setNutritionistId((sysOrder.getNutritionistIdList() != null && sysOrder.getNutritionistIdList().length > 0) ? sysOrder.getNutritionistIdList()[0] : null);
|
||||
sysOrder.setMainOrderId(0L);
|
||||
sysOrder.setAfterSaleCommissOrder(0);
|
||||
sysOrder.setOnSaleId(null);
|
||||
//二开单
|
||||
if("1".equals(sysOrder.getOrderCountType())){
|
||||
row = sysOrderMapper.insertSysOrder(sysOrder);
|
||||
//需要自动创建售后二开提成单
|
||||
if(row > 0 && sysOrder.getSecondAfterSaleFlag() != null && sysOrder.getSecondAfterSaleFlag().intValue() == 1){
|
||||
autoCreateSecondAfterSaleOrder(sysOrder);
|
||||
}
|
||||
}else{
|
||||
row = sysOrderMapper.insertSysOrder(sysOrder);
|
||||
}
|
||||
}
|
||||
//比例拆分单
|
||||
else if("1".equals(sysOrder.getOrderType())){
|
||||
sysOrder.setAfterSaleCommissOrder(0);
|
||||
sysOrder.setOnSaleId(null);
|
||||
String rate = sysOrder.getNutritionistRate();
|
||||
if(StringUtils.isEmpty(rate) || rate.indexOf(",") == -1 || "0,10".equals(rate) || sysOrder.getNutritionistIdList().length != 2){
|
||||
return 0;
|
||||
}
|
||||
String[] rateArray = rate.split(",");
|
||||
if(Integer.parseInt(rateArray[0]) + Integer.parseInt(rateArray[1]) != 10){
|
||||
return 0;
|
||||
}
|
||||
BigDecimal amount = sysOrder.getAmount();
|
||||
//获取主单的数组下标
|
||||
int mainIndex = 0;
|
||||
if(Integer.parseInt(rateArray[1]) > Integer.parseInt(rateArray[0])){
|
||||
mainIndex = 1;
|
||||
}
|
||||
//添加主单
|
||||
sysOrder.setNutritionistId(sysOrder.getNutritionistIdList()[mainIndex]);
|
||||
sysOrder.setAmount(BigDecimal.valueOf(amount.doubleValue()*Integer.parseInt(rateArray[mainIndex])/10));
|
||||
sysOrder.setMainOrderId(0L);
|
||||
row = sysOrderMapper.insertSysOrder(sysOrder);
|
||||
//添加副单
|
||||
sysOrder.setMainOrderId(sysOrder.getOrderId());
|
||||
sysOrder.setOrderId(sysOrder.getOrderId()+1);
|
||||
sysOrder.setNutritionistId(sysOrder.getNutritionistIdList()[1-mainIndex]);
|
||||
sysOrder.setAmount(BigDecimal.valueOf(amount.doubleValue()*Integer.parseInt(rateArray[1-mainIndex])/10));
|
||||
row = sysOrderMapper.insertSysOrder(sysOrder);
|
||||
//二开,是否需要自动创建售后二开提成单
|
||||
if(row > 0 && "1".equals(sysOrder.getOrderCountType()) && sysOrder.getSecondAfterSaleFlag() != null && sysOrder.getSecondAfterSaleFlag().intValue() == 1){
|
||||
sysOrder.setAmount(amount);
|
||||
autoCreateSecondAfterSaleOrder(sysOrder);
|
||||
}
|
||||
}
|
||||
//体验单
|
||||
else if("2".equals(sysOrder.getOrderType())){
|
||||
sysOrder.setMainOrderId(0L);
|
||||
sysOrder.setAfterSaleCommissOrder(0);
|
||||
sysOrder.setAfterSaleId(null);
|
||||
sysOrder.setNutritionistId(null);
|
||||
sysOrder.setNutriAssisId(null);
|
||||
row = sysOrderMapper.insertSysOrder(sysOrder);
|
||||
}
|
||||
return row;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建售后二开提成订单
|
||||
* @param sysOrder
|
||||
* @return
|
||||
*/
|
||||
private int autoCreateSecondAfterSaleOrder(SysOrder sysOrder){
|
||||
if(sysOrder != null){
|
||||
sysOrder.setPreSaleId(sysOrder.getAfterSaleId());
|
||||
sysOrder.setAfterSaleId(null);
|
||||
sysOrder.setNutritionistId(null);
|
||||
sysOrder.setNutriAssisId(null);
|
||||
sysOrder.setPlannerId(null);
|
||||
sysOrder.setPlannerAssisId(null);
|
||||
sysOrder.setOperatorId(null);
|
||||
sysOrder.setOperatorAssisId(null);
|
||||
sysOrder.setAfterSaleCommissOrder(1);
|
||||
sysOrder.setOrderId(sysOrder.getOrderId()+1);
|
||||
return sysOrderMapper.insertSysOrder(sysOrder);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改销售订单
|
||||
*
|
||||
|
@ -40,6 +40,15 @@
|
||||
<result property="conditioningProjectId" column="conditioning_project_id"/>
|
||||
<result property="serverEndTime" column="server_end_time"/>
|
||||
<result property="becomeFanTime" column="become_fan_time"/>
|
||||
|
||||
<result property="onSaleId" column="on_sale_id" />
|
||||
<result property="orderType" column="order_type" />
|
||||
<result property="orderCountType" column="order_count_type" />
|
||||
<result property="orderMoneyType" column="order_money_type" />
|
||||
<result property="mainOrderId" column="main_order_id" />
|
||||
<result property="afterSaleCommissOrder" column="after_sale_commiss_order" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
|
||||
<!-- 非持久化字段 -->
|
||||
<result property="afterSale" column="afterSale_name"></result><!-- 售后名称 -->
|
||||
<result property="nutritionist" column="nutritionist_name"></result><!-- 营养师名称 -->
|
||||
@ -136,78 +145,90 @@
|
||||
|
||||
<select id="selectSysOrderById" parameterType="Long" resultMap="SysOrderResult">
|
||||
<include refid="selectSysOrderVo"/>
|
||||
where order_id = #{orderId}
|
||||
where order_id = #{orderId} and del_flag = 0
|
||||
</select>
|
||||
|
||||
<insert id="insertSysOrder" parameterType="SysOrder" useGeneratedKeys="true" keyProperty="orderId">
|
||||
insert into sys_order
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="orderId != null and orderId != ''">order_id,</if>
|
||||
<if test="customer != null and customer != ''">customer,</if>
|
||||
<if test="cusId != null">cus_id,</if>
|
||||
<if test="phone != null">phone,</if>
|
||||
<if test="amount != null">amount,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="pauseTime != null">pause_time,</if>
|
||||
<if test="startTime != null">start_time,</if>
|
||||
<if test="weight != null">weight,</if>
|
||||
<if test="payTypeId != null">pay_type_id,</if>
|
||||
<if test="reviewStatus != null">review_status,</if>
|
||||
<if test="preSaleId != null">pre_sale_id,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="weight != null">weight,</if>
|
||||
<if test="afterSaleId != null">after_sale_id,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="startTime != null">start_time,</if>
|
||||
<if test="pauseTime != null">pause_time,</if>
|
||||
<if test="nutritionistId != null">nutritionist_id,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="nutriAssisId != null">nutri_assis_id,</if>
|
||||
<if test="onSaleId != null">on_sale_id,</if>
|
||||
<if test="accountId != null">account_id,</if>
|
||||
<if test="plannerId != null">planner_id,</if>
|
||||
<if test="plannerAssisId != null">planner_assis_id,</if>
|
||||
<if test="operatorId != null">operator_id,</if>
|
||||
<if test="operatorAssisId != null">operator_assis_id,</if>
|
||||
<if test="recommender != null">recommender,</if>
|
||||
<if test="orderTime != null">order_time,</if>
|
||||
<if test="operatorId != null">operator_id,</if>
|
||||
<if test="serveTimeId != null">serve_time_id,</if>
|
||||
<if test="reviewStatus != null">review_status,</if>
|
||||
<if test="recommender != null">recommender,</if>
|
||||
<if test="amount != null">amount,</if>
|
||||
<if test="orderTime != null">order_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="giveServeDay != null">give_serve_day,</if>
|
||||
<if test="conditioningProjectId != null">conditioning_project_id,</if>
|
||||
<if test="serverEndTime != null">server_end_time,</if>
|
||||
<if test="becomeFanTime != null">become_fan_time,</if>
|
||||
<if test="orderType != null">order_type,</if>
|
||||
<if test="orderCountType != null">order_count_type,</if>
|
||||
<if test="orderMoneyType != null">order_money_type,</if>
|
||||
<if test="mainOrderId != null">main_order_id,</if>
|
||||
<if test="afterSaleCommissOrder != null">after_sale_commiss_order,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="orderId != null and orderId != ''">#{orderId},</if>
|
||||
<if test="customer != null and customer != ''">#{customer},</if>
|
||||
<if test="cusId != null">#{cusId},</if>
|
||||
<if test="phone != null">#{phone},</if>
|
||||
<if test="amount != null">#{amount},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="pauseTime != null">#{pauseTime},</if>
|
||||
<if test="startTime != null">#{startTime},</if>
|
||||
<if test="weight != null">#{weight},</if>
|
||||
<if test="payTypeId != null">#{payTypeId},</if>
|
||||
<if test="reviewStatus != null">#{reviewStatus},</if>
|
||||
<if test="preSaleId != null">#{preSaleId},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="weight != null">#{weight},</if>
|
||||
<if test="afterSaleId != null">#{afterSaleId},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="startTime != null">#{startTime},</if>
|
||||
<if test="pauseTime != null">#{pauseTime},</if>
|
||||
<if test="nutritionistId != null">#{nutritionistId},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="nutriAssisId != null">#{nutriAssisId},</if>
|
||||
<if test="onSaleId != null">#{onSaleId},</if>
|
||||
<if test="accountId != null">#{accountId},</if>
|
||||
<if test="plannerId != null">#{plannerId},</if>
|
||||
<if test="plannerAssisId != null">#{plannerAssisId},</if>
|
||||
<if test="operatorId != null">#{operatorId},</if>
|
||||
<if test="operatorAssisId != null">#{operatorAssisId},</if>
|
||||
<if test="recommender != null">#{recommender},</if>
|
||||
<if test="orderTime != null">#{orderTime},</if>
|
||||
<if test="operatorId != null">#{operatorId},</if>
|
||||
<if test="serveTimeId != null">#{serveTimeId},</if>
|
||||
<if test="reviewStatus != null">#{reviewStatus},</if>
|
||||
<if test="recommender != null">#{recommender},</if>
|
||||
<if test="amount != null">#{amount},</if>
|
||||
<if test="orderTime != null">#{orderTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="giveServeDay != null">#{giveServeDay},</if>
|
||||
<if test="conditioningProjectId != null">#{conditioningProjectId},</if>
|
||||
<if test="serverEndTime != null">#{serverEndTime},</if>
|
||||
<if test="becomeFanTime != null">#{becomeFanTime},</if>
|
||||
<if test="orderType != null">#{orderType},</if>
|
||||
<if test="orderCountType != null">#{orderCountType},</if>
|
||||
<if test="orderMoneyType != null">#{orderMoneyType},</if>
|
||||
<if test="mainOrderId != null">#{mainOrderId},</if>
|
||||
<if test="afterSaleCommissOrder != null">#{afterSaleCommissOrder},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -217,34 +238,41 @@
|
||||
<if test="customer != null and customer != ''">customer = #{customer},</if>
|
||||
<if test="cusId != null">cus_id = #{cusId},</if>
|
||||
<if test="phone != null">phone = #{phone},</if>
|
||||
<if test="amount != null">amount = #{amount},</if>
|
||||
<if test="weight != null">weight = #{weight},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="pauseTime != null">pause_time = #{pauseTime},</if>
|
||||
<if test="startTime != null">start_time = #{startTime},</if>
|
||||
<if test="payTypeId != null">pay_type_id = #{payTypeId},</if>
|
||||
<if test="reviewStatus != null">review_status = #{reviewStatus},</if>
|
||||
<if test="preSaleId != null">pre_sale_id = #{preSaleId},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="weight != null">weight = #{weight},</if>
|
||||
<if test="afterSaleId != null">after_sale_id = #{afterSaleId},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="startTime != null">start_time = #{startTime},</if>
|
||||
<if test="pauseTime != null">pause_time = #{pauseTime},</if>
|
||||
<if test="nutritionistId != null">nutritionist_id = #{nutritionistId},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="nutriAssisId != null">nutri_assis_id = #{nutriAssisId},</if>
|
||||
<if test="onSaleId != null">on_sale_id = #{onSaleId},</if>
|
||||
<if test="accountId != null">account_id = #{accountId},</if>
|
||||
<if test="plannerId != null">planner_id = #{plannerId},</if>
|
||||
<if test="plannerAssisId != null">planner_assis_id = #{plannerAssisId},</if>
|
||||
<if test="operatorId != null">operator_id = #{operatorId},</if>
|
||||
<if test="operatorAssisId != null">operator_assis_id = #{operatorAssisId},</if>
|
||||
<if test="recommender != null">recommender = #{recommender},</if>
|
||||
<if test="orderTime != null">order_time = #{orderTime},</if>
|
||||
<if test="operatorId != null">operator_id = #{operatorId},</if>
|
||||
<if test="serveTimeId != null">serve_time_id = #{serveTimeId},</if>
|
||||
<if test="reviewStatus != null">review_status = #{reviewStatus},</if>
|
||||
<if test="recommender != null">recommender = #{recommender},</if>
|
||||
<if test="amount != null">amount = #{amount},</if>
|
||||
<if test="orderTime != null">order_time = #{orderTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="giveServeDay != null">give_serve_day = #{giveServeDay},</if>
|
||||
<if test="conditioningProjectId != null">conditioning_project_id = #{conditioningProjectId},</if>
|
||||
<if test="serverEndTime != null">server_end_time = #{serverEndTime},</if>
|
||||
<if test="becomeFanTime != null">become_fan_time = #{becomeFanTime},</if>
|
||||
<if test="orderType != null">order_type = #{orderType},</if>
|
||||
<if test="orderCountType != null">order_count_type = #{orderCountType},</if>
|
||||
<if test="orderMoneyType != null">order_money_type = #{orderMoneyType},</if>
|
||||
<if test="mainOrderId != null">main_order_id = #{mainOrderId},</if>
|
||||
<if test="afterSaleCommissOrder != null">after_sale_commiss_order = #{afterSaleCommissOrder},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where order_id = #{orderId}
|
||||
</update>
|
||||
@ -296,6 +324,15 @@
|
||||
<result property="conditioningProjectId" column="conditioning_project_id"/>
|
||||
<result property="serverEndTime" column="server_end_time"/>
|
||||
<result property="becomeFanTime" column="become_fan_time"/>
|
||||
|
||||
<result property="onSaleId" column="on_sale_id" />
|
||||
<result property="orderType" column="order_type" />
|
||||
<result property="orderCountType" column="order_count_type" />
|
||||
<result property="orderMoneyType" column="order_money_type" />
|
||||
<result property="mainOrderId" column="main_order_id" />
|
||||
<result property="afterSaleCommissOrder" column="after_sale_commiss_order" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
|
||||
<!-- 非持久化字段 -->
|
||||
<result property="afterSale" column="afterSale_name"></result><!-- 售后名称 -->
|
||||
<result property="nutritionist" column="nutritionist_name"></result><!-- 营养师名称 -->
|
||||
|
@ -150,7 +150,7 @@
|
||||
LEFT JOIN sys_customer sc ON sc.id = srp.cus_id
|
||||
LEFT JOIN sys_user su_nutritionist ON su_nutritionist.user_id = sr.nutritionist_id AND su_nutritionist.del_flag = 0
|
||||
LEFT JOIN sys_user su_nutritionist_assis ON su_nutritionist_assis.user_id = sr.nutri_assis_id AND su_nutritionist_assis.del_flag = 0
|
||||
WHERE srp.del_flag = 0
|
||||
WHERE srp.del_flag = 0 and sr.del_flag = 0
|
||||
<if test="orderId != null">AND srp.order_id = #{orderId}</if>
|
||||
<if test="sendFlag != null">AND srp.send_flag = #{sendFlag}</if>
|
||||
<if test="customer != null and customer != ''">AND (sc.name like concat('%',#{customer},'%') OR sc.phone like concat('%',#{customer},'%'))</if>
|
||||
@ -182,7 +182,7 @@
|
||||
SELECT srp.id,srp.order_id,sr.customer,sr.phone, srp.start_date,srp.end_date,srp.send_flag,srp.send_time
|
||||
FROM sys_recipes_plan srp
|
||||
LEFT JOIN sys_order sr ON sr.order_id = srp.order_id
|
||||
WHERE srp.del_flag = 0 AND srp.order_id = #{orderId}
|
||||
WHERE srp.del_flag = 0 AND sr.del_flag = 0 AND srp.order_id = #{orderId}
|
||||
<if test="sendFlag != null">AND srp.send_flag = #{sendFlag}</if>
|
||||
ORDER BY srp.id ASC
|
||||
</select>
|
||||
|
@ -10,16 +10,16 @@
|
||||
<el-row :gutter="15">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="订单类型" prop="orderType">
|
||||
<el-form-item label="订单类型" prop="orderTypeList">
|
||||
<el-cascader
|
||||
v-model="form.orderType"
|
||||
v-model="form.orderTypeList"
|
||||
:options="orderTypeOptions"
|
||||
style="width: 100%"
|
||||
>
|
||||
</el-cascader>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-col :span="8" v-show="secondAfterSaleFlagShow">
|
||||
<el-form-item
|
||||
label="自动创建售后提成订单"
|
||||
prop="secondAfterSaleFlag"
|
||||
@ -27,7 +27,6 @@
|
||||
>
|
||||
<el-select
|
||||
v-model="form.secondAfterSaleFlag"
|
||||
:disabled="secondAfterSaleFlagShow"
|
||||
style="width: 100px"
|
||||
placeholder="请选择"
|
||||
>
|
||||
@ -116,7 +115,18 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-col :span="8" v-show="!afterNutiShow">
|
||||
<el-form-item label="售中" prop="onSaleId">
|
||||
<el-select v-model="form.onSaleId" placeholder="请选择">
|
||||
<el-option
|
||||
:key="177"
|
||||
:label="'时瑞瑞'"
|
||||
:value="parseInt('177')"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" v-show="afterNutiShow">
|
||||
<el-form-item label="售后" prop="afterSaleId">
|
||||
<el-select v-model="form.afterSaleId" placeholder="请选择">
|
||||
<el-option
|
||||
@ -128,7 +138,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-col :span="8" v-show="afterNutiShow">
|
||||
<el-form-item label="主营养师" prop="nutritionistIdList">
|
||||
<el-select
|
||||
v-model="form.nutritionistIdList"
|
||||
@ -144,11 +154,10 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-col :span="8" v-show="orderRateOptionsShow">
|
||||
<el-form-item label="拆分比例" prop="nutritionistRate">
|
||||
<el-select
|
||||
v-model="form.nutritionistRate"
|
||||
:disabled="orderRateOptionsShow"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
@ -160,7 +169,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-col :span="8" v-show="afterNutiShow">
|
||||
<el-form-item label="助理营养师" prop="nutriAssisId">
|
||||
<el-select v-model="form.nutriAssisId" placeholder="请选择">
|
||||
<el-option
|
||||
@ -252,7 +261,8 @@
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10" v-hasPermi="['custom:order:review']">
|
||||
<!-- 添加时默认未审核,不能改 -->
|
||||
<el-col :span="10" v-hasPermi="['custom:order:review']" v-show="false">
|
||||
<el-form-item label="审核状态" prop="reviewStatus">
|
||||
<el-select v-model="form.reviewStatus" placeholder="请选择审核状态">
|
||||
<el-option
|
||||
@ -417,10 +427,12 @@ export default {
|
||||
orderDropdownCorrespondingOptions: [],
|
||||
//订单类型
|
||||
orderTypeOptions: orderTypeData["orderTypeArray"],
|
||||
secondAfterSaleFlagShow: true,
|
||||
secondAfterSaleFlagShow: false,
|
||||
//分成比例
|
||||
orderRateOptions: orderTypeData["orderRateArray"],
|
||||
orderRateOptionsShow: true,
|
||||
orderRateOptionsShow: false,
|
||||
//售后、营养师、营养师助理是否显示
|
||||
afterNutiShow: true,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@ -571,7 +583,8 @@ export default {
|
||||
: [0, 0, 0, 0];
|
||||
this.form = {
|
||||
orderId: null,
|
||||
orderType: [0, 0, 0],
|
||||
orderType: null,
|
||||
orderTypeList: [0, 0, 0],
|
||||
secondAfterSaleFlag: 0,
|
||||
customer: null,
|
||||
phone: null,
|
||||
@ -587,6 +600,7 @@ export default {
|
||||
preSaleId: defaultPresale ? parseInt(defaultPresale.dictValue) : null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
onSaleId: null,
|
||||
afterSaleId: defaultAftersale
|
||||
? parseInt(defaultAftersale.dictValue)
|
||||
: null,
|
||||
@ -653,7 +667,7 @@ export default {
|
||||
}
|
||||
},
|
||||
handleOrderTypeChange() {
|
||||
console.log(this.form.orderType);
|
||||
console.log(this.form.orderTypeList);
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
@ -661,23 +675,37 @@ export default {
|
||||
"form.accountId": function (newVal, oldVal) {
|
||||
this.initPlanningAndOperation();
|
||||
},
|
||||
"form.orderType": function (newVal, oldVal) {
|
||||
"form.orderTypeList": function (newVal, oldVal) {
|
||||
//判断订单类型是否选择了二开
|
||||
if (newVal[1] == 1) {
|
||||
this.form.secondAfterSaleFlag = 1;
|
||||
this.secondAfterSaleFlagShow = false;
|
||||
this.secondAfterSaleFlagShow = true;
|
||||
} else {
|
||||
this.form.secondAfterSaleFlag = 0;
|
||||
this.secondAfterSaleFlagShow = true;
|
||||
this.secondAfterSaleFlagShow = false;
|
||||
}
|
||||
//判断是否选择了比例拆分单
|
||||
if (newVal[0] == 1) {
|
||||
this.orderRateOptionsShow = false;
|
||||
this.orderRateOptionsShow = true;
|
||||
this.form.nutritionistRate = "2,8";
|
||||
} else {
|
||||
this.orderRateOptionsShow = true;
|
||||
this.orderRateOptionsShow = false;
|
||||
this.form.nutritionistRate = "0,10";
|
||||
}
|
||||
//判断是否选择了体验单
|
||||
if (newVal[0] == 2) {
|
||||
/*this.form.nutritionistId = null;
|
||||
this.form.nutritionistIdList = null;
|
||||
this.form.afterSaleId = null;
|
||||
this.form.nutriAssisId = null;*/
|
||||
this.afterNutiShow = false;
|
||||
this.form.onSaleId = 177;
|
||||
this.form.serveTimeId = 7;
|
||||
}else{
|
||||
this.form.onSaleId = null;
|
||||
this.form.serveTimeId = 90;
|
||||
this.afterNutiShow = true;
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
@ -102,7 +102,7 @@
|
||||
</el-drawer>
|
||||
|
||||
<!-- 新增订单 -->
|
||||
<!--<create-order-dialog ref="cusCreateOrderDialogRef" />-->
|
||||
<create-order-dialog ref="cusCreateOrderDialogRef" />
|
||||
<!-- 订单编辑 -->
|
||||
<edit-order-dialog ref="cusEditOrderDialogRef" />
|
||||
|
||||
@ -112,7 +112,7 @@
|
||||
<script>
|
||||
import { listOrder, delOrder } from "@/api/custom/order";
|
||||
import OrderEdit from "@/components/OrderEdit";
|
||||
// import OrderAdd from "@/components/OrderAdd";
|
||||
import OrderAdd from "@/components/OrderAdd";
|
||||
import OrderDetail from "@/components/OrderDetail";
|
||||
import { mapGetters } from "vuex";
|
||||
import { checkPermi } from "@/utils/permission";
|
||||
@ -122,7 +122,7 @@ export default {
|
||||
components: {
|
||||
"edit-order-dialog": OrderEdit,
|
||||
"order-detail": OrderDetail,
|
||||
//"create-order-dialog": OrderAdd
|
||||
"create-order-dialog": OrderAdd
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -171,13 +171,13 @@ export default {
|
||||
});
|
||||
},
|
||||
handleAdd() {
|
||||
this.$refs.cusEditOrderDialogRef.showDialog(
|
||||
this.$refs.cusCreateOrderDialogRef.showDialog(
|
||||
{
|
||||
customer: this.data.name,
|
||||
cusId: this.data.id,
|
||||
preSaleId: this.data.salesman,
|
||||
afterSaleId: this.data.afterDietitian,
|
||||
nutritionistId: this.data.mainDietitian,
|
||||
nutritionistIdList: [this.data.mainDietitian],
|
||||
nutriAssisId: this.data.assistantDietitian,
|
||||
},
|
||||
() => {
|
||||
|
@ -35,6 +35,18 @@ export const orderTypeArray = [
|
||||
value: 1,
|
||||
label: "比例拆分单",
|
||||
children: orderCountTypeArray
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: "体验单",
|
||||
children:[{
|
||||
value: 0,
|
||||
label: "一开单",
|
||||
children: [{
|
||||
value: 0,
|
||||
label: "全款单"
|
||||
}]
|
||||
}]
|
||||
}
|
||||
]
|
||||
|
||||
@ -43,7 +55,7 @@ export const orderRateArray = [
|
||||
{
|
||||
dictValue: "0,10",
|
||||
dictLabel: "不拆分",
|
||||
remark: ""
|
||||
remark: "default"
|
||||
},
|
||||
{
|
||||
dictValue: "1,9",
|
||||
@ -52,7 +64,7 @@ export const orderRateArray = [
|
||||
},{
|
||||
dictValue: "2,8",
|
||||
dictLabel: "2-8开",
|
||||
remark: "default"
|
||||
remark: ""
|
||||
},
|
||||
{
|
||||
dictValue: "3,7",
|
||||
|
Loading…
x
Reference in New Issue
Block a user