Explorar o código

用户信息稽核报警

wuzd %!s(int64=4) %!d(string=hai) anos
pai
achega
bcfd8949b7

+ 91 - 0
tnc-sms/src/main/java/org/jeecg/modules/smscheck/entity/SmsCheckCinfoResult.java

@@ -0,0 +1,91 @@
+package org.jeecg.modules.smscheck.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @description 客户信息稽核结果
+ * @author jeecg-boot
+ * @date 2022-06-22
+ * @version V1.0
+ */
+@Data
+@TableName("sms_check_cinfo_result")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="sms_check_cinfo_result对象", description="客户信息稽核结果")
+public class SmsCheckCinfoResult implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/** 主键 */
+    @TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键")
+    private String id;
+	/** 任务id */
+    @Excel(name = "任务id", width = 15)
+    @ApiModelProperty(value = "任务id")
+    private String taskId;
+	/** 客户编号 */
+    @Excel(name = "客户编号", width = 15)
+    @ApiModelProperty(value = "客户编号")
+    private String customerNo;
+	/** 用户编号 */
+    @Excel(name = "用户编号", width = 15)
+    @ApiModelProperty(value = "用户编号")
+    private String userNo;
+
+
+    /** 稽核字段(1:合同到期时间,2:码号证书到期时间,3:备案通知到期时间,4:增值业务许可证到期时间,5:营业执照到期时间) */
+    @Excel(name = "稽核字段(1:合同到期时间,2:码号证书到期时间,3:备案通知到期时间,4:增值业务许可证到期时间,5:营业执照到期时间)")
+    @ApiModelProperty(value = "稽核字段")
+    private Integer dateType;
+    /** 稽核字段值 */
+    @Excel(name = "稽核字段值")
+    @ApiModelProperty(value = "稽核字段值")
+    private String dateVal;
+	/** 合同到期状态 */
+    @Excel(name = "到期稽核状态(0:未稽核,1:正常,2:告警,3:空值)", width = 1)
+    @ApiModelProperty(value = "到期稽核状态")
+    private Integer dateState;
+
+    /** 最后稽核时间 */
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "最后稽核时间")
+    private Date checkTime;
+
+
+    /** 短信级别(0:不发送,1:客户经理,2:三级部门,2:二级部门) */
+    @Excel(name = "短信级别", width = 1)
+    @ApiModelProperty(value = "短信级别")
+    private Integer msgLevel;
+    /** 计划总发信数 */
+    @Excel(name = "计划总发信数", width = 4)
+    @ApiModelProperty(value = "计划总发信数")
+    private Integer msgTotal;
+    /** 发信间隔(天) */
+    @Excel(name = "发信间隔", width = 4)
+    @ApiModelProperty(value = "发信间隔")
+    private Integer msgInterval;
+    /** 短信已发送次数 */
+    @Excel(name = "短信已发送次数", width = 4)
+    @ApiModelProperty(value = "短信已发送次数")
+    private Integer msgNum;
+    /** 最后发短信时间 */
+    @Excel(name = "最后发短信时间")
+    @ApiModelProperty(value = "最后发短信时间")
+    private Date msgTime;
+}
+

+ 110 - 0
tnc-sms/src/main/java/org/jeecg/modules/smscheck/mapper/SmsCheckCinfoResultMapper.java

