| 
 | 
 
定时任务发送邮件显示 认证失败的用户名或者密码,应该怎么解决? 
 
 
public void execute(JobExecutionContext arg0) throws JobExecutionException { 
                run(); 
        } 
 
        public void run() { 
                List<LfzMaterialsAlertEntity> listAlert = getAlertList(); 
                for (LfzMaterialsAlertEntity alertEntity : listAlert) { 
                        if (alertEntity.getAlertStatus() != null && alertEntity.getAlertStatus().equals(AlertStaus.ON)) { 
                                LfzFMaterialsEntity materials = getMaterialsList(alertEntity.getMerchandiseNo(), 
                                                alertEntity.getCompanyId()); 
                                if (materials != null) { 
                                        double productSum = materials.getProductSum(); 
                                        double min = alertEntity.getMaterialsMin(); 
                                        if (productSum <= min) { 
                                                sendMessage(materials); 
                                        } 
                                } 
                        } 
                } 
        } 
 
        /** 
         * 发送消息 
         */ 
        public void sendMessage(LfzFMaterialsEntity materials) { 
                List<TSUser> list = getUserList(materials.getCompanyId()); 
                for (TSUser user : list) { 
                        if ( /*(user.getUserType().equals(RoleType.Master) || user.getUserType().equals(RoleType.WarehouseMng))&&*/ user.getDepartid().equals(materials.getCompanyId()) 
                                         ) { 
                                Map<String, Object> map = new HashMap<String, Object>(); 
                                map.put("id", materials.getId()); 
                                TuiSongMsgUtil.sendMessage(materials.getProduct(), "2", "KCTX", map, "516281013@qq.com"); 
                                tSSmsService.send(); 
                                user = null; 
                        } 
                } 
        } 
         
 
 |   
 
 
 
 |