dev-discount
= 3 years ago
commit 54bd4110a7
  1. 31
      hai-bweb/src/main/java/com/bweb/controller/HighAgentController.java
  2. 112
      hai-bweb/src/main/java/com/bweb/controller/OutRechargeOrderController.java
  3. 53
      hai-bweb/src/main/java/com/bweb/model/ExportOutRechargeOrderCount.java
  4. 42
      hai-bweb/src/main/java/com/bweb/model/ExportOutRechargeUserOrderCount.java
  5. 4
      hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java
  6. 23
      hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapperExt.java
  7. 10
      hai-service/src/main/java/com/hai/entity/OutRechargeOrder.java
  8. 4
      hai-service/src/main/java/com/hai/model/OutRechargeOrderModel.java
  9. 40
      hai-service/src/main/java/com/hai/model/OutUserOrderModel.java
  10. 12
      hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java
  11. 3
      hai-service/src/main/java/com/hai/service/impl/HighAgentServiceImpl.java
  12. 86
      hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java

@ -67,10 +67,10 @@ public class HighAgentController {
//发布人员
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
if (userInfoModel.getBsCompany() == null) {
log.error("HighAgentController -> insertAgent() error!","该主角色没有权限");
throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, "");
}
// if (userInfoModel.getBsCompany() == null) {
// log.error("HighAgentController -> insertAgent() error!","该主角色没有权限");
// throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, "");
// }
if (StringUtils.isBlank(highAgentModel.getAgentName())
|| StringUtils.isBlank(highAgentModel.getAgentAddress())
@ -118,10 +118,10 @@ public class HighAgentController {
//发布人员
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
if (userInfoModel.getBsCompany() == null) {
log.error("HighAgentController -> insertAgent() error!","该主角色没有权限");
throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, "");
}
// if (userInfoModel.getBsCompany() == null) {
// log.error("HighAgentController -> insertAgent() error!","该主角色没有权限");
// throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, "");
// }
if (highAgentModel.getId() == null
|| StringUtils.isBlank(highAgentModel.getAgentName())
@ -163,7 +163,7 @@ public class HighAgentController {
}
}
@RequestMapping(value = "/generateRechargeAgentQrCode", method = RequestMethod.POST)
@RequestMapping(value = "/generateRechargeAgentQrCode", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "生成【充值代理商】二维码")
public ResponseData generateRechargeAgentQrCode(@RequestParam(value = "agentId", required = true) Long agentId) {
@ -196,6 +196,7 @@ public class HighAgentController {
@RequestParam(value = "agentName", required = false) String agentName,
@RequestParam(value = "agentPhone", required = false) String agentPhone,
@RequestParam(value = "status", required = false) Integer status,
@RequestParam(value = "type", required = false) Integer type,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request
) {
@ -204,10 +205,10 @@ public class HighAgentController {
//发布人员
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
if (userInfoModel.getBsCompany() == null) {
log.error("HighAgentController -> insertAgent() error!","该主角色没有权限");
throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, "");
}
// if (userInfoModel.getBsCompany() == null) {
// log.error("HighAgentController -> insertAgent() error!","该主角色没有权限");
// throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, "");
// }
Map<String, String> map = new HashMap<>();
@ -221,6 +222,10 @@ public class HighAgentController {
map.put("status", Integer.toString(status));
}
if (type != null) {
map.put("type", Integer.toString(type));
}
map.put("operatorId" , Long.toString(userInfoModel.getSecUser().getId()));
PageHelper.startPage(pageNum, pageSize);

@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSONObject;
import com.bweb.config.SysConst;
import com.bweb.model.ExportHighOrderModel;
import com.bweb.model.ExportOutRechargeOrder;
import com.bweb.model.ExportOutRechargeOrderCount;
import com.bweb.model.ExportOutRechargeUserOrderCount;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hai.common.exception.ErrorCode;
@ -19,11 +21,7 @@ import com.hai.common.utils.IDGenerator;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.common.utils.WxUtils;
import com.hai.entity.OutRechargeOrder;
import com.hai.model.HighOrderModel;
import com.hai.model.OutRechargeOrderModel;
import com.hai.model.OrderRefundModel;
import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel;
import com.hai.model.*;
import com.hai.service.OutRechargeOrderService;
import com.hai.service.TelApiService;
import com.hai.service.pay.impl.GoodsOrderServiceImpl;
@ -46,6 +44,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@ -134,6 +133,8 @@ public class OutRechargeOrderController {
@RequestParam(name = "rechargeModel", required = false) String rechargeModel,
@RequestParam(name = "rechargeContent", required = false) String rechargeContent,
@RequestParam(name = "userPhone", required = false) String userPhone,
@RequestParam(name = "payTimeS", required = false) Long payTimeS,
@RequestParam(name = "payTimeE", required = false) Long payTimeE,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize,
HttpServletRequest request) {
@ -159,6 +160,13 @@ public class OutRechargeOrderController {
map.put("userPhone", userPhone);
}
if (payTimeS != null) {
map.put("payTimeS", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(payTimeS));
}
if (payTimeE != null) {
map.put("payTimeE", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(payTimeE));
}
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(outRechargeOrderService.getListRechargeOrder(map)));
@ -302,7 +310,7 @@ public class OutRechargeOrderController {
@RequestMapping(value = "/getOrderCountList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询商品")
@ApiOperation(value = "查询时间订单统计")
public ResponseData getOrderCountList(
@RequestParam(name = "finishTimeS", required = false) Long finishTimeS,
@RequestParam(name = "finishTimeE", required = false) Long finishTimeE,
@ -315,14 +323,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);
@ -334,4 +338,92 @@ public class OutRechargeOrderController {
}
}
@RequestMapping(value = "/exportOrderListCount", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "导出订单")
public ResponseData exportOrderListCount(@RequestParam(name = "finishTimeS", required = false) Long finishTimeS,
@RequestParam(name = "finishTimeE", required = false) Long finishTimeE) {
try {
Map<String,String> map = new HashMap<>();
if (finishTimeS != null){
map.put("finishTimeS", finishTimeS.toString());
}
if (finishTimeE != null){
map.put("finishTimeE", finishTimeE.toString());
}
List<OutOrderModel> list = outRechargeOrderService.getListOrderCount(map);
String name = "/outRechargeOrder/订单统计" + System.currentTimeMillis() + ".xlsx";
String fileName = SysConst.getSysConfig().getFileUrl() + name;
EasyExcel.write(fileName, ExportOutRechargeOrderCount.class).sheet("订单统计").doWrite(list);
return ResponseMsgUtil.success(name);
} catch (Exception e) {
log.error("HighOrderController --> exportOrderList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getUserCountList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询员工订单统计")
public ResponseData getUserCountList(
@RequestParam(name = "finishTimeS", required = false) Long finishTimeS,
@RequestParam(name = "finishTimeE", required = false) Long finishTimeE,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize,
HttpServletRequest request) {
try {
Map<String,String> map = new HashMap<>();
if (finishTimeS != null){
map.put("finishTimeS", finishTimeS.toString());
}
if (finishTimeE != null){
map.put("finishTimeE", finishTimeE.toString());
}
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(outRechargeOrderService.getUserCountList(map)));
} catch (Exception e) {
log.error("HighOrderController --> getUserOrderList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/exportUserOrderListCount", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "导出员工订单")
public ResponseData exportUserOrderListCount(@RequestParam(name = "finishTimeS", required = false) Long finishTimeS,
@RequestParam(name = "finishTimeE", required = false) Long finishTimeE) {
try {
Map<String,String> map = new HashMap<>();
if (finishTimeS != null){
map.put("finishTimeS", finishTimeS.toString());
}
if (finishTimeE != null){
map.put("finishTimeE", finishTimeE.toString());
}
List<OutUserOrderModel> list = outRechargeOrderService.getUserCountList(map);
String name = "/outRechargeOrder/员工订单统计" + System.currentTimeMillis() + ".xlsx";
String fileName = SysConst.getSysConfig().getFileUrl() + name;
EasyExcel.write(fileName, ExportOutRechargeUserOrderCount.class).sheet("订单统计").doWrite(list);
return ResponseMsgUtil.success(name);
} catch (Exception e) {
log.error("HighOrderController --> exportOrderList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -0,0 +1,53 @@
package com.bweb.model;
import com.alibaba.excel.annotation.ExcelProperty;
import java.math.BigDecimal;
import java.util.Date;
public class ExportOutRechargeOrderCount {
@ExcelProperty("时间")
private Date day;
@ExcelProperty("数量")
private Long count;
@ExcelProperty("支付金额")
private BigDecimal payPrice;
@ExcelProperty("充值金额")
private BigDecimal orderPrice;
public Date getDay() {
return day;
}
public void setDay(Date day) {
this.day = day;
}
public Long getCount() {
return count;
}
public void setCount(Long count) {
this.count = count;
}
public BigDecimal getPayPrice() {
return payPrice;
}
public void setPayPrice(BigDecimal payPrice) {
this.payPrice = payPrice;
}
public BigDecimal getOrderPrice() {
return orderPrice;
}
public void setOrderPrice(BigDecimal orderPrice) {
this.orderPrice = orderPrice;
}
}

@ -0,0 +1,42 @@
package com.bweb.model;
import com.alibaba.excel.annotation.ExcelProperty;
import java.math.BigDecimal;
import java.util.Date;
public class ExportOutRechargeUserOrderCount {
@ExcelProperty("员工名称")
private String agentName;
@ExcelProperty("数量")
private Long count;
@ExcelProperty("支付金额")
private BigDecimal payPrice;
public String getAgentName() {
return agentName;
}
public void setAgentName(String agentName) {
this.agentName = agentName;
}
public Long getCount() {
return count;
}
public void setCount(Long count) {
this.count = count;
}
public BigDecimal getPayPrice() {
return payPrice;
}
public void setPayPrice(BigDecimal payPrice) {
this.payPrice = payPrice;
}
}

@ -118,6 +118,10 @@ public class OutRechargeOrderController {
outRechargeOrder.setUserName(userInfoModel.getHighUser().getName());
outRechargeOrder.setUserPhone(userInfoModel.getHighUser().getPhone());
if (outRechargeOrder.getCodeValue() != null) {
outRechargeOrder.setAgentKey(outRechargeOrder.getCodeValue());
}
outRechargeOrder.setCreateTimed(new Date());
outRechargeOrder.setStatus(1);
outRechargeOrderService.insertOrder(outRechargeOrder);

@ -3,6 +3,7 @@ package com.hai.dao;
import com.hai.model.OutOrderModel;
import com.hai.model.OutRechargeOrderModel;
import com.hai.model.OutUserOrderModel;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
@ -26,8 +27,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 +37,24 @@ 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(value = {
"<script>",
"select agent_name, count(1) as count, sum(pay_price) as pay_price",
"from high_agent ha",
"right join out_recharge_order oro on ha.agent_key = oro.agent_key",
"where ha.type = 2 and oro.status in (3)",
" and finish_time between #{finishTimeS} and #{finishTimeE} " ,
"GROUP BY agent_name",
"</script>"
})
@Results({
@Result(column="count", property="count", jdbcType=JdbcType.BIGINT),
@Result(column="agent_name", property="agentName", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL),
})
List<OutUserOrderModel> getListUserCount(String finishTimeS , String finishTimeE);
@Select({"<script>" +
"SELECT" +

@ -139,6 +139,16 @@ public class OutRechargeOrder implements Serializable {
*/
private String agentKey;
private String codeValue;
public String getCodeValue() {
return codeValue;
}
public void setCodeValue(String codeValue) {
this.codeValue = codeValue;
}
private static final long serialVersionUID = 1L;
public Long getId() {

@ -1,9 +1,11 @@
package com.hai.model;
import com.hai.entity.OutRechargeOrder;
import java.math.BigDecimal;
import java.util.Date;
public class OutRechargeOrderModel {
public class OutRechargeOrderModel extends OutRechargeOrder {
private String orderNo;
private String userName;

@ -0,0 +1,40 @@
package com.hai.model;
import java.math.BigDecimal;
import java.util.Date;
public class OutUserOrderModel {
private String agentName;
private Long count;
/**
* 支付金额
*/
private BigDecimal payPrice;
public String getAgentName() {
return agentName;
}
public void setAgentName(String agentName) {
this.agentName = agentName;
}
public Long getCount() {
return count;
}
public void setCount(Long count) {
this.count = count;
}
public BigDecimal getPayPrice() {
return payPrice;
}
public void setPayPrice(BigDecimal payPrice) {
this.payPrice = payPrice;
}
}

@ -3,6 +3,7 @@ package com.hai.service;
import com.hai.entity.OutRechargeOrder;
import com.hai.model.OutOrderModel;
import com.hai.model.OutRechargeOrderModel;
import com.hai.model.OutUserOrderModel;
import io.swagger.models.auth.In;
import java.util.List;
@ -96,6 +97,15 @@ 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;
/**
* @Author Sum1Dream
* @Description //TODO Administrator
* @Date 0:56 2021/6/23
* @Param [map]
* @return java.util.List<com.hai.model.OutUserOrderModel>
**/
List<OutUserOrderModel> getUserCountList(Map<String , String> map) throws Exception;
}

@ -45,6 +45,9 @@ public class HighAgentServiceImpl implements HighAgentService {
if (StringUtils.isNotBlank(map.get("status"))) {
criteria.andStatusEqualTo(Integer.valueOf(map.get("status")));
}
if (StringUtils.isNotBlank(map.get("type"))) {
criteria.andTypeEqualTo(Integer.valueOf(map.get("type")));
}
if (StringUtils.isNotBlank(map.get("operatorId"))) {
criteria.andOperatorIdEqualTo(Long.valueOf(map.get("operatorId")));
}

@ -6,14 +6,18 @@ import com.hai.dao.OutRechargeOrderMapperExt;
import com.hai.entity.*;
import com.hai.model.OutOrderModel;
import com.hai.model.OutRechargeOrderModel;
import com.hai.model.OutUserOrderModel;
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;
@ -60,6 +64,17 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
criteria.andRechargeModelEqualTo(Integer.valueOf(MapUtils.getString(map, "rechargeModel")));
}
if (StringUtils.isNotBlank(map.get("payTimeS")) && StringUtils.isNotBlank(map.get("payTimeE"))) {
criteria.andPayTimeBetween(
DateUtil.format(map.get("payTimeS") , "yyyy-MM-dd HH:mm:ss") ,
DateUtil.format(map.get("payTimeE") , "yyyy-MM-dd HH:mm:ss"));
}
if (StringUtils.isNotBlank(map.get("createTimeS")) && StringUtils.isNotBlank(map.get("createTimeE"))) {
criteria.andCreateTimedBetween(
DateUtil.format(map.get("createTimeS") , "yyyy-MM-dd HH:mm:ss") ,
DateUtil.format(map.get("createTimeE") , "yyyy-MM-dd HH:mm:ss"));
}
example.setOrderByClause("create_timed desc");
return outRechargeOrderMapper.selectByExample(example);
}
@ -139,7 +154,74 @@ 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);
}
@Override
public List<OutUserOrderModel> getUserCountList(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.getListUserCount(fTimeS , fTimeE);
}
}

Loading…
Cancel
Save