@@ -0,0 +1,110 @@
+package org.jeecg.modules.smscheck.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.ibatis.annotations.SelectProvider;
+import org.jeecg.modules.smscheck.entity.SmsCheckCinfoResult;
+import org.jeecg.modules.smscheck.entity.SmsCheckCustomerInfoLog;
+import org.jeecg.modules.smscheck.mapper.util.FiledUtil;
+
+import java.lang.reflect.Field;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @description 客户资料完善记录
+ * @author jeecg-boot
+ * @date 2022-07-01
+ * @version V1.0
+ */
+public interface SmsCheckCinfoResultMapper extends BaseMapper<SmsCheckCinfoResult> {
+
+
+    @SelectProvider(type = SqlProvider.class,method = "count_by_param_sql")
+    public int count_by_param(Map<String,String> param);
+
+    @SelectProvider(type = SqlProvider.class,method = "update_by_param_sql")
+    public String update_by_param(SmsCheckCinfoResult entity,Map<String,String> param);
+
+    class SqlProvider{
+        private final String table_name = "sms_check_cinfo_result";
+
+        public String count_by_param_sql(Map<String,String> param){
+            StringBuilder sb = new StringBuilder("SELECT count(1) FROM "+table_name+" ");
+            sb.append(get_where_sql(param));
+
+            return sb.toString();
+        }
+
+        public String update_by_param_sql(SmsCheckCinfoResult entity,Map<String,String> param) throws IllegalAccessException {
+            StringBuilder sb = new StringBuilder("UPDATE "+table_name);
+
+            boolean set_flag = false;
+            Field[] fields = entity.getClass().getDeclaredFields();
+            for(int i=0;i<fields.length;i++){
+                Field f = fields[i];
+                f.setAccessible(true);
+                String f_name = f.getName();
+                if("serialVersionUID".equalsIgnoreCase(f_name)){
+                    continue;
+                }
+                Object f_obj = f.get(entity);
+                String f_value = null;
+                if(f_obj!=null){
+                    f_value = f_obj.toString();
+                }
+                if(StringUtils.isNoneBlank(f_value)){
+                    if(set_flag){
+                        sb.append(" , ");
+                    }else{
+                        sb.append(" SET ");
+                        set_flag = true;
+                    }
+                    String f_name_x_x = FiledUtil.xX2x_x(f_name);
+                    sb.append(" "+f_name_x_x+" = #{entity."+f_name+"}");
+                }
+            }
+
+            String where_sql = get_where_sql(param,"param");
+            if(StringUtils.isNoneBlank(where_sql)){
+                sb.append(where_sql);
+                return sb.toString();
+            }else{
+                return null;
+            }
+        }
+
+
+
+        private String get_where_sql(Map<String,String> param){
+            return get_where_sql(param,null);
+        }
+        private String get_where_sql(Map<String,String> param,String val_pre){
+            StringBuilder sb = new StringBuilder();
+            boolean where_flag = false;
+            if(param!=null){
+                Set<String> p_keys = param.keySet();
+                for (String k:p_keys) {
+                    String v = param.get(k);
+
+                    if(StringUtils.isNoneBlank(v)){
+                        if(where_flag){
+                            sb.append(" AND ");
+                        }else{
+                            sb.append(" WHERE ");
+                            where_flag = true;
+                        }
+                        if(StringUtils.isNoneBlank(val_pre)){
+                            sb.append(" "+k+" = #{"+val_pre+"."+k+"}");
+                        }else{
+                            sb.append(" "+k+" = #{"+k+"}");
+                        }
+                    }
+                }
+            }
+            return sb.toString();
+        }
+    }
+}

+ 46 - 0
tnc-sms/src/main/java/org/jeecg/modules/smscheck/mapper/util/FiledUtil.java

@@ -0,0 +1,46 @@
+package org.jeecg.modules.smscheck.mapper.util;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class FiledUtil {
+    private final static Pattern compile_1 = Pattern.compile("[A-Z]");
+    private final static Pattern compile_2 = Pattern.compile("_[a-z]");
+
+    /**
+     * @author Howe
+     * @Description 将驼峰转为下划线
+     * @param str
+     * @return java.lang.String
+     * @Date   2022/4/22 13:11
+     * @since  1.0.0
+     */
+    public static String xX2x_x(String str) {
+        Matcher matcher = compile_1.matcher(str);
+        StringBuffer sb = new StringBuffer();
+        while(matcher.find()) {
+            matcher.appendReplacement(sb,  "_" + matcher.group(0).toLowerCase());
+        }
+        matcher.appendTail(sb);
+        return sb.toString();
+    }
+
+    /**
+     * @author Howe
+     * @Description 将下划线转为驼峰
+     * @param str
+     * @return java.lang.String
+     * @Date   2022/4/22 13:12
+     * @since  1.0.0
+     */
+    public static String x_x2xX(String str) {
+        str = str.toLowerCase();
+        Matcher matcher = compile_2.matcher(str);
+        StringBuffer sb = new StringBuffer();
+        while(matcher.find()) {
+            matcher.appendReplacement(sb,  matcher.group(0).toUpperCase().replace("_",""));
+        }
+        matcher.appendTail(sb);
+        return sb.toString();
+    }
+}

+ 5 - 0
tnc-sms/src/main/java/org/jeecg/modules/smscheck/mapper/xml/SmsCheckCinfoResultMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.smscheck.mapper.SmsCheckCinfoResultMapper">
+
+</mapper>

+ 20 - 0
tnc-sms/src/main/java/org/jeecg/modules/smscheck/service/ISmsCheckCinfoResultService.java

