zhangjinli 3 years ago
parent baff507daf
commit 6d00ad2b00

@ -314,8 +314,8 @@ public class TaskController {
@Operation(summary = "线索搜集列表")
@PostMapping("/customerNoteList")
public Result customerNote(@Validated @RequestBody JSONObject obj) {
return Result.success(customerActionNoteService.pageList(MybatisPlusUtil.SetPage(obj)));
public Result customerNote(@Validated @RequestBody JSONObject obj, @RequestHeader(value = "token",required = false) @Parameter(name = "登录token") String token) {
return Result.success(customerActionNoteService.pageList(MybatisPlusUtil.SetPage(obj), new JwtUtil().parseOpenid(token)));
}
}

@ -16,6 +16,11 @@ import java.util.Map;
* @since 2022-05-30
*/
public interface CustomerActionNoteMapper extends BaseMapper<CustomerActionNote> {
@Select("select t1.*,t2.name as provideName,t3.name as brandName from customerActionNote as t1 ,user as t2,brand as t3 WHERE t1.provideId = t2.id and t1.brandId = t3.id")
IPage<Map> pageList(IPage page);
@Select("<script> " +
"select t1.*,t2.name as provideName,t3.name as brandName\n" +
" from customerActionNote as t1 left JOIN brand AS t3 on t1.brandId = t3.id,\n" +
"user as t2 WHERE t1.provideId = t2.id"+
"<if test='openid!=null'>and t2.openid =#{openid} </if>"+
"</script>")
IPage<Map> pageList(IPage page,String openid);
}

@ -15,5 +15,5 @@ import java.util.Map;
* @since 2022-05-30
*/
public interface ICustomerActionNoteService extends IService<CustomerActionNote> {
IPage<Map> pageList(IPage page);
IPage<Map> pageList(IPage page,String openid);
}

@ -22,7 +22,7 @@ import java.util.Map;
public class CustomerActionNoteServiceImpl extends ServiceImpl<CustomerActionNoteMapper, CustomerActionNote> implements ICustomerActionNoteService {
@Autowired
private CustomerActionNoteMapper customerActionNoteMapper;
public IPage<Map> pageList(IPage page){
return customerActionNoteMapper.pageList(page);
public IPage<Map> pageList(IPage page,String openid){
return customerActionNoteMapper.pageList(page,openid);
}
}

@ -47,6 +47,20 @@ public class JwtUtil {
return null;
}
}
/**
* JWT openid
*
* @param jwt
* @return
*/
public String parseOpenid(String jwt) {
try {
return Jwts.parser().setSigningKey(secret).parseClaimsJws(jwt).getBody().getId();
}catch (Exception e){
return null;
}
}
/**
* token

Loading…
Cancel
Save