Commit 68eb68c5 by liyanlin

fix

parent 1b78f2dc
......@@ -32,5 +32,5 @@ public interface StoreTechnicianService extends IService<StoreTechnician> {
StoreTechnician getTechnician();
List<StoreTechnician> list(StoreTechnician storeTechnician);
List<StoreTechnician> list(StoreTechnician storeTechnician, Integer brandId);
}
......@@ -46,7 +46,7 @@ public class StoreTechnicianServiceImpl extends ServiceImpl<StoreTechnicianMappe
@Override
public String login(String code, Integer brandId) {
Code2SessionResult responseResult = wechatService.getTechnicianOpenidByCode(code,brandId);
Code2SessionResult responseResult = wechatService.getTechnicianOpenidByCode(code, brandId);
if (responseResult.getErrcode() != null) {
throw new RRException(responseResult.getErrmsg());
......@@ -56,7 +56,7 @@ public class StoreTechnicianServiceImpl extends ServiceImpl<StoreTechnicianMappe
//生成token
String token = new BigInteger((int) (Math.random() * 1000) + new SimpleDateFormat("ddHHmmss").format(new Date()), 10).toString(16);
StoreTechnician storeTechnician = this.getOne(new LambdaQueryWrapper<StoreTechnician>().eq(StoreTechnician::getOpenid, openid).eq(StoreTechnician::getBrandId,brandId));
StoreTechnician storeTechnician = this.getOne(new LambdaQueryWrapper<StoreTechnician>().eq(StoreTechnician::getOpenid, openid).eq(StoreTechnician::getBrandId, brandId));
if (storeTechnician == null) {
throw new RRException(ErrorCode.TC_2006);
......@@ -109,12 +109,13 @@ public class StoreTechnicianServiceImpl extends ServiceImpl<StoreTechnicianMappe
}
@Override
public List<StoreTechnician> list(StoreTechnician storeTechnician) {
public List<StoreTechnician> list(StoreTechnician storeTechnician, Integer brandId) {
LambdaQueryWrapper<StoreTechnician> wrapper = new LambdaQueryWrapper<>();
if (storeTechnician.getDepartmentId() != null) {
wrapper.eq(StoreTechnician::getDepartmentId, storeTechnician.getDepartmentId());
}
wrapper.eq(StoreTechnician::getIsAdmin, false);
wrapper.eq(StoreTechnician::getBrandId, brandId);
return this.list(wrapper);
}
}
......@@ -47,16 +47,18 @@ public class StoreTechnicianController {
@ApiOperation(value = "根据店铺查询美甲师")
@GetMapping("/customer/user/queryStoreTechnician")
public JsonResult<List<StoreTechnician>> queryStoreTechnician(StoreTechnician storeTechnician) {
public JsonResult<List<StoreTechnician>> queryStoreTechnician(StoreTechnician storeTechnician,
@RequestHeader("brandId") Integer brandId) {
List<StoreTechnician> storeTechnicianList = storeTechnicianService.list(storeTechnician);
List<StoreTechnician> storeTechnicianList = storeTechnicianService.list(storeTechnician, brandId);
return JsonResult.success(storeTechnicianList);
}
@ApiOperation(value = "根据店铺查询美甲师")
@GetMapping("/technician/user/queryStoreTechnician")
public JsonResult<List<StoreTechnician>> techQueryStoreTechnician(StoreTechnician storeTechnician) {
List<StoreTechnician> storeTechnicianList = storeTechnicianService.list(storeTechnician);
public JsonResult<List<StoreTechnician>> techQueryStoreTechnician(StoreTechnician storeTechnician,
@RequestHeader("brandId") Integer brandId) {
List<StoreTechnician> storeTechnicianList = storeTechnicianService.list(storeTechnician, brandId);
return JsonResult.success(storeTechnicianList);
}
......
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