@@ -0,0 +1,20 @@
+package org.jeecg.modules.smscheck.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.smscheck.entity.SmsCheckCinfoResult;
+import org.jeecg.modules.smscheck.vo.SmsCheckTaskVo;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @description 客户信息稽核
+ * @author jeecg-boot
+ * @date 2022-06-22
+ * @version V1.0
+ */
+public interface ISmsCheckCinfoResultService extends IService<SmsCheckCinfoResult> {
+
+    public boolean saveOrUpdateBatch_bymap(Collection<SmsCheckCinfoResult> entityList);
+}

+ 61 - 0
tnc-sms/src/main/java/org/jeecg/modules/smscheck/service/impl/SmsCheckCinfoResultServiceImpl.java

@@ -0,0 +1,61 @@
+package org.jeecg.modules.smscheck.service.impl;
+
+import com.baomidou.mybatisplus.core.enums.SqlMethod;
+import com.baomidou.mybatisplus.core.metadata.TableInfo;
+import com.baomidou.mybatisplus.core.metadata.TableInfoHelper;
+import com.baomidou.mybatisplus.core.toolkit.Assert;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
+import org.apache.ibatis.binding.MapperMethod;
+import org.jeecg.modules.smscheck.entity.SmsCheckCinfoResult;
+import org.jeecg.modules.smscheck.mapper.SmsCheckCinfoResultMapper;
+import org.jeecg.modules.smscheck.service.ISmsCheckCinfoResultService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @description 客户资料完善记录
+ * @author jeecg-boot
+ * @date 2022-07-01
+ * @version V1.0
+ */
+@Service
+public class SmsCheckCinfoResultServiceImpl extends ServiceImpl<SmsCheckCinfoResultMapper, SmsCheckCinfoResult> implements ISmsCheckCinfoResultService {
+
+    @Autowired
+    private SmsCheckCinfoResultMapper checkCinfoResultMapper;
+
+    @Override
+    public boolean saveOrUpdateBatch_bymap(Collection<SmsCheckCinfoResult> entityList) {
+        int batchSize = 1000;
+
+        TableInfo tableInfo = TableInfoHelper.getTableInfo(this.entityClass);
+        Assert.notNull(tableInfo, "error: can not execute. because can not find cache of TableInfo for entity!", new Object[0]);
+        String keyProperty = tableInfo.getKeyProperty();
+        Assert.notEmpty(keyProperty, "error: can not execute. because can not find column for id from entity!", new Object[0]);
+        return SqlHelper.saveOrUpdateBatch(this.entityClass, this.mapperClass, this.log, entityList, batchSize, (sqlSession, entity) -> {
+            Map<String,String> param = new HashMap<>();
+            param.put("task_id",entity.getTaskId());
+            param.put("customer_no",entity.getCustomerNo());
+            param.put("user_no",entity.getUserNo());
+            param.put("date_type",entity.getDateType().toString());
+            int i = checkCinfoResultMapper.count_by_param(param);
+            return i==0;
+        }, (sqlSession, entity) -> {
+            Map<String,String> param = new HashMap<>();
+            param.put("task_id",entity.getTaskId());
+            param.put("customer_no",entity.getCustomerNo());
+            param.put("user_no",entity.getUserNo());
+            param.put("date_type",entity.getDateType().toString());
+            checkCinfoResultMapper.update_by_param(entity, param);
+        });
+    }
+
+}

+ 282 - 0
tnc-system/src/main/java/org/jeecg/modules/quartz/job/CustomerCheckJob.java

