dev-discount
袁野 3 years ago
parent 62c4cf1ad0
commit 9a60f1f561
  1. 77
      hai-bweb/src/main/java/com/bweb/controller/CommonController.java
  2. 18
      hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java
  3. 2
      hai-bweb/src/main/java/com/bweb/controller/HighTestController.java
  4. 3
      hai-bweb/src/main/java/com/bweb/controller/HighUserController.java
  5. 2
      hai-bweb/src/main/resources/pre/application.yml
  6. 15
      hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java
  7. 20
      hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java
  8. 2
      hai-service/src/main/java/com/hai/dao/HighDiscountAgentCodeMapperExt.java
  9. 4
      hai-service/src/main/java/com/hai/dao/HighOrderMapper.java
  10. 194
      hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java
  11. 29
      hai-service/src/main/java/com/hai/model/DateCountModel.java
  12. 61
      hai-service/src/main/java/com/hai/model/IndexCountModel.java
  13. 56
      hai-service/src/main/java/com/hai/model/LineCountModel.java
  14. 67
      hai-service/src/main/java/com/hai/model/LineCountReturnModel.java
  15. 30
      hai-service/src/main/java/com/hai/model/OrderSumModel.java
  16. 29
      hai-service/src/main/java/com/hai/service/CommonService.java
  17. 2
      hai-service/src/main/java/com/hai/service/HighCouponCodeService.java
  18. 1
      hai-service/src/main/java/com/hai/service/HighDiscountAgentCodeService.java
  19. 2
      hai-service/src/main/java/com/hai/service/HighDiscountPackageRecordService.java
  20. 94
      hai-service/src/main/java/com/hai/service/HighOrderService.java
  21. 2
      hai-service/src/main/java/com/hai/service/HighUserService.java
  22. 80
      hai-service/src/main/java/com/hai/service/impl/CommonServiceImpl.java
  23. 4
      hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentCodeServiceImpl.java
  24. 13
      hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageRecordServiceImpl.java
  25. 10
      hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageServiceImpl.java
  26. 51
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java
  27. 6
      hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java
  28. 14
      hai-service/src/main/java/com/hai/service/impl/HltUnionCardVipServiceImpl.java
  29. 4
      hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java
  30. 9
      hai-service/src/main/java/com/hai/service/pay/impl/RechargeOrderServiceImpl.java
  31. 4
      hai-service/src/main/resources/dev/commonConfig.properties

