Commit cf73f626 by huluobin

update

parent 6983b8ad
...@@ -19,16 +19,18 @@ public interface ITechniqueSkuService extends IService<TechniqueSku> { ...@@ -19,16 +19,18 @@ public interface ITechniqueSkuService extends IService<TechniqueSku> {
/** /**
* 查询所哟款式技法 * 查询所哟款式技法
*
* @return * @return
*/ */
List<TechniqueSku> queryAll(); List<TechniqueSku> queryAll();
/** /**
* 查询所有款式技法分组 包括默认数量 单选多选 * 查询所有款式技法分组 包括默认数量 单选多选
*
* @return * @return
*/ */
Map<String, List<TechniqueSku>> queryTechniqueSkuMap(); Map<String, List<TechniqueSku>> queryTechniqueSkuMap();
List<TechniqueCategory> queryTechniqueCategoryAggregate(); List<TechniqueCategory> queryTechniqueCategoryAggregate(Integer scheduleServeId);
} }
...@@ -3,9 +3,13 @@ package com.gogirl.application.product.serve.impl; ...@@ -3,9 +3,13 @@ package com.gogirl.application.product.serve.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gogirl.application.product.serve.ITechniqueSkuService; import com.gogirl.application.product.serve.ITechniqueSkuService;
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.TechniqueCategory;
import com.gogirl.domain.product.serve.TechniqueSku; import com.gogirl.domain.product.serve.TechniqueSku;
import com.gogirl.infrastructure.common.util.JsonUtilByFsJson; import com.gogirl.infrastructure.common.util.JsonUtilByFsJson;
import com.gogirl.infrastructure.mapper.order.serve.ScheduleServeMapper;
import com.gogirl.infrastructure.mapper.product.serve.BaseServeMapper;
import com.gogirl.infrastructure.mapper.product.serve.TechniqueCategoryMapper; import com.gogirl.infrastructure.mapper.product.serve.TechniqueCategoryMapper;
import com.gogirl.infrastructure.mapper.product.serve.TechniqueSkuMapper; import com.gogirl.infrastructure.mapper.product.serve.TechniqueSkuMapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -53,10 +57,35 @@ public class TechniqueSkuServiceImpl extends ServiceImpl<TechniqueSkuMapper, Tec ...@@ -53,10 +57,35 @@ public class TechniqueSkuServiceImpl extends ServiceImpl<TechniqueSkuMapper, Tec
return result; return result;
} }
@Resource
ScheduleServeMapper scheduleServeMapper;
@Resource
BaseServeMapper baseServeMapper;
private final String TECH_REMOVE_ARMOR = "卸甲";
private final String TECH_EXTEND = "光疗延长";
@Override @Override
public List<TechniqueCategory> queryTechniqueCategoryAggregate() { public List<TechniqueCategory> queryTechniqueCategoryAggregate(Integer scheduleServeId) {
ScheduleServe scheduleServe = scheduleServeMapper.selectById(scheduleServeId);
BaseServe baseServe = baseServeMapper.selectById(scheduleServe.getServeId());
ScheduleServe subRemoveArmor = scheduleServeMapper.subRemoveArmor(scheduleServeId, scheduleServe.getSchId());
ScheduleServe subExtend = scheduleServeMapper.subExtend(scheduleServeId, scheduleServe.getSchId());
List<TechniqueSku> techniqueSkuList = this.list(); List<TechniqueSku> techniqueSkuList = this.list();
List<TechniqueCategory> techniqueCategoryList = techniqueCategoryMapper.selectList(new LambdaQueryWrapper<>());
LambdaQueryWrapper<TechniqueCategory> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(TechniqueCategory::getServiceTypeId, baseServe.getTypeId());
if (subRemoveArmor != null) {
wrapper.ne(TechniqueCategory::getName, TECH_REMOVE_ARMOR);
}
if (subExtend != null) {
wrapper.ne(TechniqueCategory::getName, TECH_EXTEND);
}
List<TechniqueCategory> techniqueCategoryList = techniqueCategoryMapper.selectList(wrapper);
Map<Integer, List<TechniqueSku>> integerListMap = techniqueSkuList.stream().collect(Collectors.groupingBy(TechniqueSku::getTechniqueCategoryId)); Map<Integer, List<TechniqueSku>> integerListMap = techniqueSkuList.stream().collect(Collectors.groupingBy(TechniqueSku::getTechniqueCategoryId));
......
...@@ -24,4 +24,22 @@ public interface ScheduleServeMapper extends BaseMapper<ScheduleServe> { ...@@ -24,4 +24,22 @@ public interface ScheduleServeMapper extends BaseMapper<ScheduleServe> {
List<ScheduleServe> selectUpdateStatusList(@Param("schId") Integer schId, @Param("serveId") Integer serveId); List<ScheduleServe> selectUpdateStatusList(@Param("schId") Integer schId, @Param("serveId") Integer serveId);
/**
* 服务的卸甲子服务
*
* @param scheduleServeId
* @return
*/
ScheduleServe subRemoveArmor(@Param("scheduleServeId") Integer scheduleServeId, @Param("scheduleId") Integer scheduleId);
/**
* 服务的延长子服务
*
* @param scheduleServeId
* @param scheduleId
* @return
*/
ScheduleServe subExtend(@Param("scheduleServeId") Integer scheduleServeId, @Param("scheduleId") Integer scheduleId);
} }
...@@ -8,6 +8,7 @@ import com.gogirl.infrastructure.common.base.JsonResult; ...@@ -8,6 +8,7 @@ import com.gogirl.infrastructure.common.base.JsonResult;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -55,8 +56,8 @@ public class TechniqueSkuController { ...@@ -55,8 +56,8 @@ public class TechniqueSkuController {
@ApiOperation("查询所有款式技法分组") @ApiOperation("查询所有款式技法分组")
@GetMapping("/technician/techniqueSku/queryTechniqueCategoryAggregate") @GetMapping("/technician/techniqueSku/queryTechniqueCategoryAggregate")
public JsonResult<List<TechniqueCategory>> queryTechniqueCategoryAggregate() { public JsonResult<List<TechniqueCategory>> queryTechniqueCategoryAggregate(@RequestParam(required = false) Integer scheduleServeId) {
List<TechniqueCategory> techniqueCategoryList = techniqueSkuService.queryTechniqueCategoryAggregate(); List<TechniqueCategory> techniqueCategoryList = techniqueSkuService.queryTechniqueCategoryAggregate(scheduleServeId);
return JsonResult.success(techniqueCategoryList); return JsonResult.success(techniqueCategoryList);
} }
......
...@@ -23,5 +23,21 @@ ...@@ -23,5 +23,21 @@
where sch_id = #{schId} where sch_id = #{schId}
and (serve_id = #{serveId} or main_serve_id = #{serveId}) and (serve_id = #{serveId} or main_serve_id = #{serveId})
</select> </select>
<select id="subRemoveArmor" resultType="com.gogirl.domain.order.serve.ScheduleServe">
select *
from scheduled_serve
where sch_id = #{scheduleId}
and main_serve_id = #{scheduleServeId}
and serve_name like concat('%', '卸甲', '%')
limit 1
</select>
<select id="subExtend" resultType="com.gogirl.domain.order.serve.ScheduleServe">
select *
from scheduled_serve
where sch_id = #{scheduleId}
and main_serve_id = #{scheduleServeId}
and serve_name like concat('%', '延长', '%')
limit 1
</select>
</mapper> </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