Commit 6b7b9673 by huluobin

Merge branch '3.7.1' into 3.8

parents 878f3d46 bed07381
package com.gogirl.application.product.serve.impl; package com.gogirl.application.product.serve.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gogirl.application.product.serve.BaseServeService; import com.gogirl.application.product.serve.BaseServeService;
import com.gogirl.domain.market.discount.LeisureDiscountConfig; import com.gogirl.domain.market.discount.LeisureDiscountConfig;
import com.gogirl.domain.product.serve.BaseProduce;
import com.gogirl.domain.product.serve.BaseServe; import com.gogirl.domain.product.serve.BaseServe;
import com.gogirl.infrastructure.mapper.market.discount.LeisureDiscountConfigMapper; import com.gogirl.infrastructure.mapper.market.discount.LeisureDiscountConfigMapper;
import com.gogirl.infrastructure.mapper.product.serve.BaseProduceMapper;
import com.gogirl.infrastructure.mapper.product.serve.BaseServeMapper; import com.gogirl.infrastructure.mapper.product.serve.BaseServeMapper;
import com.gogirl.infrastructure.mapper.product.serve.ProducePromotionTimeMapper; import com.gogirl.infrastructure.mapper.product.serve.ProducePromotionTimeMapper;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
...@@ -21,6 +24,7 @@ public class BaseServeServiceImpl extends ServiceImpl<BaseServeMapper, BaseServe ...@@ -21,6 +24,7 @@ public class BaseServeServiceImpl extends ServiceImpl<BaseServeMapper, BaseServe
private final BaseServeMapper baseServeMapper; private final BaseServeMapper baseServeMapper;
private final LeisureDiscountConfigMapper leisureDiscountConfigMapper; private final LeisureDiscountConfigMapper leisureDiscountConfigMapper;
private final BaseProduceMapper baseProduceMapper;
@Override @Override
...@@ -32,7 +36,12 @@ public class BaseServeServiceImpl extends ServiceImpl<BaseServeMapper, BaseServe ...@@ -32,7 +36,12 @@ public class BaseServeServiceImpl extends ServiceImpl<BaseServeMapper, BaseServe
@Override @Override
public BaseServe getAggregate(Integer id, LocalDateTime date, Integer departmentId) { public BaseServe getAggregate(Integer id, LocalDateTime date, Integer departmentId) {
BaseServe baseServe = baseServeMapper.getAggregate(id); BaseServe baseServe = baseServeMapper.selectById(id);
List<BaseProduce> baseProduceList = baseProduceMapper.selectList(new LambdaQueryWrapper<BaseProduce>()
.eq(BaseProduce::getServiceId, baseServe.getId()));
baseServe.setListProduce(baseProduceList);
if (date != null) { if (date != null) {
LeisureDiscountConfig leisureDiscountConfig = leisureDiscountConfigMapper.selectLeisureDiscount(id, LeisureDiscountConfig leisureDiscountConfig = leisureDiscountConfigMapper.selectLeisureDiscount(id,
date.toLocalTime().toString(), date.toLocalTime().toString(),
......
...@@ -21,5 +21,4 @@ public interface BaseServeMapper extends BaseMapper<BaseServe> { ...@@ -21,5 +21,4 @@ public interface BaseServeMapper extends BaseMapper<BaseServe> {
IPage<BaseServe> listLeisureServeForPage(@Param("page") IPage<BaseServe> page, @Param("baseServe") BaseServe baseServe, @Param("serveIdList") List<Integer> serveIdList, @Param("time") String time, @Param("week") Integer week); IPage<BaseServe> listLeisureServeForPage(@Param("page") IPage<BaseServe> page, @Param("baseServe") BaseServe baseServe, @Param("serveIdList") List<Integer> serveIdList, @Param("time") String time, @Param("week") Integer week);
BaseServe getAggregate(Integer id);
} }
...@@ -5,7 +5,6 @@ import com.gogirl.application.store.store.StoreUserService; ...@@ -5,7 +5,6 @@ import com.gogirl.application.store.store.StoreUserService;
import com.gogirl.application.xcx.GogirlTokenService; import com.gogirl.application.xcx.GogirlTokenService;
import com.gogirl.domain.store.store.StoreTechnician; import com.gogirl.domain.store.store.StoreTechnician;
import com.gogirl.domain.store.store.StoreUser; import com.gogirl.domain.store.store.StoreUser;
import com.gogirl.domain.xcx.GogirlToken;
import com.gogirl.infrastructure.common.base.JsonResult; import com.gogirl.infrastructure.common.base.JsonResult;
import com.gogirl.infrastructure.config.property.GogirlProperties; import com.gogirl.infrastructure.config.property.GogirlProperties;
import com.gogirl.infrastructure.service.file.FileService; import com.gogirl.infrastructure.service.file.FileService;
...@@ -43,11 +42,8 @@ public class StoreTechnicianController { ...@@ -43,11 +42,8 @@ public class StoreTechnicianController {
@ApiOperation(value = "查询当前店铺的美甲师,选推荐人") @ApiOperation(value = "查询当前店铺的美甲师,选推荐人")
@GetMapping("/technician/user/queryUserForAll") @GetMapping("/technician/user/queryUserForAll")
public JsonResult<List<StoreUser>> queryUserForAll(String token) { public JsonResult<List<StoreUser>> queryUserForAll() {
GogirlToken gt = gogirlTokenService.getByToken(token);
if (gt == null) {
return new JsonResult<>(false, "TOKEN_NULL_CODE");
}
JsonResult<List<StoreUser>> jsonResult = new JsonResult<>(); JsonResult<List<StoreUser>> jsonResult = new JsonResult<>();
StoreUser storeUser = new StoreUser(); StoreUser storeUser = new StoreUser();
storeUser.setDepartmentId(SessionUtils.getTechnicianToken().getDepartmentId()); storeUser.setDepartmentId(SessionUtils.getTechnicianToken().getDepartmentId());
...@@ -59,6 +55,19 @@ public class StoreTechnicianController { ...@@ -59,6 +55,19 @@ public class StoreTechnicianController {
return jsonResult; return jsonResult;
} }
@ApiOperation(value = "根据店铺查询美甲师")
@GetMapping("/customer/user/queryStoreUser")
public JsonResult<List<StoreUser>> queryStoreUser(@RequestParam(required = false) Integer departmentId) {
StoreUser storeUser = new StoreUser();
if (departmentId != null) {
storeUser.setDepartmentId(departmentId);
}
List<StoreUser> lists = storeUserService.listUserForAllNotQuit(storeUser);
return JsonResult.success(lists);
}
@ApiOperation(value = "美甲师根据code获取token") @ApiOperation(value = "美甲师根据code获取token")
@GetMapping(value = "/technician/xcx/login_t") @GetMapping(value = "/technician/xcx/login_t")
public JsonResult<String> technicianLogin(@RequestParam String code) { public JsonResult<String> technicianLogin(@RequestParam String code) {
......
...@@ -3,123 +3,138 @@ ...@@ -3,123 +3,138 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" > "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.gogirl.infrastructure.mapper.product.serve.BaseServeMapper"> <mapper namespace="com.gogirl.infrastructure.mapper.product.serve.BaseServeMapper">
<resultMap id="ServerWithProduce" type="com.gogirl.domain.product.serve.BaseServe"> <!-- <resultMap id="ServerWithProduce" type="com.gogirl.domain.product.serve.BaseServe">-->
<result column="id" property="id"/> <!-- <result column="id" property="id"/>-->
<result column="name" property="name"/> <!-- <result column="name" property="name"/>-->
<result column="type" property="type"/> <!-- <result column="type" property="type"/>-->
<result column="type_id" property="typeId"/> <!-- <result column="type_id" property="typeId"/>-->
<result column="label" property="label"/> <!-- <result column="label" property="label"/>-->
<result column="shop_sort" property="shopSort"/> <!-- <result column="shop_sort" property="shopSort"/>-->
<result column="price" property="price"/> <!-- <result column="price" property="price"/>-->
<result column="picture_path" property="picturePath"/> <!-- <result column="picture_path" property="picturePath"/>-->
<result column="status" property="status"/> <!-- <result column="status" property="status"/>-->
<result column="remark" property="remark"/> <!-- <result column="remark" property="remark"/>-->
<result column="details" property="details"/> <!-- <result column="details" property="details"/>-->
<result column="service_duration" property="serviceDuration"/> <!-- <result column="service_duration" property="serviceDuration"/>-->
<result column="has_index_show" property="hasIndexShow"/> <!-- <result column="has_index_show" property="hasIndexShow"/>-->
<result column="index_sort" property="indexSort"/> <!-- <result column="index_sort" property="indexSort"/>-->
<result column="praise_sum" property="praiseSum"/> <!-- <result column="praise_sum" property="praiseSum"/>-->
<result column="brief_introduction" property="briefIntroduction"/> <!-- <result column="brief_introduction" property="briefIntroduction"/>-->
<result column="sch_type_id" property="schTypeId"/> <!-- <result column="sch_type_id" property="schTypeId"/>-->
<association property="produce" javaType="com.gogirl.domain.product.serve.BaseProduce"> <!-- <association property="produce" javaType="com.gogirl.domain.product.serve.BaseProduce">-->
<result column="produce_id" property="id"/> <!-- <result column="produce_id" property="id"/>-->
<result column="produce_name" property="name"/> <!-- <result column="produce_name" property="name"/>-->
<result column="produce_picture_path" property="picturePath"/> <!-- <result column="produce_picture_path" property="picturePath"/>-->
<result column="produce_type" property="type"/> <!-- <result column="produce_type" property="type"/>-->
<result column="produce_label" property="label"/> <!-- <result column="produce_label" property="label"/>-->
<result column="produce_shop_sort" property="shopSort"/> <!-- <result column="produce_shop_sort" property="shopSort"/>-->
<result column="reqduce_grade" property="reqGrade"/> <!-- <result column="reqduce_grade" property="reqGrade"/>-->
<result column="produce_status" property="status"/> <!-- <result column="produce_status" property="status"/>-->
<result column="produce_remark" property="remark"/> <!-- <result column="produce_remark" property="remark"/>-->
</association> <!-- </association>-->
<collection property="listProduce" ofType="com.gogirl.domain.product.serve.BaseProduce"> <!-- <collection property="listProduce" ofType="com.gogirl.domain.product.serve.BaseProduce">-->
<result column="pro_id" property="id"/> <!-- <result column="pro_id" property="id"/>-->
<result column="pro_name" property="name"/> <!-- <result column="pro_name" property="name"/>-->
<result column="pro_picture_path" property="picturePath"/> <!-- <result column="pro_picture_path" property="picturePath"/>-->
<result column="pro_type" property="type"/> <!-- <result column="pro_type" property="type"/>-->
<result column="pro_label" property="label"/> <!-- <result column="pro_label" property="label"/>-->
<result column="pro_shop_sort" property="shopSort"/> <!-- <result column="pro_shop_sort" property="shopSort"/>-->
<result column="req_grade" property="reqGrade"/> <!-- <result column="req_grade" property="reqGrade"/>-->
<result column="pro_status" property="status"/> <!-- <result column="pro_status" property="status"/>-->
<result column="pro_remark" property="remark"/> <!-- <result column="pro_remark" property="remark"/>-->
<result column="pro_praise_sum" property="praiseSum"/> <!-- <result column="pro_praise_sum" property="praiseSum"/>-->
<result column="pro_current_price" property="currentPrice"/> <!-- <result column="pro_current_price" property="currentPrice"/>-->
<result column="pro_bargain_price" property="bargainPrice"/> <!-- <result column="pro_bargain_price" property="bargainPrice"/>-->
<result column="pro_service_duration" property="serviceDuration"/> <!-- <result column="pro_service_duration" property="serviceDuration"/>-->
<result column="pro_brief_introduction" property="briefIntroduction"/> <!-- <result column="pro_brief_introduction" property="briefIntroduction"/>-->
<result column="pro_details" property="details"/> <!-- <result column="pro_details" property="details"/>-->
</collection> <!-- </collection>-->
<collection property="praiseRecord" ofType="com.gogirl.domain.product.serve.PraiseRecord"> <!-- <collection property="praiseRecord" ofType="com.gogirl.domain.product.serve.PraiseRecord">-->
<id column="praiseid" property="id" jdbcType="INTEGER"/> <!-- <id column="praiseid" property="id" jdbcType="INTEGER"/>-->
<result column="praisecustomer_id" property="customerId" jdbcType="INTEGER"/> <!-- <result column="praisecustomer_id" property="customerId" jdbcType="INTEGER"/>-->
<result column="praiseserve_id" property="serveId" jdbcType="INTEGER"/> <!-- <result column="praiseserve_id" property="serveId" jdbcType="INTEGER"/>-->
<result column="praisetime" property="time" jdbcType="TIMESTAMP"/> <!-- <result column="praisetime" property="time" jdbcType="TIMESTAMP"/>-->
</collection> <!-- </collection>-->
<collection property="listLabel" ofType="com.gogirl.domain.product.serve.Label"> <!-- <collection property="listLabel" ofType="com.gogirl.domain.product.serve.Label">-->
<result column="lid" property="id" jdbcType="INTEGER"/> <!-- <result column="lid" property="id" jdbcType="INTEGER"/>-->
<result column="lname" property="name" jdbcType="VARCHAR"/> <!-- <result column="lname" property="name" jdbcType="VARCHAR"/>-->
<result column="lpic_url" property="picUrl" jdbcType="VARCHAR"/> <!-- <result column="lpic_url" property="picUrl" jdbcType="VARCHAR"/>-->
</collection> <!-- </collection>-->
</resultMap> <!-- </resultMap>-->
<resultMap id="ServerWithProduceForPage" type="com.gogirl.domain.product.serve.BaseServe"> <!-- <resultMap id="ServerWithProduceForPage" type="com.gogirl.domain.product.serve.BaseServe">-->
<result column="id" property="id"/> <!-- <result column="id" property="id"/>-->
<result column="name" property="name"/> <!-- <result column="name" property="name"/>-->
<result column="type" property="type"/> <!-- <result column="type" property="type"/>-->
<result column="type_id" property="typeId"/> <!-- <result column="type_id" property="typeId"/>-->
<result column="label" property="label"/> <!-- <result column="label" property="label"/>-->
<result column="shop_sort" property="shopSort"/> <!-- <result column="shop_sort" property="shopSort"/>-->
<result column="price" property="price"/> <!-- <result column="price" property="price"/>-->
<result column="picture_path" property="picturePath"/> <!-- <result column="picture_path" property="picturePath"/>-->
<result column="status" property="status"/> <!-- <result column="status" property="status"/>-->
<result column="remark" property="remark"/> <!-- <result column="remark" property="remark"/>-->
<result column="details" property="details"/> <!-- <result column="details" property="details"/>-->
<result column="service_duration" property="serviceDuration"/> <!-- <result column="service_duration" property="serviceDuration"/>-->
<result column="has_index_show" property="hasIndexShow"/> <!-- <result column="has_index_show" property="hasIndexShow"/>-->
<result column="index_sort" property="indexSort"/> <!-- <result column="index_sort" property="indexSort"/>-->
<result column="praise_sum" property="praiseSum"/> <!-- <result column="praise_sum" property="praiseSum"/>-->
<result column="brief_introduction" property="briefIntroduction"/> <!-- <result column="brief_introduction" property="briefIntroduction"/>-->
<result column="sch_type_id" property="schTypeId"/> <!-- <result column="sch_type_id" property="schTypeId"/>-->
<association property="produce" javaType="com.gogirl.domain.product.serve.BaseProduce"> <!-- <association property="produce" javaType="com.gogirl.domain.product.serve.BaseProduce">-->
<result column="produce_id" property="id"/> <!-- <result column="produce_id" property="id"/>-->
<result column="produce_name" property="name"/> <!-- <result column="produce_name" property="name"/>-->
<result column="produce_picture_path" property="picturePath"/> <!-- <result column="produce_picture_path" property="picturePath"/>-->
<result column="produce_type" property="type"/> <!-- <result column="produce_type" property="type"/>-->
<result column="produce_label" property="label"/> <!-- <result column="produce_label" property="label"/>-->
<result column="produce_shop_sort" property="shopSort"/> <!-- <result column="produce_shop_sort" property="shopSort"/>-->
<result column="reqduce_grade" property="reqGrade"/> <!-- <result column="reqduce_grade" property="reqGrade"/>-->
<result column="produce_status" property="status"/> <!-- <result column="produce_status" property="status"/>-->
<result column="produce_remark" property="remark"/> <!-- <result column="produce_remark" property="remark"/>-->
</association> <!-- </association>-->
<collection property="listProduce" ofType="com.gogirl.domain.product.serve.BaseProduce" column="id" <!-- <collection property="listProduce" ofType="com.gogirl.domain.product.serve.BaseProduce" column="id"-->
select="listProduceByServeId"> <!-- select="listProduceByServeId">-->
</collection> <!-- </collection>-->
<collection property="praiseRecord" ofType="com.gogirl.domain.product.serve.PraiseRecord"> <!-- <collection property="praiseRecord" ofType="com.gogirl.domain.product.serve.PraiseRecord">-->
<id column="praiseid" property="id" jdbcType="INTEGER"/> <!-- <id column="praiseid" property="id" jdbcType="INTEGER"/>-->
<result column="praisecustomer_id" property="customerId" jdbcType="INTEGER"/> <!-- <result column="praisecustomer_id" property="customerId" jdbcType="INTEGER"/>-->
<result column="praiseserve_id" property="serveId" jdbcType="INTEGER"/> <!-- <result column="praiseserve_id" property="serveId" jdbcType="INTEGER"/>-->
<result column="praisetime" property="time" jdbcType="TIMESTAMP"/> <!-- <result column="praisetime" property="time" jdbcType="TIMESTAMP"/>-->
</collection> <!-- </collection>-->
</resultMap> <!-- </resultMap>-->
<resultMap id="produceResultMap" type="com.gogirl.domain.product.serve.BaseProduce"> <!-- <resultMap id="produceResultMap" type="com.gogirl.domain.product.serve.BaseProduce">-->
<result column="pro_id" property="id"/> <!-- <result column="pro_id" property="id"/>-->
<result column="pro_name" property="name"/> <!-- <result column="pro_name" property="name"/>-->
<result column="pro_picture_path" property="picturePath"/> <!-- <result column="pro_picture_path" property="picturePath"/>-->
<result column="pro_type" property="type"/> <!-- <result column="pro_type" property="type"/>-->
<result column="pro_label" property="label"/> <!-- <result column="pro_label" property="label"/>-->
<result column="pro_shop_sort" property="shopSort"/> <!-- <result column="pro_shop_sort" property="shopSort"/>-->
<result column="req_grade" property="reqGrade"/> <!-- <result column="req_grade" property="reqGrade"/>-->
<result column="pro_status" property="status"/> <!-- <result column="pro_status" property="status"/>-->
<result column="pro_remark" property="remark"/> <!-- <result column="pro_remark" property="remark"/>-->
</resultMap> <!-- </resultMap>-->
<sql id="baseSql"> <sql id="baseSql">
id, name,type,type_id, label, shop_sort, price, picture_path, status, remark, details, service_duration,brief_introduction,sch_type_id id, name,type,type_id, label, shop_sort, price, picture_path, status, remark, details, service_duration,brief_introduction,sch_type_id
</sql> </sql>
<sql id="serveSql"> <sql id="serveSql">
ser.id, ser.name,ser.type,ser.type_id, ser.label, ser.shop_sort, ser.price, ser.picture_path, ser.status, ser.remark, ser.details, ser.id,
ser.service_duration, ser.has_index_show, ser.index_sort, ser.praise_sum,ser.brief_introduction,ser.sch_type_id ser.name,
ser.type,
ser.type_id,
ser.label,
ser.shop_sort,
ser.price,
ser.picture_path,
ser.status,
ser.remark,
ser.details,
ser.service_duration,
ser.has_index_show,
ser.index_sort,
ser.praise_sum,
ser.brief_introduction,
ser.sch_type_id
</sql> </sql>
<sql id="praiseSql"> <sql id="praiseSql">
praise.id praiseid,praise.customer_id praisecustomer_id,praise.serve_id praiseserve_id,praise.time praisetime praise.id praiseid,praise.customer_id praisecustomer_id,praise.serve_id praiseserve_id,praise.time praisetime
...@@ -144,18 +159,7 @@ ...@@ -144,18 +159,7 @@
</sql> </sql>
<select id="getAggregate" resultMap="ServerWithProduce">
select
<include refid="serveSql"/>,
<include refid="proSql"/>,
<include refid="labelSql"/>
from base_serve ser
left join base_produce pro on pro.service_id = ser.id
left join label_relation lsr on ser.id = lsr.main_id and lsr.type=1
left join label l on l.id = lsr.label_id
where
ser.id = #{id}
</select>
<select id="listServeForPage" resultType="com.gogirl.domain.product.serve.BaseServe"> <select id="listServeForPage" resultType="com.gogirl.domain.product.serve.BaseServe">
...@@ -211,4 +215,5 @@ ...@@ -211,4 +215,5 @@
order by ser.purchase_show_index desc order by ser.purchase_show_index desc
</select> </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