Authored by mingdan.ge

cps5

... ... @@ -65,9 +65,14 @@ public class DateUtil {
}
public static void main(String[] ars){
int endTime= DateUtil.getLastDayInt(6);
System.out.println(endTime);
int beginTime=DateUtil.getLastDayInt(7);
System.out.println(beginTime);
String s = DateUtil.long2DateStr(1449134435000L, "yyyy-MM-dd");
System.out.print(s);
System.out.print(">>>>>>>>>>"+getCurrentTimeSecond());
System.out.println(s);
System.out.println(">>>>>>>>>>"+getCurrentTimeSecond());
}
... ... @@ -203,14 +208,14 @@ public class DateUtil {
public static int getLastDayInt(int lastDay) {
Calendar time = Calendar.getInstance();
time.add(Calendar.DAY_OF_YEAR,1-lastDay);
time.add(Calendar.DAY_OF_YEAR,-lastDay);
time.set(time.get(Calendar.YEAR),time.get(Calendar.MONTH),time.get(Calendar.HOUR_OF_DAY),0,0,0);
return (int) (time.getTime().getTime()/1000);
}
public static int getLastDayInt(int time,int lastDay) {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(time*1000);
calendar.add(Calendar.DAY_OF_YEAR,1-lastDay);
calendar.add(Calendar.DAY_OF_YEAR,-lastDay);
calendar.set(calendar.get(Calendar.YEAR),calendar.get(Calendar.MONTH),calendar.get(Calendar.HOUR_OF_DAY),0,0,0);
return (int) (calendar.getTime().getTime()/1000);
}
... ...
... ... @@ -107,6 +107,7 @@
<value>/UnionShareRest/addVirtual</value>
<value>/UnionShareRest/toAddVirtual</value>
<value>/UnionShareRest/dealExtraActivityTask</value>
<value>/UnionShareRest/dealNewUserActivityTask</value>
<value>/UnionShareRest/clearActivity</value>
<value>/UnionShareRest/getStatisticsInfo</value>
<value>/UnionShareRest/queryUnionShareOrdersMonthList</value>
... ...
... ... @@ -43,7 +43,7 @@
select
<include refid="Base_Column_List" />
from union_share_orders_activity
where status=1 and type=4 and start_time &lt; #{endTime,jdbcType=INTEGER} and end_time > #{startTime,jdbcType=INTEGER}
where status=1 and type=4 and start_time &lt;= #{endTime,jdbcType=INTEGER} and end_time >= #{startTime,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from union_share_orders_activity
... ...
... ... @@ -1584,7 +1584,7 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport
@Override
public List<UnionShareOrdersActivity> queryLastDaysIngActivity(int beginTime,int endTime) {
logger.info("queryLastDaysActivity.beginTime is {},endTime is {}.",beginTime,endTime);
if (beginTime <= endTime) {
if (beginTime >= endTime) {
return null;
}
... ...