@ -1,9 +1,10 @@
package com.bweb.controller;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.utils.DateUtil;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.SecConfig;
import com.hai.model.ResponseData;
import com.hai.model.*;
import com.hai.service.CommonService;
import com.hai.service.SecConfigService;
import io.swagger.annotations.Api;
@ -13,6 +14,9 @@ import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@RestController
@ -77,8 +81,6 @@ public class CommonController {
}
}
@RequestMapping(value="/getDictionaryByCodeType",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据 码值类型 查询数据字典")
@ -190,12 +192,11 @@ public class CommonController {
@ResponseBody
@ApiOperation(value = "查询汇联通余额")
public ResponseData getHLTBalance(
@RequestParam(name = "codeType", required = true) String codeType,
@RequestParam(name = "codeName", required = true) String codeName
@RequestParam(name = "codeType", required = true) String codeType
) {
try {
return ResponseMsgUtil.success(commonService.getHLTBalance(codeType , codeName));
return ResponseMsgUtil.success(commonService.getHLTBalance(codeType));
} catch (Exception e) {
log.error("CommonController --> getIdAndNameByCodeType() error!", e);
@ -208,7 +209,7 @@ public class CommonController {
@ApiOperation(value = "新增余额")
public ResponseData addHLTBalance(@RequestBody JSONObject object) {
try {
commonService.addHLTBalance(object.getString("codeType") , object.getString("codeName") , object.getLong("price"));
commonService.addHLTBalance(object.getString("codeType") , object.getBigDecimal("price"));
return ResponseMsgUtil.success("修改成功");
} catch (Exception e) {
@ -217,4 +218,66 @@ public class CommonController {
}
}
@RequestMapping(value="/getIndexCount",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询统计")
public ResponseData getIndexCount() {
try {
return ResponseMsgUtil.success(commonService.getIndexCount());
} catch (Exception e) {
log.error("CommonController --> getIdAndNameByCodeType() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getLineCount",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询折线图统计数据")
public ResponseData getLineCount() {
try {
LineCountModel lineCountModel = commonService.getLineCount();
LineCountReturnModel lineCountReturnModel = new LineCountReturnModel();
lineCountReturnModel.setDate(conversionData(lineCountModel.getOrderPriceSum()));
lineCountReturnModel.setUserCount(conversionCountData(lineCountModel.getUserCount()));
lineCountReturnModel.setOrderCount(conversionCountData(lineCountModel.getOrderCount()));
lineCountReturnModel.setOrderRechargeCount(conversionCountData(lineCountModel.getOrderRechargeCount()));
lineCountReturnModel.setOrderRechargePriceSum(conversionSumData(lineCountModel.getOrderRechargePriceSum()));
lineCountReturnModel.setOrderPriceSum(conversionSumData(lineCountModel.getOrderPriceSum()));
return ResponseMsgUtil.success(lineCountReturnModel);
} catch (Exception e) {
log.error("CommonController --> getIdAndNameByCodeType() error!", e);
return ResponseMsgUtil.exception(e);
}
}
private BigDecimal[] conversionSumData(List<OrderSumModel> list) {
BigDecimal[] data = new BigDecimal[7];
for (int i = 0; i <list.size() ; i++) {
data[i] = list.get(i).getPrice();
}
return data;
}
private String[] conversionData(List<OrderSumModel> list) throws Exception {
String[] data = new String[7];
for (int i = 0; i <list.size() ; i++) {
data[i] = DateUtil.date2String(list.get(i).getDatetime() , "yyyy-MM-dd");
}
return data;
}
private Long[] conversionCountData(List<DateCountModel> list) {
Long[] data = new Long[7];
for (int i = 0; i <list.size() ; i++) {
data[i] = list.get(i).getNum();
}
return data;
}
}

@ -802,5 +802,23 @@ public class HighOrderController {
}
}
@RequestMapping(value = "/exportHLTOrderByList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "导出预支付订单列表")
public ResponseData exportHLTOrderByList(@RequestParam(name = "code", required = true) Integer code) {
try {
String name = "/goodsOrder/商品订单" + System.currentTimeMillis() + ".xlsx";
List<HighOrderModel> list = highOrderService.HLTOrderByList(code);
String fileName = SysConst.getSysConfig().getFileUrl() + name;
EasyExcel.write(fileName, ExportHighOrderModel.class).sheet("商品订单").doWrite(list);
return ResponseMsgUtil.success(name);
} catch (Exception e) {
log.error("HighOrderController --> exportGoodsOrderList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

File diff suppressed because one or more lines are too long

@ -157,7 +157,8 @@ public class HighUserController {
public ResponseData TCheckEMsgUnionCardVipRights(@RequestParam(name = "phone", required = true) String phone) {
try {
JSONObject consumptionRecord = HuiLianTongUnionCardConfig.TCheckEMsgUnionCardVipRights(phone);
return ResponseMsgUtil.success(consumptionRecord);
JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponseMembership(consumptionRecord.getString("data"));
return ResponseMsgUtil.success(cardInfoObject);
} catch (Exception e) {
log.error("HighOrderController --> getBackendToken() error!", e);
return ResponseMsgUtil.exception(e);

@ -9,7 +9,7 @@ debug: false
#datasource数据源设置
spring:
datasource:
url: jdbc:mysql://139.159.177.244:3306/hfkj?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
url: jdbc:mysql://122.9.135.148:3306/hsg?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root
password: HF123456.
type: com.alibaba.druid.pool.DruidDataSource

@ -39,21 +39,24 @@ public class CzOrderController {
@Resource
private OutRechargeOrderService outRechargeOrderService;
@RequestMapping(value = "/orderRefundNotify", method = RequestMethod.POST)
@ApiOperation(value = "充值回调")
@ApiOperation(value = "退款回调")
@ResponseBody
public void orderRefundNotify(@RequestBody String reqBodyStr, HttpServletRequest request, HttpServletResponse response) {
try {
log.info(reqBodyStr);
HighGasOrderRefund highGasOrderRefund = new HighGasOrderRefund();
highGasOrderRefund.setCreateTime(new Date());
highGasOrderRefund.setReturnContent(reqBodyStr);
highGasOrderRefundMapper.insert(highGasOrderRefund);
JSONObject dataObject = JSONObject.parseObject(reqBodyStr, JSONObject.class);
String dataStr = AESEncodeUtil.aesDecryptByBytes(AESEncodeUtil.base64Decode(dataObject.getString("data")), CommonSysConst.getSysConfig().getTuanYouAppSecret());
JSONObject object = JSONObject.parseObject(dataStr);
HighGasOrderRefund highGasOrderRefund = new HighGasOrderRefund();
highGasOrderRefund.setCreateTime(new Date());
highGasOrderRefund.setReturnContent(String.valueOf(object));
highGasOrderRefundMapper.insert(highGasOrderRefund);
// 查询订单
OutRechargeOrder order = outRechargeOrderService.findByOrderNo(object.getString("orderNumber"));

@ -49,6 +49,24 @@ public class HuiLianTongUnionCardConfig {
return request("qgk/queryCardInfo", dataMap);
}
/**
* @Author Sum1Dream
* @name submitSms.java
* @Description // 请求汇联通短信接口
* @Date 10:08 上午 2022/1/13
* @Param [java.lang.String]
* @return com.alibaba.fastjson.JSONObject
*/
public static JSONObject submitSms(String mobile , String sms) throws Exception {
Map<String,Object> dataMap = new HashMap<>();
dataMap.put("smsTypeCode", "NOTIFY_SMS");
dataMap.put("senderId", "905c602647a74ad895d586364cb307a2");
dataMap.put("channelCode", "HiSen");
dataMap.put("mobile", mobile);
dataMap.put("sms", sms);
return request("hltsms/submitSms", dataMap);
}
/**
* 查询余额
* @param cardNo 工会卡号
@ -114,7 +132,7 @@ public class HuiLianTongUnionCardConfig {
dataMap.put("appId", signCode);
// Md5加密
dataMap.put("sign", WxUtils.generateSignature(map, "chg;l;l23e2!~%^&22ovndfgf*@11212ouower=@=HSG!Business#Controller!" , WXPayConstants.SignType.MD5));
return requestMembership("etcextra/checkEMsgUnionCardVipRights" , dataMap);
return requestMembership("tetcextra/TCheckEMsgUnionCardVipRights" , dataMap);
} catch (Exception e) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQUEST_TIMED_OUT, "");

@ -89,4 +89,6 @@ public interface HighDiscountAgentCodeMapperExt {
"</script>"})
List<Map<String,Object>> getDiscountUseConditionList(@Param("param") Map<String, Object> param);
@Select(" select * from high_discount_agent_code where discount_agent_id = #{discountAgentId} and status = 1 limit #{num} " )
List<HighDiscountAgentCode> getDiscountAgentCodByLimit(@Param("discountAgentId") Long discountAgentId ,@Param("num") Long num);
}

@ -210,4 +210,6 @@ public interface HighOrderMapper extends HighOrderMapperExt {
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(HighOrder record);
}
}

@ -1,16 +1,14 @@
package com.hai.dao;
import com.hai.entity.HighOrder;
import com.hai.model.HighOrderData;
import com.hai.model.HighOrderModel;
import com.hai.model.HighOrderPreModel;
import com.hai.model.OrderCountModel;
import com.hai.model.*;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.JdbcType;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@ -754,6 +752,194 @@ public interface HighOrderMapperExt {
"</script>"})
List<HighOrderModel> selectOrderList(@Param("map") Map<String,Object> map);
@Select(value = {
"<script>",
"select sum(pay_real_price) from high_order where " +
"<if test='map.today != null'> to_days(pay_time) = to_days(now()) and </if> " +
" order_status in (2,3) ",
"</script>"})
BigDecimal orderPriceTotal(@Param("map") Map<String,Object> map);
@Select(value = {
"<script>",
"select sum(pay_real_price) from out_recharge_order where" +
" <if test='map.today != null'> to_days(pay_time) = to_days(now()) and </if> " +
" status in (2,3) ",
"</script>"
})
BigDecimal rechargePriceTotal(@Param("map") Map<String,Object> map);
@Select(value = {
"<script>",
"select count(pay_real_price) from high_order where " +
"<if test='map.today != null'> to_days(pay_time) = to_days(now()) and </if> " +
" order_status in (2,3) ",
"</script>"
})
Long orderPriceCount(@Param("map") Map<String,Object> map);
@Select(value = {
"<script>",
"select count(pay_real_price) from out_recharge_order where " +
"<if test='map.today != null'> to_days(pay_time) = to_days(now()) and </if> " +
"status in (2,3) ",
"</script>"
})
Long rechargePriceCount(@Param("map") Map<String,Object> map);
@Select(value = {
"<script>",
"select a.click_date as datetime, " +
"ifnull(b.num,0) as price " +
"from ( " +
"SELECT curdate() as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 1 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 2 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 3 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 4 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 5 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 6 day) as click_date " +
") a " +
"left join ( " +
"select date(create_time) as datetime, " +
"sum(pay_real_price) as num " +
"from high_order where order_status in (2,3)" +
"group by date(create_time) " +
") b " +
"on a.click_date = b.datetime " +
"ORDER BY a.click_date ASC ",
"</script>"
})
List<OrderSumModel> getOrderSumOrderByDate();
@Select(value = {
"<script>",
"select a.click_date as datetime, " +
"ifnull(b.num,0) as price " +
"from ( " +
"SELECT curdate() as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 1 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 2 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 3 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 4 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 5 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 6 day) as click_date " +
") a " +
"left join ( " +
"select date(create_timed) as datetime, " +
"sum(pay_real_price) as num " +
"from out_recharge_order where status in (2,3)" +
"group by date(create_timed) " +
") b " +
"on a.click_date = b.datetime " +
"ORDER BY a.click_date ASC ",
"</script>"
})
List<OrderSumModel> getOrderSumRechargeByDate();
@Select(value = {
"<script>",
"select a.click_date as datetime, " +
"ifnull(b.num,0) as num " +
"from ( " +
"SELECT curdate() as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 1 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 2 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 3 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 4 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 5 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 6 day) as click_date " +
") a " +
"left join ( " +
"select date(create_time) as datetime, " +
"count(*) as num " +
"from high_order where order_status in (2,3)" +
"group by date(create_time) " +
") b " +
"on a.click_date = b.datetime " +
"ORDER BY a.click_date ASC ",
"</script>"
})
List<DateCountModel> getDateCountByOrder();
@Select(value = {
"<script>",
"select a.click_date as datetime, " +
"ifnull(b.num,0) as num " +
"from ( " +
"SELECT curdate() as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 1 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 2 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 3 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 4 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 5 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 6 day) as click_date " +
") a " +
"left join ( " +
"select date(create_timed) as datetime, " +
"count(*) as num " +
"from out_recharge_order where status in (2,3)" +
"group by date(create_timed) " +
") b " +
"on a.click_date = b.datetime " +
"ORDER BY a.click_date ASC ",
"</script>"
})
List<DateCountModel> getDateCountByRecharge();
@Select(value = {
"<script>",
"select a.click_date as datetime, " +
"ifnull(b.num,0) as num " +
"from ( " +
"SELECT curdate() as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 1 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 2 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 3 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 4 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 5 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 6 day) as click_date " +
") a " +
"left join ( " +
"select date(reg_time) as datetime, " +
"count(*) as num " +
"from high_user " +
"group by date(reg_time) " +
") b " +
"on a.click_date = b.datetime " +
"ORDER BY a.click_date ASC ",
"</script>"
})
List<DateCountModel> getDateCountByUser();
}

@ -0,0 +1,29 @@
package com.hai.model;
import java.util.Date;
public class DateCountModel {
/**
* 时间
*/
private Date datetime;
// 金额
private Long num;
public Date getDatetime() {
return datetime;
}
public void setDatetime(Date datetime) {
this.datetime = datetime;
}
public Long getNum() {
return num;
}
public void setNum(Long num) {
this.num = num;
}
}

@ -0,0 +1,61 @@
package com.hai.model;
import java.math.BigDecimal;
public class IndexCountModel {
// 注册人数
private Long registrantNum;
// 总交易金额
private BigDecimal transactionNum;
// 当天交易金额
private BigDecimal transactionToday;
// 总交易订单
private Long transactionOrder;
// 当天交易订单
private Long transactionOrderToday;
public Long getRegistrantNum() {
return registrantNum;
}
public void setRegistrantNum(Long registrantNum) {
this.registrantNum = registrantNum;
}
public BigDecimal getTransactionNum() {
return transactionNum;
}
public void setTransactionNum(BigDecimal transactionNum) {
this.transactionNum = transactionNum;
}
public BigDecimal getTransactionToday() {
return transactionToday;
}
public void setTransactionToday(BigDecimal transactionToday) {
this.transactionToday = transactionToday;
}
public Long getTransactionOrder() {
return transactionOrder;
}
public void setTransactionOrder(Long transactionOrder) {
this.transactionOrder = transactionOrder;
}
public Long getTransactionOrderToday() {
return transactionOrderToday;
}
public void setTransactionOrderToday(Long transactionOrderToday) {
this.transactionOrderToday = transactionOrderToday;
}
}

@ -0,0 +1,56 @@
package com.hai.model;
import java.util.List;
public class LineCountModel {
//最近七天订单金额
private List<OrderSumModel> orderPriceSum;
//最近七天话费订单金额
private List<OrderSumModel> orderRechargePriceSum;
//最近七天订单数量
private List<DateCountModel> orderCount;
//最近七天话费订单数量
private List<DateCountModel> orderRechargeCount;
//最近七天注册人数
private List<DateCountModel> userCount;
public List<OrderSumModel> getOrderPriceSum() {
return orderPriceSum;
}
public void setOrderPriceSum(List<OrderSumModel> orderPriceSum) {
this.orderPriceSum = orderPriceSum;
}
public List<OrderSumModel> getOrderRechargePriceSum() {
return orderRechargePriceSum;
}
public void setOrderRechargePriceSum(List<OrderSumModel> orderRechargePriceSum) {
this.orderRechargePriceSum = orderRechargePriceSum;
}
public List<DateCountModel> getOrderCount() {
return orderCount;
}
public void setOrderCount(List<DateCountModel> orderCount) {
this.orderCount = orderCount;
}
public List<DateCountModel> getOrderRechargeCount() {
return orderRechargeCount;
}
public void setOrderRechargeCount(List<DateCountModel> orderRechargeCount) {
this.orderRechargeCount = orderRechargeCount;
}
public List<DateCountModel> getUserCount() {
return userCount;
}
public void setUserCount(List<DateCountModel> userCount) {
this.userCount = userCount;
}
}

@ -0,0 +1,67 @@
package com.hai.model;
import java.math.BigDecimal;
import java.util.Date;
public class LineCountReturnModel {
// 订单金额
private BigDecimal[] orderPriceSum;
// 话费订单金额
private BigDecimal[] orderRechargePriceSum;
// 订单数量
private Long[] orderCount;
// 话费订单数量
private Long[] orderRechargeCount;
// 用户数量
private Long[] userCount;
// 时间
private String[] date;
public BigDecimal[] getOrderPriceSum() {
return orderPriceSum;
}
public void setOrderPriceSum(BigDecimal[] orderPriceSum) {
this.orderPriceSum = orderPriceSum;
}
public BigDecimal[] getOrderRechargePriceSum() {
return orderRechargePriceSum;
}
public void setOrderRechargePriceSum(BigDecimal[] orderRechargePriceSum) {
this.orderRechargePriceSum = orderRechargePriceSum;
}
public Long[] getOrderCount() {
return orderCount;
}
public void setOrderCount(Long[] orderCount) {
this.orderCount = orderCount;
}
public Long[] getOrderRechargeCount() {
return orderRechargeCount;
}
public void setOrderRechargeCount(Long[] orderRechargeCount) {
this.orderRechargeCount = orderRechargeCount;
}
public Long[] getUserCount() {
return userCount;
}
public void setUserCount(Long[] userCount) {
this.userCount = userCount;
}
public String[] getDate() {
return date;
}
public void setDate(String[] date) {
this.date = date;
}
}

@ -0,0 +1,30 @@
package com.hai.model;
import java.math.BigDecimal;
import java.util.Date;
public class OrderSumModel {
/**
* 时间
*/
private Date datetime;
// 金额
private BigDecimal price;
public Date getDatetime() {
return datetime;
}
public void setDatetime(Date datetime) {
this.datetime = datetime;
}
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
}

@ -10,7 +10,13 @@ package com.hai.service;
import com.alibaba.fastjson.JSONObject;
import com.hai.entity.SecDictionary;
import com.hai.entity.SecRegion;
import com.hai.model.IndexCountModel;
import com.hai.model.LineCountModel;
import com.hai.model.OrderCountModel;
import com.hai.model.OrderSumModel;
import org.apache.ibatis.type.BigDecimalTypeHandler;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@ -191,7 +197,7 @@ public interface CommonService {
* @Param [java.lang.String, java.lang.String]
* @return java.lang.Long
*/
Long getHLTBalance(String codeType, String codeName);
BigDecimal getHLTBalance(String codeType);
/**
* @Author Sum1Dream
@ -201,7 +207,26 @@ public interface CommonService {
* @Param [java.lang.String, java.lang.String, java.lang.Long]
* @return void
*/
void addHLTBalance(String codeType, String codeName , Long price);
void addHLTBalance(String codeType, BigDecimal price);
/**
* @Author Sum1Dream
* @name getIndexCount.java
* @Description // 获取首页统计数据
* @Date 5:00 下午 2022/1/11
* @Param []
* @return com.hai.model.IndexCountModel
*/
IndexCountModel getIndexCount();
/**
* @Author Sum1Dream
* @name getLineCount.java
* @Description // 查询折线图数据
* @Date 2:38 下午 2022/1/13
* @Param []
* @return com.hai.model.LineCountModel
*/
LineCountModel getLineCount();
}

@ -2,6 +2,7 @@ package com.hai.service;
import com.hai.entity.HighCoupon;
import com.hai.entity.HighCouponCode;
import com.hai.model.OrderSumModel;
import com.hai.model.UserInfoModel;
import java.util.Date;
@ -110,5 +111,4 @@ public interface HighCouponCodeService {
**/
List<HighCouponCode> getCouponCodeList(Map<String,Object> map);
}

@ -93,4 +93,5 @@ public interface HighDiscountAgentCodeService {
*/
Integer getSalesDiscount(Long discountAgentId);
List<HighDiscountAgentCode> getDiscountAgentCodByLimit(Long discountAgentId , Long num);
}

@ -30,4 +30,6 @@ public interface HighDiscountPackageRecordService {
*/
void insertRecord(HighDiscountPackageRecord record);
Boolean isGive(Long userId);
}

@ -2,10 +2,9 @@ package com.hai.service;
import com.hai.entity.HighChildOrder;
import com.hai.entity.HighOrder;
import com.hai.model.HighOrderData;
import com.hai.model.HighOrderModel;
import com.hai.model.OrderCountModel;
import com.hai.model.*;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@ -283,5 +282,94 @@ public interface HighOrderService {
*/
List<HighOrderModel> HLTOrderByList(Integer code) throws Exception;
/**
* @Author Sum1Dream
* @name orderPriceTotal.java
* @Description // 获取支付订单总金额
* @Date 2:09 下午 2022/1/12
* @Param []
* @return java.math.BigDecimal
*/
BigDecimal orderPriceTotal(Map<String , Object> map);
/**
* @Author Sum1Dream
* @name rechargePriceTotal.java
* @Description // 获取话费订单总金额
* @Date 2:09 下午 2022/1/12
* @Param []
* @return java.math.BigDecimal
*/
BigDecimal rechargePriceTotal(Map<String , Object> map);
/**
* @Author Sum1Dream
* @name orderPriceCount.java
* @Description // 获取支付订单数量
* @Date 2:09 下午 2022/1/12
* @Param []
* @return java.lang.Long
*/
Long orderPriceCount(Map<String , Object> map);
/**
* @Author Sum1Dream
* @name rechargePriceCount.java
* @Description // 获取话费订单数量
* @Date 2:10 下午 2022/1/12
* @Param []
* @return java.lang.Long
*/
Long rechargePriceCount(Map<String , Object> map);
/**
* @Author Sum1Dream
* @name getOrderSumOrderByDate.java
* @Description // 查询订单最近七天订单金额
* @Date 11:48 上午 2022/1/13
* @Param []
* @return java.util.List<com.hai.model.OrderSumModel>
*/
List<OrderSumModel> getOrderSumOrderByDate();
/**
* @Author Sum1Dream
* @name getOrderSumRechargeByDate.java
* @Description // 查询话费订单最近七天订单金额
* @Date 11:49 上午 2022/1/13
* @Param []
* @return java.util.List<com.hai.model.OrderSumModel>
*/
List<OrderSumModel> getOrderSumRechargeByDate();
/**
* @Author Sum1Dream
* @name getDateCountByUser.java
* @Description // 查询最近七天注册用户数量
* @Date 11:49 上午 2022/1/13
* @Param []
* @return java.util.List<com.hai.model.DateCountModel>
*/
List<DateCountModel> getDateCountByUser();
/**
* @Author Sum1Dream
* @name getDateCountByOrder.java
* @Description // 查询最近七天订单数量
* @Date 11:50 上午 2022/1/13
* @Param []
* @return java.util.List<com.hai.model.DateCountModel>
*/
List<DateCountModel> getDateCountByOrder();
/**
* @Author Sum1Dream
* @name getDateCountByRecharge.java
* @Description //查询最近七天话费订单数量
* @Date 11:51 上午 2022/1/13
* @Param []
* @return java.util.List<com.hai.model.DateCountModel>
*/
List<DateCountModel> getDateCountByRecharge();
}

@ -108,4 +108,6 @@ public interface HighUserService {
**/
void goldHandle(Long userId, Integer goldNum, Integer goldType, Integer resType, Long resId);
Long countUser();
}

@ -7,15 +7,18 @@ import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.dao.SecDictionaryMapper;
import com.hai.dao.SecRegionMapper;
import com.hai.entity.SecDictionary;
import com.hai.entity.SecDictionaryExample;
import com.hai.entity.SecRegion;
import com.hai.entity.SecRegionExample;
import com.hai.entity.*;
import com.hai.model.IndexCountModel;
import com.hai.model.LineCountModel;
import com.hai.service.CommonService;
import com.hai.service.HighOrderService;
import com.hai.service.HighUserService;
import com.hai.service.SecConfigService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*;
import java.util.concurrent.locks.ReentrantLock;
@ -38,6 +41,15 @@ public class CommonServiceImpl implements CommonService {
@Resource
private SecDictionaryMapper dicMapper;
@Resource
private SecConfigService secConfigService;
@Resource
private HighUserService highUserService;
@Resource
private HighOrderService highOrderService;
private Map<String, Map<String, SecDictionary>> dicCache = new HashMap<String,Map<String, SecDictionary>>();
@ -429,31 +441,57 @@ public class CommonServiceImpl implements CommonService {
}
@Override
public Long getHLTBalance(String codeType, String codeName) {
SecDictionaryExample example = new SecDictionaryExample();
example.createCriteria().andCodeTypeEqualTo(codeType).andCodeNameEqualTo(codeName);
SecDictionary dictionary = dicMapper.selectByExample(example).get(0);
if (dictionary == null) {
return 0L;
}
public BigDecimal getHLTBalance(String codeType) {
return Long.valueOf(dictionary.getCodeValue());
SecConfig secConfig = secConfigService.findByCodeType(codeType);
return new BigDecimal(secConfig.getCodeValue());
}
@Override
public void addHLTBalance(String codeType, String codeName, Long price) {
SecDictionaryExample example = new SecDictionaryExample();
example.createCriteria().andCodeTypeEqualTo(codeType).andCodeNameEqualTo(codeName);
public void addHLTBalance(String codeType , BigDecimal price) {
SecConfig secConfig = secConfigService.findByCodeType(codeType);
BigDecimal balance = new BigDecimal(secConfig.getCodeValue());
SecDictionary dictionary = dicMapper.selectByExample(example).get(0);
secConfig.setCodeValue(String.valueOf(price.add(balance)));
secConfigService.updateSecConfig(secConfig);
}
Long balance = Long.valueOf(dictionary.getCodeValue());
@Override
public IndexCountModel getIndexCount() {
Map<String , Object> map = new HashMap<>();
Map<String , Object> mapToDay = new HashMap<>();
mapToDay.put("today" , "1");
IndexCountModel countModel = new IndexCountModel();
// 获取注册总人数
countModel.setRegistrantNum(highUserService.countUser());
// 获取订单总金额
countModel.setTransactionNum(highOrderService.orderPriceTotal(map).add(highOrderService.rechargePriceTotal(map)));
// 获取当天订单总金额
countModel.setTransactionToday(highOrderService.orderPriceTotal(mapToDay).add(highOrderService.rechargePriceTotal(mapToDay)));
// 获取订单数量
countModel.setTransactionOrder(highOrderService.orderPriceCount(map) + highOrderService.rechargePriceCount(map));
//获取订单当天数量
countModel.setTransactionOrderToday(highOrderService.orderPriceCount(mapToDay) + highOrderService.rechargePriceCount(mapToDay));
return countModel;
}
@Override
public LineCountModel getLineCount() {
dictionary.setCodeValue(String.valueOf(balance + price));
LineCountModel lineCount = new LineCountModel();
dicMapper.updateByPrimaryKey(dictionary);
lineCount.setOrderPriceSum(highOrderService.getOrderSumOrderByDate());
lineCount.setOrderRechargePriceSum(highOrderService.getOrderSumRechargeByDate());
lineCount.setOrderCount(highOrderService.getDateCountByOrder());
lineCount.setOrderRechargeCount(highOrderService.getDateCountByRecharge());
lineCount.setUserCount(highOrderService.getDateCountByUser());
return lineCount;
}
}

@ -154,4 +154,8 @@ public class HighDiscountAgentCodeServiceImpl implements HighDiscountAgentCodeSe
return highDiscountAgentCodeMapper.selectByExample(example).size();
}
@Override
public List<HighDiscountAgentCode> getDiscountAgentCodByLimit(Long discountAgentId, Long num) {
return highDiscountAgentCodeMapper.getDiscountAgentCodByLimit(discountAgentId,num);
}
}

@ -63,4 +63,17 @@ public class HighDiscountPackageRecordServiceImpl implements HighDiscountPackage
record.setStatus(1);
highDiscountPackageRecordMapper.insert(record);
}
@Override
public Boolean isGive(Long userId) {
HighDiscountPackageRecordExample example = new HighDiscountPackageRecordExample();
HighDiscountPackageRecordExample.Criteria criteria = example.createCriteria();
criteria.andUserIdEqualTo(userId.intValue()).andStatusEqualTo(1);
List<HighDiscountPackageRecord> list = discountPackageRecordMapper.selectByExample(example);
return list.size() > 0;
}
}

@ -178,9 +178,6 @@ public class HighDiscountPackageServiceImpl implements HighDiscountPackageServic
@Override
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void addDiscountPackageStock(HighDiscountPackage highDiscountPackage, UserInfoModel userInfoModel, Integer num) throws Exception {
StopWatch stopwatch = new StopWatch();
stopwatch.start();
Thread.sleep(1000);
Map<String, Object> mapRule = new HashMap<>();
mapRule.put("discountPackageId", highDiscountPackage.getId());
@ -203,14 +200,14 @@ public class HighDiscountPackageServiceImpl implements HighDiscountPackageServic
for (HighDiscountPackageDetails detailsList : discountPackageDetailsList) {
// 查询代理商与优惠券关系 列表
HighDiscountAgentRel discountAgentRel = highDiscountAgentRelService.getRelByDiscountAgent(detailsList.getDiscountId().longValue(), detailsList.getAgentId());
List<HighDiscountAgentCode> discountAgentCodeList = highDiscountAgentCodeService.getDiscountCodeByStatus(discountAgentRel.getId() , 1);
List<HighDiscountAgentCode> discountAgentCodeList = highDiscountAgentCodeService.getDiscountAgentCodByLimit(discountAgentRel.getId() , detailsList.getNum().longValue());
if (discountAgentCodeList.size() < detailsList.getNum()) {
throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , detailsList.getDiscountName() +"优惠券库存不足");
}
// 优惠券
for (HighDiscountAgentCode discountAgentCode : discountAgentCodeList.subList(0, detailsList.getNum())) {
for (HighDiscountAgentCode discountAgentCode : discountAgentCodeList) {
HighDiscountPackageDiscountActual discountPackageDiscountActual = new HighDiscountPackageDiscountActual();
discountPackageDiscountActual.setDiscountPackageId(highDiscountPackage.getId());
discountPackageDiscountActual.setDiscountPackageActualId(discountPackageActual.getId());
@ -256,8 +253,7 @@ public class HighDiscountPackageServiceImpl implements HighDiscountPackageServic
// 设置库存
highDiscountPackage.setTotalStock(totalStock + num);
highDiscountPackageMapper.updateByPrimaryKey(highDiscountPackage);
stopwatch.stop();
System.out.println(stopwatch.getTotalTimeSeconds());
}

@ -1149,4 +1149,55 @@ public class HighOrderServiceImpl implements HighOrderService {
return highOrderMapper.selectOrderList(map);
}
@Override
public BigDecimal orderPriceTotal(Map<String , Object> map) {
if (highOrderMapper.orderPriceTotal(map) == null) {
return new BigDecimal(0);
}
return highOrderMapper.orderPriceTotal(map);
}
@Override
public BigDecimal rechargePriceTotal(Map<String , Object> map) {
if (highOrderMapper.rechargePriceTotal(map) == null) {
return new BigDecimal(0);
}
return highOrderMapper.rechargePriceTotal(map);
}
@Override
public Long orderPriceCount(Map<String , Object> map) {
return highOrderMapper.orderPriceCount(map);
}
@Override
public Long rechargePriceCount(Map<String , Object> map) {
return highOrderMapper.rechargePriceCount(map);
}
@Override
public List<OrderSumModel> getOrderSumOrderByDate() {
return highOrderMapper.getOrderSumOrderByDate();
}
@Override
public List<OrderSumModel> getOrderSumRechargeByDate() {
return highOrderMapper.getOrderSumRechargeByDate();
}
@Override
public List<DateCountModel> getDateCountByUser() {
return highOrderMapper.getDateCountByUser();
}
@Override
public List<DateCountModel> getDateCountByOrder() {
return highOrderMapper.getDateCountByOrder();
}
@Override
public List<DateCountModel> getDateCountByRecharge() {
return highOrderMapper.getDateCountByRecharge();
}
}

@ -218,4 +218,10 @@ public class HighUserServiceImpl implements HighUserService {
highGoldRec.setResId(resId);
highGoldRecService.insertGoldRec(highGoldRec);
}
@Override
public Long countUser() {
HighUserExample example = new HighUserExample();
return highUserMapper.countByExample(example);
}
}

@ -53,6 +53,9 @@ public class HltUnionCardVipServiceImpl implements HltUnionCardVipService {
@Resource
private HighDiscountPackageActualService discountPackageActualService;
@Resource
private HighDiscountPackageRecordService discountPackageRecordService;
@Resource
private HighDiscountPackageDiscountActualService discountPackageDiscountActualService;
@ -76,6 +79,7 @@ public class HltUnionCardVipServiceImpl implements HltUnionCardVipService {
}
boolean isVip = false;
boolean isFree = false;
// 1: 1-E信通会员权益,2-工会卡会员权益
int equityLevel = 0;
@ -88,6 +92,10 @@ public class HltUnionCardVipServiceImpl implements HltUnionCardVipService {
} else if (d.getInteger("level").equals(2)) {
isVip = true;
equityLevel = 2;
} else if (d.getInteger("level").equals(3)) {
isVip = true;
isFree = true;
equityLevel = 1;
}
}
@ -101,6 +109,10 @@ public class HltUnionCardVipServiceImpl implements HltUnionCardVipService {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "用户当月已赠送");
} else {
if (isFree && discountPackageRecordService.isGive(highUser.getId())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "免费用户已赠送");
}
Map<String,Object> map = new HashMap<>();
map.put("companyId", bsCompany.getId());
map.put("usingAttribution", equityLevel);
@ -110,7 +122,7 @@ public class HltUnionCardVipServiceImpl implements HltUnionCardVipService {
// 查询话费专属优惠券包
List<HighDiscountPackage> highDiscountPackages = highDiscountPackageService.getDiscountPackageList(map);
if (highDiscountPackages.size() == 0) {
if (highDiscountPackages.size() == 0) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "暂未配置专属优惠券包");
}

@ -296,7 +296,7 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
dataMap.put("tranDesc", tranDesc);
HighGasOrderPush payPush = new HighGasOrderPush();
payPush.setType(OrderPushType.type5.getType());
payPush.setOrderNo(userCard.getCardNo());
payPush.setOrderNo(order.getOrderNo());
payPush.setCreateTime(new Date());
payPush.setCode(consumption.getString("respCode"));
payPush.setRequestContent(JSON.toJSONString(dataMap));
@ -307,7 +307,7 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumption.getString("respMessage"));
}
JSONObject consumptionResult = HuiLianTongUnionCardConfig.resolveResponse(consumption.getString("data"));
if (consumptionResult.getBoolean("success") != true) {
if (!consumptionResult.getBoolean("success")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumptionResult.getString("message"));
}
order.setPaySerialNo(consumptionResult.getString("orderId")); // 支付流水号

@ -76,6 +76,15 @@ public class RechargeOrderServiceImpl implements PayService {
order.setPayTime(new Date()); // 支付时间
order.setStatus(2); // 订单状态 : 1.待支付 2.已支付 3.已完成 4.已取消 5.已退款
outRechargeOrderService.updateOrder(order);
// 推送订单记录
HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
highGasOrderPush.setType(OrderPushType.type2.getType());
highGasOrderPush.setOrderNo(order.getOrderNo());
highGasOrderPush.setCreateTime(new Date());
highGasOrderPush.setRequestContent(order.getOrderNo());
highGasOrderPush.setReturnContent(String.valueOf(map));
highGasOrderPushMapper.insert(highGasOrderPush);
}
}
}

@ -23,8 +23,8 @@ HuiLianTongUnionCardUrl=http://hltgz.com:4010/api/v2/execute.json
HuiLianTongUnionCardAccessCode=6FCAE1470CEF465988351BB65ABAA8AE
HuiLianTongUnionCardSignCode=F8E91A3C
HltMembershipLevelAccessCode = 9766699A55D640BB97FD8674CF13CCB4
HltMembershipLevelSignCode = C9B28C9A
HltMembershipLevelAccessCode = 19741F626EE446939CE6D448B0FB0EE8
HltMembershipLevelSignCode = 7854B96C

Loading…
Cancel
Save