|  |  | 
 |  |  | import com.alibaba.fastjson.JSONObject; | 
 |  |  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
 |  |  | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; | 
 |  |  | import com.doumee.biz.system.SystemDictDataBiz; | 
 |  |  | import com.doumee.core.constants.ResponseStatus; | 
 |  |  | import com.doumee.core.exception.BusinessException; | 
 |  |  | import com.doumee.core.haikang.model.HKConstants; | 
 |  |  | 
 |  |  | import com.doumee.core.haikang.model.param.respose.*; | 
 |  |  | import com.doumee.core.haikang.service.HKService; | 
 |  |  | import com.doumee.core.utils.Constants; | 
 |  |  | import com.doumee.core.utils.DESUtil; | 
 |  |  | import com.doumee.core.utils.DateUtil; | 
 |  |  | import com.doumee.core.utils.ImageBase64Util; | 
 |  |  | import com.doumee.core.wx.wxPlat.WxPlatNotice; | 
 |  |  | import com.doumee.dao.business.DeviceRoleMapper; | 
 |  |  | import com.doumee.dao.business.MemberMapper; | 
 |  |  | import com.doumee.dao.business.RetentionMapper; | 
 |  |  | import com.doumee.dao.business.join.VisitsJoinMapper; | 
 |  |  | import com.doumee.dao.business.model.DeviceRole; | 
 |  |  | import com.doumee.dao.business.dao.MemberMapper; | 
 |  |  | import com.doumee.dao.business.model.Member; | 
 |  |  | import com.doumee.dao.business.model.Retention; | 
 |  |  | import com.doumee.dao.business.model.Visits; | 
 |  |  | import com.doumee.dao.system.SystemUserMapper; | 
 |  |  | import com.doumee.dao.system.join.NoticesJoinMapper; | 
 |  |  | import com.doumee.dao.system.model.Notices; | 
 |  |  | import com.doumee.dao.system.model.SystemUser; | 
 |  |  | import com.doumee.service.system.NoticesService; | 
 |  |  | import com.github.yulichang.wrapper.MPJLambdaWrapper; | 
 |  |  | import lombok.extern.slf4j.Slf4j; | 
 |  |  | import org.apache.commons.lang3.StringUtils; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | 
 |  |  |         try { | 
 |  |  |             List<String> users = new ArrayList<>(); | 
 |  |  |             users.add(username); | 
 |  |  |  | 
 |  |  |             List<Integer> userIds = new ArrayList<>(); | 
 |  |  |             List<Member > userList = memberMapper.selectList(new QueryWrapper<Member>().lambda() | 
 |  |  |                     .in(Member::getPhone,users) | 
 |  |  | 
 |  |  |             }else{ | 
 |  |  |                 throw  new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对不起,无效账号~"); | 
 |  |  |             } | 
 |  |  |             if(userIds.size()>0){ | 
 |  |  |                 //清空海康全部的代办数据 | 
 |  |  |                 noticesJoinMapper.delete(new UpdateWrapper<Notices>().lambda() | 
 |  |  |                         .eq(Notices::getType, Constants.noticesObjectType.hknotice) | 
 |  |  |                         .in(Notices::getUserId, userIds)); | 
 |  |  |             } | 
 |  |  |             Date date = new Date(); | 
 |  |  |             List<GetTodoListResponse> allHkList = new ArrayList<>(); | 
 |  |  |             boolean hasNext = true; | 
 |  |  | 
 |  |  |             while (hasNext){ | 
 |  |  |                 //分页遍历循环查询所有门禁设备数据 | 
 |  |  |                 GetTodoListRequest param = new GetTodoListRequest(); | 
 |  |  |                 param.setComId("dfe"); | 
 |  |  | //                param.setComId("dfe");//接全部的代办 | 
 |  |  |                 param.setUserId(username); | 
 |  |  |                 param.setStatus(1);//只查待处理的数据 | 
 |  |  |                 param.setPageNo(curPage); | 
 |  |  | 
 |  |  |                     param.put("componentMenuId", data.getMenuCode()); | 
 |  |  |                     JSONObject c = new JSONObject(); | 
 |  |  |                     c.put("method","dealTlncMsg"); | 
 |  |  |                     c.put("argument",JSONObject.toJSONString(data)); | 
 |  |  |                     c.put("argument", data); | 
 |  |  |                     param.put("callback",c); | 
 |  |  |                     Notices notices = new Notices(); | 
 |  |  |                     notices.setCreateDate(DateUtil.getISO8601DateByStr(data.getMsgCreateTimeIso())); | 
 |  |  | 
 |  |  |                     noticesJoinMapper.insert(list);//批量插入记录 | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |              if(userIds.size()>0){ | 
 |  |  |                  //清空海康全部的代办数据 | 
 |  |  |                  noticesJoinMapper.delete(new UpdateWrapper<Notices>().lambda() | 
 |  |  |                          .eq(Notices::getType, Constants.noticesObjectType.hknotice) | 
 |  |  |                          .in(Notices::getUserId, userIds)); | 
 |  |  |              } | 
 |  |  |  | 
 |  |  |         }catch (Exception e){ | 
 |  |  |             e.printStackTrace(); | 
 |  |  |         }finally { |