zhangjinli 3 years ago
parent baff507daf
commit 6d00ad2b00

@ -314,8 +314,8 @@ public class TaskController {
@Operation(summary = "线索搜集列表") @Operation(summary = "线索搜集列表")
@PostMapping("/customerNoteList") @PostMapping("/customerNoteList")
public Result customerNote(@Validated @RequestBody JSONObject 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))); return Result.success(customerActionNoteService.pageList(MybatisPlusUtil.SetPage(obj), new JwtUtil().parseOpenid(token)));
} }
} }

@ -9,13 +9,18 @@ import java.util.Map;
/** /**
* <p> * <p>
* Mapper * Mapper
* </p> * </p>
* *
* @author zh * @author zh
* @since 2022-05-30 * @since 2022-05-30
*/ */
public interface CustomerActionNoteMapper extends BaseMapper<CustomerActionNote> { 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") @Select("<script> " +
IPage<Map> pageList(IPage page); "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 * @since 2022-05-30
*/ */
public interface ICustomerActionNoteService extends IService<CustomerActionNote> { 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 { public class CustomerActionNoteServiceImpl extends ServiceImpl<CustomerActionNoteMapper, CustomerActionNote> implements ICustomerActionNoteService {
@Autowired @Autowired
private CustomerActionNoteMapper customerActionNoteMapper; private CustomerActionNoteMapper customerActionNoteMapper;
public IPage<Map> pageList(IPage page){ public IPage<Map> pageList(IPage page,String openid){
return customerActionNoteMapper.pageList(page); return customerActionNoteMapper.pageList(page,openid);
} }
} }

@ -47,6 +47,20 @@ public class JwtUtil {
return null; 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 * token

Loading…
Cancel
Save