| | |
| | | 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; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.net.URLEncoder; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private NoticesJoinMapper noticesJoinMapper; |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | @Autowired |
| | | private MemberMapper memberMapper; |
| | | |
| | | @Override |
| | |
| | | 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); |
| | |
| | | } |
| | | curPage++; |
| | | } |
| | | |
| | | |
| | | if(allHkList!=null && allHkList.size()>0){ |
| | | String gotoUrl = systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.HK_WEBSITE_DOMAIN_URL).getCode(); |
| | | List<Notices> list = new ArrayList<>(); |
| | | for(GetTodoListResponse data :allHkList){ |
| | | Member u = getFromUserList(data.getUserId(),userList); |
| | |
| | | } |
| | | userIds.add(u.getId()); |
| | | JSONObject param = new JSONObject(); |
| | | |
| | | param.put("componentId","dfe"); |
| | | param.put("msgType","tlnc"); |
| | | 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())); |
| | |
| | | notices.setParam3(data.getMsgCreateTime()); |
| | | notices.setParam5(JSONObject.toJSONString(param)); |
| | | notices.setType(Constants.noticesObjectType.hknotice); |
| | | // notices.setRemark(gotoUrl+"dps/web/wxAuth/loginV2?oaId=atwl&redirectId=index"); |
| | | //https://atwl.ahzyssl.com/dps/web/wxAuth/loginV2?oaId=atwl&redirectUrl=encode(url) |
| | | String domainUrl = gotoUrl + HKConstants.InterfacePath.wxAuthUrl[0]; |
| | | notices.setRemark(domainUrl+ URLEncoder.encode("/"+StringUtils.defaultString(data.getSegmentId(),"") |
| | | +StringUtils.defaultString(data.getH5Url(),""),"utf-8")); |
| | | list.add(notices); |
| | | } |
| | | if(list.size()>0){ |
| | | 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 { |