消息提醒
This commit is contained in:
parent
2bec58dbb5
commit
b3677412bc
@ -0,0 +1,53 @@
|
||||
package com.tenwa.comm.message.controller;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import jbo.app.tenwa.customer.CUSTOMER_ACCOUNT;
|
||||
import jbo.com.tenwa.lease.comm.LB_INSURANCE_INFO;
|
||||
import jbo.sys.CODE_LIBRARY;
|
||||
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
import com.amarsoft.are.jbo.BizObjectManager;
|
||||
import com.amarsoft.are.jbo.JBOFactory;
|
||||
import com.tenwa.officetempalte.util.FileOperatorUtil;
|
||||
|
||||
public class BankCardChangeReminderMessage extends BaseBussinessMessage{
|
||||
|
||||
@Override
|
||||
public void loadMessageInfo()throws Exception{
|
||||
String reminderDays = this.messageParam.get("reminderdays")==null?"0":this.messageParam.get("reminderdays");
|
||||
|
||||
Date currentTime = new Date();
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(currentTime);
|
||||
calendar.add(Calendar.DATE, Integer.parseInt(reminderDays));
|
||||
Date reminderTime = calendar.getTime();
|
||||
String reminderDate = format.format(reminderTime);
|
||||
|
||||
format = new SimpleDateFormat("yyyy/MM/dd");
|
||||
String queryDate = format.format(reminderTime);
|
||||
|
||||
Map<String,Object>cparam=new HashMap<String,Object>();
|
||||
cparam.put("date",reminderDate);
|
||||
Map<String,String>message=new HashMap<String,String>();
|
||||
message.put("MessageTitle", FileOperatorUtil.getFileNameByFormual(this.messageConfig.getAttribute("message_title").getString(),cparam));
|
||||
message.put("MessageContent", "");
|
||||
message.put("Cparam", "ID="+this.messageId+"&QueryDate="+queryDate);
|
||||
BizObjectManager liiManager = JBOFactory.getBizObjectManager(CUSTOMER_ACCOUNT.CLASS_NAME);
|
||||
List<BizObject> liis = liiManager.createQuery("UPDATETIME like :cardupdatetime and sign_status='N' ").setParameter("cardupdatetime",queryDate+"%").getResultList(false);
|
||||
if(liis!=null && liis.size()>0){
|
||||
Map<String,String>userIds=this.getMessageUsers();
|
||||
for(String key:userIds.keySet()){
|
||||
message.put("UserId", key);
|
||||
this.saveBaseMessage(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user