Commit da259d65 by huluobin

update

parent 64a0069b
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.gogirl.domain.product.serve.TechniqueCategory;
import com.gogirl.domain.product.serve.TechniqueSku;
import javax.validation.constraints.Null;
import java.util.List;
import java.util.Map;
......@@ -32,5 +33,6 @@ public interface ITechniqueSkuService extends IService<TechniqueSku> {
Map<String, List<TechniqueSku>> queryTechniqueSkuMap();
List<TechniqueCategory> queryTechniqueCategoryAggregate(Integer scheduleServeId);
List<TechniqueCategory> queryTechniqueCategoryAggregate(@Null Integer scheduleServeId,
@Null Integer orderServeId);
}
......@@ -3,11 +3,13 @@ package com.gogirl.application.product.serve.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gogirl.application.product.serve.ITechniqueSkuService;
import com.gogirl.domain.order.serve.OrderServe;
import com.gogirl.domain.order.serve.ScheduleServe;
import com.gogirl.domain.product.serve.BaseServe;
import com.gogirl.domain.product.serve.TechniqueCategory;
import com.gogirl.domain.product.serve.TechniqueSku;
import com.gogirl.infrastructure.common.util.JsonUtilByFsJson;
import com.gogirl.infrastructure.mapper.order.serve.OrderServeMapper;
import com.gogirl.infrastructure.mapper.order.serve.ScheduleServeMapper;
import com.gogirl.infrastructure.mapper.product.serve.BaseServeMapper;
import com.gogirl.infrastructure.mapper.product.serve.TechniqueCategoryMapper;
......@@ -15,6 +17,7 @@ import com.gogirl.infrastructure.mapper.product.serve.TechniqueSkuMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.validation.constraints.Null;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -61,26 +64,44 @@ public class TechniqueSkuServiceImpl extends ServiceImpl<TechniqueSkuMapper, Tec
ScheduleServeMapper scheduleServeMapper;
@Resource
BaseServeMapper baseServeMapper;
@Resource
OrderServeMapper orderServeMapper;
private static final String TECH_REMOVE_ARMOR = "卸甲";
private static final String TECH_EXTEND = "光疗延长";
@Override
public List<TechniqueCategory> queryTechniqueCategoryAggregate(Integer scheduleServeId) {
public List<TechniqueCategory> queryTechniqueCategoryAggregate(@Null Integer scheduleServeId,
@Null Integer orderServeId) {
List<TechniqueSku> techniqueSkuList = this.list();
LambdaQueryWrapper<TechniqueCategory> wrapper = new LambdaQueryWrapper<>();
if (scheduleServeId != null) {
ScheduleServe scheduleServe = scheduleServeMapper.selectById(scheduleServeId);
BaseServe baseServe = baseServeMapper.selectById(scheduleServe.getServeId());
wrapper.eq(TechniqueCategory::getServiceTypeId, baseServe.getTypeId());
ScheduleServe subRemoveArmor = scheduleServeMapper.subRemoveArmor(scheduleServe.getServeId(), scheduleServe.getSchId());
ScheduleServe subExtend = scheduleServeMapper.subExtend(scheduleServe.getServeId(), scheduleServe.getSchId());
if (subRemoveArmor != null) {
wrapper.ne(TechniqueCategory::getName, TECH_REMOVE_ARMOR);
}
if (subExtend != null) {
wrapper.ne(TechniqueCategory::getName, TECH_EXTEND);
}
}
if (orderServeId != null) {
OrderServe orderServe = orderServeMapper.selectById(orderServeId);
BaseServe baseServe = baseServeMapper.selectById(orderServe.getServeId());
wrapper.eq(TechniqueCategory::getServiceTypeId, baseServe.getTypeId());
OrderServe subRemoveArmor = orderServeMapper.subRemoveArmor(orderServe.getServeId(), orderServe.getOrderId());
OrderServe subExtend = orderServeMapper.subExtend(orderServe.getServeId(), orderServe.getOrderId());
if (subRemoveArmor != null) {
wrapper.ne(TechniqueCategory::getName, TECH_REMOVE_ARMOR);
......@@ -88,6 +109,7 @@ public class TechniqueSkuServiceImpl extends ServiceImpl<TechniqueSkuMapper, Tec
if (subExtend != null) {
wrapper.ne(TechniqueCategory::getName, TECH_EXTEND);
}
}
List<TechniqueCategory> techniqueCategoryList = techniqueCategoryMapper.selectList(wrapper);
......
......@@ -64,4 +64,22 @@ public interface OrderServeMapper extends BaseMapper<OrderServe> {
* @return
*/
List<CouponCustomerRelevance> selectReCalc();
/**
* 卸甲子服务
*
* @param mainServeId 主服务id
* @param orderId 订单id
* @return
*/
OrderServe subRemoveArmor(@Param("mainServeId") Integer mainServeId, @Param("orderId") Integer orderId);
/**
* 延长子服务
*
* @param mainServeId 主服务id
* @param orderId 订单id
* @return
*/
OrderServe subExtend(@Param("mainServeId") Integer mainServeId, @Param("orderId") Integer orderId);
}
......@@ -56,8 +56,9 @@ public class TechniqueSkuController {
@ApiOperation("查询所有款式技法分组")
@GetMapping("/technician/techniqueSku/queryTechniqueCategoryAggregate")
public JsonResult<List<TechniqueCategory>> queryTechniqueCategoryAggregate(@RequestParam(required = false) Integer scheduleServeId) {
List<TechniqueCategory> techniqueCategoryList = techniqueSkuService.queryTechniqueCategoryAggregate(scheduleServeId);
public JsonResult<List<TechniqueCategory>> queryTechniqueCategoryAggregate(@RequestParam(required = false) Integer scheduleServeId,
@RequestParam(required = false) Integer orderServeId) {
List<TechniqueCategory> techniqueCategoryList = techniqueSkuService.queryTechniqueCategoryAggregate(scheduleServeId, orderServeId);
return JsonResult.success(techniqueCategoryList);
}
......
......@@ -238,12 +238,32 @@
</select>
<select id="selectReCalc" resultType="com.gogirl.domain.market.coupon.CouponCustomerRelevance">
SELECT t1.* from coupon_customer_relevance t1
LEFT JOIN order_manage t2 on t1.order_id =t2.id
where t1.state =2
SELECT t1.*
from coupon_customer_relevance t1
LEFT JOIN order_manage t2 on t1.order_id = t2.id
where t1.state = 2
and t2.create_time like '2020-03%'
and t1.coupon_name like '%免单券%'
and (t2.`status` =3 or t2.`status` =4)
and (t2.`status` = 3 or t2.`status` = 4)
GROUP BY t1.order_id
</select>
<select id="subRemoveArmor" resultType="com.gogirl.domain.order.serve.OrderServe">
select *
from order_serve
where order_id = #{orderId}
and main_serve_id = #{mainServeId}
and serve_name like concat('%', '卸甲', '%')
limit 1
</select>
<select id="subExtend" resultType="com.gogirl.domain.order.serve.OrderServe">
select *
from order_serve
where order_id = #{orderId}
and main_serve_id = #{mainServeId}
and serve_name like concat('%', '延长', '%')
limit 1
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment