修复没有头像不能登录的问题

This commit is contained in:
huangdeliang 2021-08-05 10:36:30 +08:00
parent 875473b668
commit af814fb1e1

View File

@ -444,7 +444,9 @@ public class WechatAppletController extends BaseController {
} }
// 更新时间超过21天重新登录获取最新信息 // 更新时间超过21天重新登录获取最新信息
if (StringUtils.isEmpty(curWxUserInfo.getAvatarUrl()) || ChronoUnit.DAYS.between(DateUtils.dateToLocalDate(curWxUserInfo.getUpdateTime()), LocalDate.now()) >= 21) { if (
// StringUtils.isEmpty(curWxUserInfo.getAvatarUrl()) ||
ChronoUnit.DAYS.between(DateUtils.dateToLocalDate(curWxUserInfo.getUpdateTime()), LocalDate.now()) >= 21) {
return AjaxResult.error(5001, "信息缺失或者过期需要重新登录"); return AjaxResult.error(5001, "信息缺失或者过期需要重新登录");
} }
@ -736,7 +738,7 @@ public class WechatAppletController extends BaseController {
* *
*/ */
@GetMapping("/getCustomerActivity") @GetMapping("/getCustomerActivity")
public TableDataInfo getCustomerActivity(@RequestParam String openid){ public TableDataInfo getCustomerActivity(@RequestParam String openid) {
startPage(); startPage();
return getDataTable(sysWxUserLogService.getCommunityPunchByOpenid(openid)); return getDataTable(sysWxUserLogService.getCommunityPunchByOpenid(openid));
} }
@ -755,7 +757,7 @@ public class WechatAppletController extends BaseController {
rows = sysPunchThumbsupService.insertSysPunchThumbsup(sysPunchThumbsup); rows = sysPunchThumbsupService.insertSysPunchThumbsup(sysPunchThumbsup);
if (rows > 0) { if (rows > 0) {
//发送点赞消息 //发送点赞消息
SysWxUserLog sysWxUserLog = sysWxUserLogService.selectSysWxUserLogById(sysPunchThumbsup.getPunchId()+""); SysWxUserLog sysWxUserLog = sysWxUserLogService.selectSysWxUserLogById(sysPunchThumbsup.getPunchId() + "");
sysMessageNoticeService.sendpunchDynamicThumbsUpMessage(sysWxUserLog, sysPunchThumbsup.getCusOpenid()); sysMessageNoticeService.sendpunchDynamicThumbsUpMessage(sysWxUserLog, sysPunchThumbsup.getCusOpenid());
Map<String, Object> resultData = new HashMap<>(); Map<String, Object> resultData = new HashMap<>();
@ -911,36 +913,32 @@ public class WechatAppletController extends BaseController {
/** /**
* 查询消息列表 * 查询消息列表
*
* @param cusId 客户ID * @param cusId 客户ID
* @param messageType 0 查询全部 1 查询打卡点评消息 2 打卡动态点赞消息 3 服务消息食谱更新执行反馈消息 * @param messageType 0 查询全部 1 查询打卡点评消息 2 打卡动态点赞消息 3 服务消息食谱更新执行反馈消息
* @return * @return
*/ */
@GetMapping("/getMessageNoticeData") @GetMapping("/getMessageNoticeData")
public AjaxResult getMessageNoticeList(@RequestParam("cusId")String cusId, @RequestParam(value = "messageType", required = false, defaultValue = "0")Integer messageType) { public AjaxResult getMessageNoticeList(@RequestParam("cusId") String cusId, @RequestParam(value = "messageType", required = false, defaultValue = "0") Integer messageType) {
cusId = StringUtils.isNotEmpty(cusId) ? AesUtils.decrypt(cusId) : "0"; cusId = StringUtils.isNotEmpty(cusId) ? AesUtils.decrypt(cusId) : "0";
startPage();
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
// List<Map<String, Object>> list = new ArrayList<>();
//查询打卡消息 //查询打卡消息
if(messageType.intValue() == 0 || messageType.intValue() == 1){ if (messageType.intValue() == 0 || messageType.intValue() == 1) {
startPage(); result = sysMessageNoticeService.getPunchCommentMessageByCusId(Long.parseLong(cusId));
Map<String,Object> punchResult = sysMessageNoticeService.getPunchCommentMessageByCusId(Long.parseLong(cusId)); // list = (List<Map<String, Object>>) result.get("data");
List<Map<String,Object>> list = (List<Map<String,Object>>)punchResult.get("data");
punchResult.put("data",getDataTable(list));
result.put("punchMessageData", punchResult);
} }
if(messageType.intValue() == 0 || messageType.intValue() == 2){ if (messageType.intValue() == 0 || messageType.intValue() == 2) {
startPage(); result = sysMessageNoticeService.getPunchDynamicThumbsUpMessage(Long.parseLong(cusId));
Map<String,Object> thumbsUpResult = sysMessageNoticeService.getPunchDynamicThumbsUpMessage(Long.parseLong(cusId)); // list = (List<Map<String, Object>>) result.get("data");
List<Map<String,Object>> list = (List<Map<String,Object>>)thumbsUpResult.get("data");
thumbsUpResult.put("data",getDataTable(list));
result.put("thumbsUpMessageData", thumbsUpResult);
} }
if(messageType.intValue() == 0 || messageType.intValue() == 3){ if (messageType.intValue() == 0 || messageType.intValue() == 3) {
startPage(); result = sysMessageNoticeService.getServiceMessage(Long.parseLong(cusId));
Map<String,Object> serviceResult = sysMessageNoticeService.getServiceMessage(Long.parseLong(cusId)); // list = (List<Map<String, Object>>) result.get("data");
List<Map<String,Object>> list = (List<Map<String,Object>>)serviceResult.get("data");
serviceResult.put("data",getDataTable(list));
result.put("serviceMessageData", serviceResult);
} }
// TableDataInfo tableDataInfo = getDataTable(list);
// result.put("total", tableDataInfo.getTotal());
return AjaxResult.success(result); return AjaxResult.success(result);
} }
} }