@@ -0,0 +1,282 @@
+
+package org.jeecg.modules.quartz.job;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.DateUtils;
+import org.jeecg.modules.smscheck.controller.SmsCheckCustomerDataController;
+import org.jeecg.modules.smscheck.entity.SmsCheckCinfoResult;
+import org.jeecg.modules.smscheck.entity.SmsCheckCustomerData;
+import org.jeecg.modules.smscheck.entity.SmsCheckCustomerInfo;
+import org.jeecg.modules.smscheck.entity.SmsCheckTask;
+import org.jeecg.modules.smscheck.service.ISmsCheckCinfoResultService;
+import org.jeecg.modules.smscheck.service.ISmsCheckCustomerDataService;
+import org.jeecg.modules.smscheck.service.ISmsCheckCustomerInfoService;
+import org.jeecg.modules.smscheck.service.ISmsCheckTaskService;
+import org.quartz.Job;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.text.ParseException;
+import java.util.*;
+
+/**
+ * 客户信息稽核任务
+ * 
+ * @Author Scott
+ */
+@Slf4j
+public class CustomerCheckJob implements Job {
+
+	/**
+	 * 若参数变量名修改 QuartzJobController中也需对应修改
+	 */
+	private String parameter;
+	private JSONObject parameterMap = new JSONObject();
+	private Date now;
+
+	@Autowired
+	private ISmsCheckTaskService smsCheckTaskService;
+	@Autowired
+	private ISmsCheckCustomerInfoService customerInfoService;
+	@Autowired
+	private ISmsCheckCinfoResultService smsCheckCinfoResultService;
+
+	public void setParameter(String parameter) {
+		this.parameter = parameter;
+
+		if(StringUtils.isNoneBlank(parameter)){
+			try{
+				parameterMap = JSONObject.parseObject(parameter);
+			}catch (Exception e){
+				log.warn("任务参数解析失败【"+parameter+"】,"+e.getMessage());
+			}
+		}
+
+		now = new Date();
+	}
+
+	@Override
+	public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
+		log.info(" Job Execution key:"+jobExecutionContext.getJobDetail().getKey());
+		log.info(" 时间:" + DateUtils.now());
+		log.info(" 参数:" + parameterMap);
+
+		// 告警检测字段
+		String[] params = {"contract","sms_number_certificate","record_notice","value_added_licence","business_licence"};
+		Object params_obj = parameterMap.get("params");
+		if(params_obj!=null){
+			params = params_obj.toString().split(",");
+		}
+
+		// 预警天数:0;到期当天预警,>0:提前预警,<0,延后预警
+		int warn_days = 0;
+		Object warn_days_obj = parameterMap.get("warn_days");
+		if(warn_days_obj!=null){
+			warn_days = Integer.valueOf(warn_days_obj.toString());
+		}
+
+		// 预警短信级别:0:不发送,1:客户经理,2:三级部门,2:二级部门
+		int msg_level = 0;
+		Object msg_level_obj = parameterMap.get("msg_level");
+		if(msg_level_obj!=null){
+			msg_level = Integer.valueOf(msg_level_obj.toString());
+		}
+
+		// 短信发送最高次数(0:不限制次数)
+		int msg_num = 0;
+		Object msg_num_obj = parameterMap.get("msg_num");
+		if(msg_num_obj!=null){
+			msg_num_obj = Integer.valueOf(msg_num_obj.toString());
+		}
+
+		// 短信发送间隔(天)
+		int msg_interval = 0;
+		Object msg_interval_obj = parameterMap.get("msg_interval");
+		if(msg_interval_obj!=null){
+			msg_interval_obj = Integer.valueOf(msg_interval_obj.toString());
+		}
+
+
+
+		LambdaQueryWrapper<SmsCheckTask> task_queryWrapper = new LambdaQueryWrapper<>();
+		task_queryWrapper.eq(SmsCheckTask::getTaskState,1);
+
+		// 查询数据总数
+		long task_num = smsCheckTaskService.count(task_queryWrapper);
+		log.info("客户信息稽核开始,共计【"+task_num+"】条任务");
+		// 任务信息 分页查询
+		int pageNo = 1,size = 50;
+		for(;((pageNo-1)*size)<=task_num;pageNo++){
+			Page<SmsCheckTask> page = new Page<>(pageNo, size);
+			Page<SmsCheckTask> task_page = smsCheckTaskService.page(page,task_queryWrapper);
+			List<SmsCheckTask> task_list = task_page.getRecords();
+
+			if(task_list!=null && task_list.size()>0){
+				for(int i=0;i<task_list.size();i++){
+					SmsCheckTask task = task_list.get(i);
+					String task_id = task.getId();
+
+					LambdaQueryWrapper<SmsCheckCustomerInfo> info_queryWrapper = new LambdaQueryWrapper<>();
+					info_queryWrapper.eq(SmsCheckCustomerInfo::getTaskId,task_id);
+
+					// 查询数据总数
+					long info_num = customerInfoService.count(info_queryWrapper);
+					log.info("任务【"+task_id+"】开始处理,共计【"+info_num+"】条用户服务信息");
+					// 分页查询客户信息并讲稽核结果入库
+					int info_pageNo = 1,info_size = 50;
+					for(;((info_pageNo-1)*info_size)<=info_num;info_pageNo++){
+						Page<SmsCheckCustomerInfo> page2 = new Page<>(info_pageNo, info_size);
+						Page<SmsCheckCustomerInfo> info_page = customerInfoService.page(page2, info_queryWrapper);
+						List<SmsCheckCustomerInfo> info_list = info_page.getRecords();
+
+						if(info_list!=null && info_list.size()>0){
+							List<SmsCheckCinfoResult> save_cinfoResult_list = new ArrayList<>();
+							for(int i2=0;i2<info_list.size();i2++){
+								// 客户信息稽核
+								SmsCheckCustomerInfo info = info_list.get(i2);
+								try {
+									List<SmsCheckCinfoResult> check_list = cinfo_check(info, task_id, params, warn_days, msg_level, msg_num, msg_interval);
+									save_cinfoResult_list.addAll(check_list);
+								} catch (ParseException e) {
+									e.printStackTrace();
+								}
+							}
+
+							smsCheckCinfoResultService.saveOrUpdateBatch_bymap(save_cinfoResult_list);
+						}
+					}
+					log.info("任务【"+task_id+"】处理完成");
+				}
+			}
+		}
+		log.info("客户信息稽核结束");
+
+	}
+
+	private List<SmsCheckCinfoResult> cinfo_check(SmsCheckCustomerInfo info,String task_id,String[] params,int warn_days,int msg_level,int msg_num,int msg_interval) throws ParseException {
+		List<SmsCheckCinfoResult> save_cinfoResult_list = new ArrayList<>();
+
+		String customerNo = info.getCustomerNo();
+		String userNo = info.getUserNo();
+
+		String msg_context = "";
+
+		// 对各字段进行稽核
+		for (int ip = 0; ip < params.length; ip++) {
+			String param = params[ip];
+
+			SmsCheckCinfoResult cinfoResult = new SmsCheckCinfoResult();
+			cinfoResult.setTaskId(task_id);
+			cinfoResult.setCustomerNo(customerNo);
+			cinfoResult.setUserNo(userNo);
+
+			cinfoResult.setMsgLevel(msg_level);
+			cinfoResult.setMsgTotal(msg_num);
+			cinfoResult.setMsgInterval(msg_interval);
+
+			Map<String, Object> check_result = customerInfo_check(info, param, warn_days);
+			String date_str = (String) check_result.get("date");
+			Object type_obj = check_result.get("type");
+			int type_int = 0;
+			if (type_obj != null) {
+				type_int = Integer.valueOf(type_obj.toString());
+			}
+			cinfoResult.setDateType(ip + 1);
+			cinfoResult.setDateVal(date_str);
+			cinfoResult.setDateState(type_int);
+
+			cinfoResult.setCheckTime(new Date());
+
+			save_cinfoResult_list.add(cinfoResult);
+		}
+
+		return save_cinfoResult_list;
+	}
+
+
+	/**
+	 * 检查指定日期参数是否过期超过阈值
+	 * @param info
+	 * @param param
+	 * @param warn_days
+	 * @return
+	 * @throws ParseException
+	 */
+	private Map<String,Object> customerInfo_check(SmsCheckCustomerInfo info, String param, int warn_days) throws ParseException {
+		Map<String,Object> result = new HashMap<>();
+		boolean flag = false;
+		Date date = null;
+		String date_str = null;
+		int days = 0;
+		int type = 0;
+		switch (param){
+			case "contract":
+				date = info.getContractExpireTime();
+				break;
+			case "sms_number_certificate":
+				date = info.getSmsNumberCertificateExpireTime();
+				break;
+			case "record_notice":
+				date = info.getRecordNoticeExpireTime();
+				break;
+			case "value_added_licence":
+				date = info.getValueAddedLicenceExpireTime();
+				break;
+			case "business_licence":
+				date = info.getBusinessLicenceExpireTime();
+				break;
+			default:
+				type = 4;
+				break;
+		}
+
+		if(date!=null){
+			date_str = DateUtils.formatDate(date,"yyyy-MM-dd");
+			days = time_diff_days_byNow(date);
+			if(days<=warn_days){
+				flag = true;
+				type = 2;
+			}else{
+				type = 1;
+			}
+			result.put("flag",flag);
+		}else if(type==0){
+			type = 3;
+		}
+
+		result.put("type",type);
+		result.put("param",param);
+		result.put("date",date_str);
+		return result;
+	}
+
+	/**
+	 * 计算与当前时间差多少天
+	 * @param date
+	 * @return
+	 * @throws ParseException
+	 */
+	private int time_diff_days_byNow(Date date) throws ParseException {
+		int days = 0;
+
+		long now_time = now.getTime();
+		long date_time = date.getTime();
+
+		long diff_time = date_time - now_time;
+
+		long diff_days = diff_time / 1000 / 60 / 60 / 24;
+
+		days = Integer.valueOf(String.valueOf(diff_days));
+
+		System.out.println("test_long:"+now_time +","+ date_time+","+diff_time+","+diff_days+","+days);
+
+		return days;
+	}
+}