标签:string logs line and color mobile code 会员 www
<!-- 8.待支付订单(订单状态为已提交)隔天 中午12点发条崔单短信 --> <bean id="jobtask8" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <!-- 调用的类 --> <property name="targetObject"> <ref bean="taskServiceByTcMsg" /> </property> <!-- 调用类中的方法 --> <property name="targetMethod"> <value>selectUnTcPaidMobiles</value> </property> <!-- 是否允许任务并发执行。当值为false时,表示必须等到前一个线程处理完毕后才再启一个新的线程 --> <property name="concurrent" value="false" /> </bean>
/** *处方药催单短信定时任务 **/ public void selectUnTcPaidMobiles(){ try { // ServiceMessage<List<String>> result=ecTcMessageService.selectUnTcPaidMobiles(); // if(result.getStatus().equals(MsgStatus.NORMAL)){ // List<String> mobileList=result.getResult(); // if(mobileList!=null && mobileList.size()>0){ // for(String mobile1:mobileList){ // long time=new Date().getTime(); // String check=MD5.getMD5(time+"www.j1.com"); // String mobile=mobile1; // String msg="亲爱的会员,您刚拍下的商品库存告急,即将售完,请抓紧时间,赶紧去支付吧。错过就没有这个优惠了"; // String param="t="+time+"&mobile="+mobile+"&msg="+msg+"&check="+check; // String res=HttpSenderUtil.sendPost("http://adm.j1.com/ec-dec/page/sms/sendSmsForEach/notice",param); // System.out.println(res); // } // } // } ServiceMessage<List<Map>> result=ecTcMessageService.selectUnTcPaidMobilesNew(); if(result.getStatus().equals(MsgStatus.NORMAL)){ List<Map> mobileList=result.getResult(); if(mobileList!=null && mobileList.size()>0){ for(Map mobile1:mobileList){ long time=new Date().getTime(); String check=MD5.getMD5(time+"www.j1.com"); String orderId=mobile1.get("ORDERID").toString(); String mobile=mobile1.get("MOBILE").toString(); String msg="您好!您的订单"+orderId+"请尽快付款,下单后36小时不支付将自动取消订单,谢谢配合!如您已支付,请忽略本短信"; String param="t="+time+"&mobile="+mobile+"&msg="+msg+"&check="+check; String res=HttpSenderUtil.sendPost("http://adm.j1.com/ec-dec/page/sms/sendSmsForEach/notice",param); System.out.println(res); } } } } catch (Exception e) { logger.error("TaskServiceByTcMsg.selectUnTcPaidMobiles:"+e.getMessage()); } }
@Override public ServiceMessage<List<Map>> selectUnTcPaidMobilesNew() { try { List<Map> mobileMapList=ecTcMessageMapper.selectUnTcPaidMobilesNew(); List<Map> mobileList=new ArrayList<Map>(); if(mobileMapList!=null && mobileMapList.size()>0){ for(Map map:mobileMapList){ String mobile=(String) map.get("MOBILE"); boolean flag = Pattern.compile("[0-9]*").matcher(mobile).matches(); if(flag && mobile.length()==11){ mobileList.add(map); } } } return super.returnCorrectResult("调用成功!", mobileList); } catch (Exception e) { return super.returnException(e); } }
<!-- 处方药催单SQL LYD --> <select id="selectUnTcPaidMobilesNew" parameterType="map" resultType="java.util.HashMap"> select m.mobile as mobile,o.order_id as orderid from order_info o,member m where o.member_id=m.member_id and m.mobile is not null and o.payment_mode = ‘KDFH‘ and o.is_paid != ‘Y‘ and o.is_tc = ‘Y‘ and o.order_state != (select code_id from sys_code where code_type_no = ‘order_state‘ and code_no = ‘cancel‘) and o.is_delete = ‘N‘ and round(to_number(sysdate -to_date(o.commit_time, ‘YYYY-MM-DD hh24:mi:ss‘)) * 24) >= 12 and round(to_number(sysdate -to_date(o.commit_time, ‘YYYY-MM-DD hh24:mi:ss‘)) * 24) <36 </select>
taskServiceByTcMsg.syncTcMessage.cronTrigger=0 40 16 * * ?
taskServiceByTcMsg.selectUnTcPaidMobiles.cronTrigger=0 0 17 * * ?(隔天中午十二点执行)
标签:string logs line and color mobile code 会员 www
原文地址:http://www.cnblogs.com/wangchuanfu/p/7699610.html