提交代码

dev-discount
袁野 3 years ago
parent bb3424d0f8
commit 5d8800e48a
  1. 4
      hai-bweb/src/main/java/com/bweb/controller/OutRechargeOrderController.java
  2. 5
      hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapperExt.java
  3. 2
      hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java
  4. 39
      hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java

@ -296,14 +296,10 @@ public class OutRechargeOrderController {
if (finishTimeS != null){
map.put("finishTimeS", finishTimeS.toString());
} else {
map.put("finishTimeS", null);
}
if (finishTimeE != null){
map.put("finishTimeE", finishTimeE.toString());
} else {
map.put("finishTimeE", null);
}
PageHelper.startPage(pageNum,pageSize);

@ -26,8 +26,7 @@ public interface OutRechargeOrderMapperExt {
"sum(order_price) as order_price",
"from out_recharge_order",
"where status = 3",
" <if test='map.finishTimeS != null'> <![CDATA[ AND bco.finish_time >= '${map.finishTimeS}' ]]> </if> " ,
" <if test='map.finishTimeE != null'> <![CDATA[ AND bco.finish_time <= '${map.finishTimeE}' ]]> </if> " ,
" and finish_time between #{finishTimeS} and #{finishTimeE} " ,
"GROUP BY day",
"</script>"
})
@ -37,7 +36,7 @@ public interface OutRechargeOrderMapperExt {
@Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="order_price", property="orderPrice", jdbcType=JdbcType.DECIMAL),
})
List<OutOrderModel> getListOrderCount(@Param("map") Map<String,String> map);
List<OutOrderModel> getListOrderCount(String finishTimeS , String finishTimeE);
@Select({
"SELECT" +

@ -96,6 +96,6 @@ public interface OutRechargeOrderService {
* @Param [map]
* @return java.util.List<com.hai.model.OutRechargeOrderModel>
**/
List<OutOrderModel> getListOrderCount(Map<String , String> map);
List<OutOrderModel> getListOrderCount(Map<String , String> map) throws Exception;
}

@ -1,5 +1,6 @@
package com.hai.service.impl;
import com.hai.common.utils.DateUtil;
import com.hai.dao.OutRechargeOrderMapper;
import com.hai.dao.OutRechargeOrderMapperExt;
import com.hai.entity.*;
@ -7,12 +8,15 @@ import com.hai.model.OutOrderModel;
import com.hai.model.OutRechargeOrderModel;
import com.hai.service.OutRechargeOrderService;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestParam;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -122,7 +126,38 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
}
@Override
public List<OutOrderModel> getListOrderCount(Map<String, String> map) {
return outRechargeOrderMapperExt.getListOrderCount(map);
public List<OutOrderModel> getListOrderCount(Map<String, String> map) throws Exception {
String finishTimeS = map.get("finishTimeS");
String finishTimeE = map.get("finishTimeE");
String fTimeS;
String fTimeE;
if (StringUtils.isNotBlank(finishTimeS)) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date(Long.parseLong(finishTimeS)));
//时
calendar.set(Calendar.HOUR_OF_DAY, 00);
//分
calendar.set(Calendar.MINUTE, 00);
//秒
calendar.set(Calendar.SECOND, 00);
fTimeS = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(calendar.getTime());
} else {
fTimeS = "2010-09-13 22:36:01";
}
if (StringUtils.isNotBlank(finishTimeE)) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date(Long.parseLong(finishTimeE)));
//时
calendar.set(Calendar.HOUR_OF_DAY, 00);
//分
calendar.set(Calendar.MINUTE, 00);
//秒
calendar.set(Calendar.SECOND, 00);
fTimeE = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(calendar.getTime());
} else {
fTimeE = DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss");
}
return outRechargeOrderMapperExt.getListOrderCount(fTimeS , fTimeE);
}
}

Loading…
Cancel
Save