解决冲突

dev-discount
胡锐 2 years ago
commit 0352cf0a0f
  1. 34
      hai-bweb/src/main/java/com/bweb/controller/HighApproveController.java
  2. 23
      hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java
  3. 12
      hai-bweb/src/main/java/com/bweb/controller/HighDiscountPackageController.java
  4. 2
      hai-bweb/src/main/java/com/bweb/controller/OutRechargeOrderController.java
  5. 54
      hai-cweb/src/main/java/com/cweb/controller/CommonController.java
  6. 5
      hai-cweb/src/main/java/com/cweb/controller/HighGasController.java
  7. 35
      hai-cweb/src/main/java/com/cweb/controller/HighThirdPartyController.java
  8. 2
      hai-cweb/src/main/java/com/cweb/controller/HighUserController.java
  9. 2
      hai-cweb/src/main/resources/dev/logback.xml
  10. 11
      hai-schedule/src/main/java/com/hai/schedule/HighCouponSchedule.java
  11. 6
      hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java
  12. 2
      hai-schedule/src/main/java/com/hai/schedule/HighTestController.java
  13. 2
      hai-schedule/src/main/resources/prod/logback.xml
  14. 10
      hai-service/src/main/java/com/hai/common/utils/CommonUtil.java
  15. 54
      hai-service/src/main/java/com/hai/common/utils/WxUtils.java
  16. 1
      hai-service/src/main/java/com/hai/config/UnionUserConfig.java
  17. 66
      hai-service/src/main/java/com/hai/dao/HighApproveMapper.java
  18. 80
      hai-service/src/main/java/com/hai/dao/HighApproveSqlProvider.java
  19. 2
      hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java
  20. 2
      hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapperExt.java
  21. 20
      hai-service/src/main/java/com/hai/entity/ApiStarbucksProducts.java
  22. 20
      hai-service/src/main/java/com/hai/entity/HighApprove.java
  23. 47
      hai-service/src/main/java/com/hai/entity/HighApproveExample.java
  24. 3
      hai-service/src/main/java/com/hai/enum_type/ApproveType.java
  25. 16
      hai-service/src/main/java/com/hai/service/BsIntegralRebateService.java
  26. 3
      hai-service/src/main/java/com/hai/service/CommonService.java
  27. 17
      hai-service/src/main/java/com/hai/service/HighCouponService.java
  28. 3
      hai-service/src/main/java/com/hai/service/impl/CommonServiceImpl.java
  29. 23
      hai-service/src/main/java/com/hai/service/impl/HighApproveServiceImpl.java
  30. 2
      hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java
  31. 112
      hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java
  32. 4
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java
  33. 15
      hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java
  34. 1
      v1/src/main/java/com/v1/config/AuthConfig.java
  35. 17
      v1/src/main/java/com/v1/config/SysConfig.java
  36. 121
      v1/src/main/java/com/v1/config/WeChatQrcodeUtils.java
  37. 51
      v1/src/main/java/com/v1/config/WxConfig.java
  38. 140
      v1/src/main/java/com/v1/controller/WxMsgController.java
  39. 2
      v1/src/main/resources/dev/config.properties
  40. 3
      v1/src/main/resources/dev/logback.xml

@ -8,6 +8,7 @@ import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.DateUtil;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.HighApprove;
import com.hai.enum_type.ApproveType;
@ -145,4 +146,37 @@ public class HighApproveController {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/addApprove",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "添加审批")
public ResponseData addApprove(@RequestBody JSONObject object ,HttpServletRequest request) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
HighApprove approve = new HighApprove();
approve.setObjectId(99L);
approve.setObjectName("卡券分发审批");
approve.setApproveSerialNo(DateUtil.date2String(new Date(), "yyyyMMddHHmmss"));
approve.setStatus(1);
approve.setCreateTime(new Date());
approve.setUpdateTime(new Date());
approve.setSubmitOperatorId(userInfoModel.getSecUser().getId());
approve.setSubmitOperatorName(userInfoModel.getSecUser().getUserName());
approve.setObjectType(object.getInteger("objectType"));
approve.setApproveObject(object.getJSONObject("approveObject").toJSONString());
highApproveService.insertApprove(approve);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighCouponController -> approveProcessed() error!",e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -768,4 +768,27 @@ public class HighCouponController {
}
}
@RequestMapping(value="/getCouponListByAll",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询所有卡卷列表")
public ResponseData getCouponListByAll(HttpServletRequest request) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
if (userInfoModel.getBsCompany() == null) {
log.error("HighCouponController -> getCouponList() error!","权限不足");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
Map<String, Object> map = new HashMap<>(3);
map.put("companyId", userInfoModel.getBsCompany().getId());
map.put("status", 2);
return ResponseMsgUtil.success(highCouponService.getCouponListByAll(map));
} catch (Exception e) {
log.error("HighCouponController -> getCouponList() error!",e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -164,9 +164,9 @@ public class HighDiscountPackageController {
if (StringUtils.isBlank(highDiscountPackage.getTitle())
|| highDiscountPackage.getSalesType() == null
// || StringUtils.isBlank(highDiscountPackage.getBannerImg())
// || StringUtils.isBlank(highDiscountPackage.getListImg())
// || StringUtils.isBlank(highDiscountPackage.getDetailsImg())
|| StringUtils.isBlank(highDiscountPackage.getBannerImg())
|| StringUtils.isBlank(highDiscountPackage.getListImg())
|| StringUtils.isBlank(highDiscountPackage.getDetailsImg())
) {
log.error("HighAgentController -> insertCouponPackageInfo() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
@ -225,9 +225,9 @@ public class HighDiscountPackageController {
if (StringUtils.isBlank(highDiscountPackage.getTitle())
|| highDiscountPackage.getSalesType() == null
|| highDiscountPackage.getId() == null
// || StringUtils.isBlank(highDiscountPackage.getBannerImg())
// || StringUtils.isBlank(highDiscountPackage.getListImg())
// || StringUtils.isBlank(highDiscountPackage.getDetailsImg())
|| StringUtils.isBlank(highDiscountPackage.getBannerImg())
|| StringUtils.isBlank(highDiscountPackage.getListImg())
|| StringUtils.isBlank(highDiscountPackage.getDetailsImg())
) {
log.error("HighAgentController -> updateCouponPackageInfo() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");

@ -144,6 +144,7 @@ public class OutRechargeOrderController {
@RequestParam(name = "payType", required = false) Integer payType,
@RequestParam(name = "payTimeS", required = false) Long payTimeS,
@RequestParam(name = "payTimeE", required = false) Long payTimeE,
@RequestParam(name = "whetherTimeOut", required = false) Boolean whetherTimeOut,
@RequestParam(name = "createTimeS", required = false) Long createTimeS,
@RequestParam(name = "createTimeE", required = false) Long createTimeE,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@ -169,6 +170,7 @@ public class OutRechargeOrderController {
map.put("rechargeStatus", rechargeStatus);
map.put("payStatus", payStatus);
map.put("orderNo", orderNo);
map.put("whetherTimeOut", whetherTimeOut);
map.put("operatorType", operatorType);
map.put("laborUnionCard", laborUnionCard);
map.put("rechargeContent", rechargeContent);

@ -8,14 +8,9 @@ import com.hai.common.exception.SysCode;
import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.common.utils.WxUtils;
import com.hai.entity.ApiCity;
import com.hai.entity.BsCompany;
import com.hai.entity.SecConfig;
import com.hai.entity.SecRegion;
import com.hai.entity.*;
import com.hai.model.ResponseData;
import com.hai.service.BsCompanyService;
import com.hai.service.CommonService;
import com.hai.service.SecConfigService;
import com.hai.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import me.chanjar.weixin.common.util.crypto.SHA1;
@ -25,6 +20,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@ -47,6 +43,11 @@ public class CommonController {
@Resource
private BsCompanyService bsCompanyService;
@Resource
private HighOrderService highOrderService;
@Resource
private BsIntegralRebateService bsIntegralRebateService;
@RequestMapping(value="/getDredgeProvince",method= RequestMethod.GET)
@ResponseBody
@ -321,7 +322,7 @@ public class CommonController {
@RequestMapping(value = "/findCompanyByCityName", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取定位信息")
public ResponseData findByLatAndLng(
public ResponseData findCompanyByCityName(
@RequestParam(name = "cityName", required = true) String cityName
) {
try {
@ -356,4 +357,41 @@ public class CommonController {
}
}
@RequestMapping(value = "/getRebateIntegral", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "查询可获取返利积分")
public ResponseData getRebateIntegral(@RequestBody JSONObject object) {
try {
if (object.getInteger("type") == null ||
object.getLong("companyId") == null ||
object.getLong("productId") == null ||
object.getBigDecimal("price") == null
) {
log.error("CommonController -> getRebateIntegral() error!","请求参数校验失败");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR);
}
// 查询订单来源
Map<String, Object> map = new HashMap<>();
map.put("type" , object.getInteger("type"));
map.put("productId" , object.getLong("productId"));
map.put("companyId" , object.getLong("companyId"));
BsIntegralRebate bsIntegralRebate = bsIntegralRebateService.findIntegralRebateByMap(map);
if (bsIntegralRebate == null) {
throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "暂无积分返利活动");
}
BigDecimal integralNum = object.getBigDecimal("price").multiply(bsIntegralRebate.getPercentage()).setScale( 0, BigDecimal.ROUND_HALF_UP );
return ResponseMsgUtil.success(integralNum);
} catch (Exception e) {
log.error("HighOrderController --> unionStagingPay() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -126,8 +126,9 @@ public class HighGasController {
for (Map<String, Object> map : mapPageInfo.getList()) {
if (StringUtils.isNotBlank(MapUtils.getString(map, "oil_no"))) {
if (MapUtils.getInteger(map, "source_type").equals(1)) {
if (MapUtils.getInteger(map, "source_type").equals(1)
|| MapUtils.getInteger(map, "source_type").equals(3)
|| MapUtils.getInteger(map, "source_type").equals(4)) {
// 查询是否配置了【油站的】优惠比例
HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(1, MapUtils.getLong(map, "id"), MapUtils.getString(map, "oil_no"));
if (tyAgentPrice != null) {

@ -35,6 +35,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.Array;
import java.util.*;
import java.util.stream.Collectors;
@ -118,20 +119,45 @@ public class HighThirdPartyController {
BigDecimal salesTallPrice = apiStarbucksProducts.getSalesTallPrice().add(apiStarbucksProducts.getMarketTallPrice().multiply(productDiscount.divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP);
BigDecimal salesGrandePrice = apiStarbucksProducts.getSalesGrandePrice().add(apiStarbucksProducts.getMarketGrandePrice().multiply(productDiscount.divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP);
if (salesVentiPrice.compareTo(apiStarbucksProducts.getMarketVentiPrice()) > 0) {
salesVentiPrice = apiStarbucksProducts.getMarketVentiPrice();
}
// 判断当前价格是否大雨原价 如果大于显示原价
if (salesTallPrice.compareTo(apiStarbucksProducts.getMarketTallPrice()) > 0) {
salesTallPrice = apiStarbucksProducts.getMarketTallPrice();
}
if (salesGrandePrice.compareTo(apiStarbucksProducts.getMarketGrandePrice()) > 0) {
salesGrandePrice = apiStarbucksProducts.getMarketGrandePrice();
}
if (salesVentiPrice.compareTo(apiStarbucksProducts.getMarketVentiPrice()) > 0) {
salesVentiPrice = apiStarbucksProducts.getMarketVentiPrice();
}
String[] strings = apiStarbucksProducts.getCupSize().split(",");
for (String string : strings) {
if ("中杯".equals(string)) {
apiStarbucksProducts.setShowPrice(salesTallPrice);
break;
}
if ("大杯".equals(string)) {
apiStarbucksProducts.setShowPrice(salesGrandePrice);
break;
}
if ("超大杯".equals(string)) {
apiStarbucksProducts.setShowPrice(salesVentiPrice);
break;
}
}
apiStarbucksProducts.setSalesVentiPrice(salesVentiPrice);
apiStarbucksProducts.setSalesTallPrice(salesTallPrice);
apiStarbucksProducts.setCount(0);
apiStarbucksProducts.setSalesGrandePrice(salesGrandePrice);
if (apiStarbucksProducts.getShowPrice() != null) {
starbucksProductsList.add(apiStarbucksProducts);
}
}
starbucksProducts.setName(s);
starbucksProducts.setExt2(SysConst.getSysConfig().getImgUrl() + ProductImgEnum.getNameByImgUrl(s));
starbucksProducts.setId((long) i);
@ -241,6 +267,7 @@ public class HighThirdPartyController {
salePriceF = productsObject.getBigDecimal("originalPrice");
}
productsObject.put("salePrice", salePriceF);
productsObject.put("count" , 0);
if (productsObject.getJSONArray("specGroups") != null) {
for (Object specGroups : productsObject.getJSONArray("specGroups")) {
@ -306,8 +333,6 @@ public class HighThirdPartyController {
SessionObject sessionObject = userCenter.getSessionObject(request);
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
System.out.println("======================================================" + object);
if (StringUtils.isBlank(object.getString("customerMobile")) ||
StringUtils.isBlank(object.getString("regionId")) ||
object.getInteger("productType") == null ||

@ -148,7 +148,7 @@ public class HighUserController {
if (StringUtils.isBlank(body.getString("password"))
|| body.getString("password").length() != 6){
log.error("HighUserController --> setUserPayPwd() error!", "请设置6位支付密码");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请设置6支付密码");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请设置6支付密码");
}
// 查询用户密码

@ -60,7 +60,7 @@
<root level="DEBUG">
<appender-ref ref="STDOUT" />
</root>
<logger name="com.hai" level="DEBUG">
<logger name="com.hai" level="INFO">
<appender-ref ref="baselog" />
</logger>
<logger name="com.hai.dao" level="DEBUG">

@ -84,9 +84,10 @@ public class HighCouponSchedule {
if (jsonObject.getString("respCode").equals("0000")) {
JSONObject data = HuiLianTongUnionCardConfig.resolveResponse(jsonObject.getString("data"));
if (data.getString("respCode").equals("0000") && data.getJSONObject("data").getInteger("state") != 20) {
couponCodeOther.setStatus(data.getJSONObject("data").getInteger("state"));
if (data.getString("respCode").equals("0000")) {
JSONObject responseObject = JSONObject.parseObject(data.getString("data"));
if (responseObject.getInteger("state") != 20) {
couponCodeOther.setStatus(responseObject.getInteger("state"));
highCouponCodeOtherMapper.updateByPrimaryKey(couponCodeOther);
if (couponCodeOther.getCouponAgentCodeId() != null) {
@ -103,7 +104,7 @@ public class HighCouponSchedule {
List<HighUserCoupon> list = highUserCouponMapper.selectByExample(userCouponExample);
if (list.size() > 0) {
HighUserCoupon userCoupon = list.get(0);
if (data.getJSONObject("data").getInteger("state") == 40) {
if (responseObject.getInteger("state") == 40) {
userCoupon.setStatus(2);
userCoupon.setConsumeTime(new Date());
} else {
@ -118,7 +119,7 @@ public class HighCouponSchedule {
highOrderService.childOrderComplete(couponCodeOther.getChildOrderId());
}
}
}
}
}
}

@ -101,7 +101,7 @@ public class HighOrderSchedule {
public void initRechargeOrder() {
Map<String, Object> map = new HashMap<>();
map.put("payStatus", String.valueOf(102));
map.put("rechargeStatus", String.valueOf(204));
map.put("rechargeStatus", String.valueOf(205));
List<OutRechargeOrder> orderList = outRechargeOrderService.getListRechargeOrder(map);
if (orderList.size() > 0) {
for (OutRechargeOrder order : orderList) {
@ -439,7 +439,7 @@ public class HighOrderSchedule {
* @Param []
* @return void
*/
@Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次
@Scheduled(cron="0 0/5 * * * ?") //每1分钟执行一次
public void integralRebateOrder() {
List<HighOrder> order = highOrderService.integralRebateOrder();
for (HighOrder highOrder : order) {
@ -477,7 +477,7 @@ public class HighOrderSchedule {
* @Param []
* @return void
*/
@Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次
@Scheduled(cron="0 0/5 * * * ?") //每1分钟执行一次
public void integralRebateRechargeOrder() {
List<OutRechargeOrder> order = outRechargeOrderService.integralRebateRechargeOrder();
for (OutRechargeOrder outRechargeOrder : order) {

File diff suppressed because one or more lines are too long

@ -60,7 +60,7 @@
<root level="DEBUG">
<appender-ref ref="STDOUT" />
</root>
<logger name="com.hai" level="DEBUG">
<logger name="com.hai" level="INFO">
<appender-ref ref="baselog" />
</logger>
<logger name="com.hai.dao" level="DEBUG">

@ -0,0 +1,10 @@
package com.hai.common.utils;
/**
* @author sum1dream
*/
public class CommonUtil {
}

@ -7,25 +7,21 @@ import com.hai.common.pay.util.sdk.WXPayXmlUtil;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.naming.NoNameCoder;
import com.thoughtworks.xstream.io.xml.XppDriver;
import net.sf.cglib.beans.BeanMap;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.conn.ssl.SSLContexts;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import java.io.File;
import java.io.FileInputStream;
import java.io.StringWriter;
import java.security.KeyStore;
import java.security.MessageDigest;
import java.security.SecureRandom;
import java.util.*;
@ -488,8 +484,10 @@ public class WxUtils {
continue;
}
if (data.get(k) != null) // 参数值为空,则不参与签名
{
sb.append(k).append("=").append(data.get(k)).append("&");
}
}
sb.append("apiKey=").append(key);
if (WXPayConstants.SignType.MD5.equals(signType)) {
return MD5(sb.toString() , true);
@ -502,4 +500,44 @@ public class WxUtils {
}
}
/**
* 用SHA1算法生成安全签名
* @param token 票据
* @param timestamp 时间戳
* @param nonce 随机字符串
* @return 安全签名
* @throws Exception
*/
public static String getSHA1(String token, String timestamp, String nonce) throws Exception
{
try {
String[] array = new String[] { token, timestamp, nonce};
StringBuffer sb = new StringBuffer();
// 字符串排序
Arrays.sort(array);
for (int i = 0; i < 3; i++) {
sb.append(array[i]);
}
String str = sb.toString();
// SHA1签名生成
MessageDigest md = MessageDigest.getInstance("SHA-1");
md.update(str.getBytes());
byte[] digest = md.digest();
StringBuffer hexstr = new StringBuffer();
String shaHex = "";
for (int i = 0; i < digest.length; i++) {
shaHex = Integer.toHexString(digest[i] & 0xFF);
if (shaHex.length() < 2) {
hexstr.append(0);
}
hexstr.append(shaHex);
}
return hexstr.toString();
} catch (Exception e) {
e.printStackTrace();
throw new Exception(String.format("Invalid sign_type: %s"));
}
}
}

@ -50,6 +50,7 @@ public class UnionUserConfig {
paramMap.remove("secret");
JSONObject jsonObject = JSONObject.parseObject(UnionUtils.sendPostGson(requestUrl+"backendToken", paramMap));
String backendToken = jsonObject.getJSONObject("params").getString("backendToken");
System.out.println(jsonObject + "=================================================");
redisUtil.set("UNION_BACKEND_TOKEN", backendToken,jsonObject.getJSONObject("params").getLong("expiresIn"));
return backendToken;
}

@ -45,14 +45,16 @@ public interface HighApproveMapper extends HighApproveMapperExt {
"create_time, update_time, ",
"submit_operator_id, submit_operator_name, ",
"approve_operator_id, approve_operator_name, ",
"ext_1, ext_2, ext_3)",
"ext_1, ext_2, ext_3, ",
"approve_object)",
"values (#{objectType,jdbcType=INTEGER}, #{objectId,jdbcType=BIGINT}, ",
"#{objectName,jdbcType=VARCHAR}, #{approveSerialNo,jdbcType=VARCHAR}, ",
"#{remarks,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=DATE}, ",
"#{submitOperatorId,jdbcType=BIGINT}, #{submitOperatorName,jdbcType=VARCHAR}, ",
"#{approveOperatorId,jdbcType=BIGINT}, #{approveOperatorName,jdbcType=VARCHAR}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, ",
"#{approveObject,jdbcType=LONGVARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighApprove record);
@ -61,6 +63,28 @@ public interface HighApproveMapper extends HighApproveMapperExt {
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(HighApprove record);
@SelectProvider(type=HighApproveSqlProvider.class, method="selectByExampleWithBLOBs")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="object_type", property="objectType", jdbcType=JdbcType.INTEGER),
@Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT),
@Result(column="object_name", property="objectName", jdbcType=JdbcType.VARCHAR),
@Result(column="approve_serial_no", property="approveSerialNo", jdbcType=JdbcType.VARCHAR),
@Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.DATE),
@Result(column="submit_operator_id", property="submitOperatorId", jdbcType=JdbcType.BIGINT),
@Result(column="submit_operator_name", property="submitOperatorName", jdbcType=JdbcType.VARCHAR),
@Result(column="approve_operator_id", property="approveOperatorId", jdbcType=JdbcType.BIGINT),
@Result(column="approve_operator_name", property="approveOperatorName", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR),
@Result(column="approve_object", property="approveObject", jdbcType=JdbcType.LONGVARCHAR)
})
List<HighApprove> selectByExampleWithBLOBs(HighApproveExample example);
@SelectProvider(type=HighApproveSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@ -71,7 +95,7 @@ public interface HighApproveMapper extends HighApproveMapperExt {
@Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.DATE),
@Result(column="submit_operator_id", property="submitOperatorId", jdbcType=JdbcType.BIGINT),
@Result(column="submit_operator_name", property="submitOperatorName", jdbcType=JdbcType.VARCHAR),
@Result(column="approve_operator_id", property="approveOperatorId", jdbcType=JdbcType.BIGINT),
@ -86,7 +110,7 @@ public interface HighApproveMapper extends HighApproveMapperExt {
"select",
"id, object_type, object_id, object_name, approve_serial_no, remarks, `status`, ",
"create_time, update_time, submit_operator_id, submit_operator_name, approve_operator_id, ",
"approve_operator_name, ext_1, ext_2, ext_3",
"approve_operator_name, ext_1, ext_2, ext_3, approve_object",
"from high_approve",
"where id = #{id,jdbcType=BIGINT}"
})
@ -99,20 +123,24 @@ public interface HighApproveMapper extends HighApproveMapperExt {
@Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.DATE),
@Result(column="submit_operator_id", property="submitOperatorId", jdbcType=JdbcType.BIGINT),
@Result(column="submit_operator_name", property="submitOperatorName", jdbcType=JdbcType.VARCHAR),
@Result(column="approve_operator_id", property="approveOperatorId", jdbcType=JdbcType.BIGINT),
@Result(column="approve_operator_name", property="approveOperatorName", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR),
@Result(column="approve_object", property="approveObject", jdbcType=JdbcType.LONGVARCHAR)
})
HighApprove selectByPrimaryKey(Long id);
@UpdateProvider(type=HighApproveSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") HighApprove record, @Param("example") HighApproveExample example);
@UpdateProvider(type=HighApproveSqlProvider.class, method="updateByExampleWithBLOBs")
int updateByExampleWithBLOBs(@Param("record") HighApprove record, @Param("example") HighApproveExample example);
@UpdateProvider(type=HighApproveSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") HighApprove record, @Param("example") HighApproveExample example);
@ -128,7 +156,29 @@ public interface HighApproveMapper extends HighApproveMapperExt {
"remarks = #{remarks,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=DATE},",
"submit_operator_id = #{submitOperatorId,jdbcType=BIGINT},",
"submit_operator_name = #{submitOperatorName,jdbcType=VARCHAR},",
"approve_operator_id = #{approveOperatorId,jdbcType=BIGINT},",
"approve_operator_name = #{approveOperatorName,jdbcType=VARCHAR},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR},",
"approve_object = #{approveObject,jdbcType=LONGVARCHAR}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKeyWithBLOBs(HighApprove record);
@Update({
"update high_approve",
"set object_type = #{objectType,jdbcType=INTEGER},",
"object_id = #{objectId,jdbcType=BIGINT},",
"object_name = #{objectName,jdbcType=VARCHAR},",
"approve_serial_no = #{approveSerialNo,jdbcType=VARCHAR},",
"remarks = #{remarks,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=DATE},",
"submit_operator_id = #{submitOperatorId,jdbcType=BIGINT},",
"submit_operator_name = #{submitOperatorName,jdbcType=VARCHAR},",
"approve_operator_id = #{approveOperatorId,jdbcType=BIGINT},",

@ -57,7 +57,7 @@ public class HighApproveSqlProvider {
}
if (record.getUpdateTime() != null) {
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}");
sql.VALUES("update_time", "#{updateTime,jdbcType=DATE}");
}
if (record.getSubmitOperatorId() != null) {
@ -88,6 +88,43 @@ public class HighApproveSqlProvider {
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}");
}
if (record.getApproveObject() != null) {
sql.VALUES("approve_object", "#{approveObject,jdbcType=LONGVARCHAR}");
}
return sql.toString();
}
public String selectByExampleWithBLOBs(HighApproveExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("object_type");
sql.SELECT("object_id");
sql.SELECT("object_name");
sql.SELECT("approve_serial_no");
sql.SELECT("remarks");
sql.SELECT("`status`");
sql.SELECT("create_time");
sql.SELECT("update_time");
sql.SELECT("submit_operator_id");
sql.SELECT("submit_operator_name");
sql.SELECT("approve_operator_id");
sql.SELECT("approve_operator_name");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.SELECT("approve_object");
sql.FROM("high_approve");
applyWhere(sql, example, false);
if (example != null && example.getOrderByClause() != null) {
sql.ORDER_BY(example.getOrderByClause());
}
return sql.toString();
}
@ -163,7 +200,7 @@ public class HighApproveSqlProvider {
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=DATE}");
}
if (record.getSubmitOperatorId() != null) {
@ -194,6 +231,37 @@ public class HighApproveSqlProvider {
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
}
if (record.getApproveObject() != null) {
sql.SET("approve_object = #{record.approveObject,jdbcType=LONGVARCHAR}");
}
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByExampleWithBLOBs(Map<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("high_approve");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("object_type = #{record.objectType,jdbcType=INTEGER}");
sql.SET("object_id = #{record.objectId,jdbcType=BIGINT}");
sql.SET("object_name = #{record.objectName,jdbcType=VARCHAR}");
sql.SET("approve_serial_no = #{record.approveSerialNo,jdbcType=VARCHAR}");
sql.SET("remarks = #{record.remarks,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=DATE}");
sql.SET("submit_operator_id = #{record.submitOperatorId,jdbcType=BIGINT}");
sql.SET("submit_operator_name = #{record.submitOperatorName,jdbcType=VARCHAR}");
sql.SET("approve_operator_id = #{record.approveOperatorId,jdbcType=BIGINT}");
sql.SET("approve_operator_name = #{record.approveOperatorName,jdbcType=VARCHAR}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
sql.SET("approve_object = #{record.approveObject,jdbcType=LONGVARCHAR}");
HighApproveExample example = (HighApproveExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
@ -210,7 +278,7 @@ public class HighApproveSqlProvider {
sql.SET("remarks = #{record.remarks,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=DATE}");
sql.SET("submit_operator_id = #{record.submitOperatorId,jdbcType=BIGINT}");
sql.SET("submit_operator_name = #{record.submitOperatorName,jdbcType=VARCHAR}");
sql.SET("approve_operator_id = #{record.approveOperatorId,jdbcType=BIGINT}");
@ -257,7 +325,7 @@ public class HighApproveSqlProvider {
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{updateTime,jdbcType=DATE}");
}
if (record.getSubmitOperatorId() != null) {
@ -288,6 +356,10 @@ public class HighApproveSqlProvider {
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}");
}
if (record.getApproveObject() != null) {
sql.SET("approve_object = #{approveObject,jdbcType=LONGVARCHAR}");
}
sql.WHERE("id = #{id,jdbcType=BIGINT}");
return sql.toString();

@ -1250,7 +1250,7 @@ public interface HighOrderMapperExt {
})
List<SelfOilStationModel> getSelfOilStationOrderList(@Param("goodsId") String goodsId);
@Select("select * from high_order where order_status = 3 and pay_type != 3 and pay_real_price > 0 and whether_rebate = false ")
@Select("select * from high_order where order_status = 3 and pay_type != 3 and pay_real_price > 0 and whether_rebate = false group by create_time desc;")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),

@ -147,7 +147,7 @@ public interface OutRechargeOrderMapperExt {
})
OrderCountModel rechargeOrderByIndex(Integer code);
@Select("select * from out_recharge_order where recharge_status = 202 and pay_status = 100 and pay_type != 3 and pay_real_price > 0 and whether_rebate = false ")
@Select("select * from out_recharge_order where recharge_status = 202 and pay_status = 100 and pay_type != 3 and pay_real_price > 0 and whether_rebate = false group by create_timed desc ; ")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="recharge_price", property="rechargePrice", jdbcType=JdbcType.DECIMAL),

@ -129,6 +129,18 @@ public class ApiStarbucksProducts implements Serializable {
*/
private Integer status;
private Integer count;
private BigDecimal showPrice;
public BigDecimal getShowPrice() {
return showPrice;
}
public void setShowPrice(BigDecimal showPrice) {
this.showPrice = showPrice;
}
/**
* ext_1
*/
@ -144,6 +156,14 @@ public class ApiStarbucksProducts implements Serializable {
*/
private String ext3;
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
private static final long serialVersionUID = 1L;
public Long getId() {

@ -19,7 +19,7 @@ public class HighApprove implements Serializable {
private Long id;
/**
* 审批对象 1:卡券上架审批 2:卡卷价格审批
* 审批对象 1:卡券上架审批 2:卡卷价格审批 3:卡券分发审批
*/
private Integer objectType;
@ -84,6 +84,11 @@ public class HighApprove implements Serializable {
private String ext3;
/**
* 审批对象
*/
private String approveObject;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -214,6 +219,14 @@ public class HighApprove implements Serializable {
this.ext3 = ext3;
}
public String getApproveObject() {
return approveObject;
}
public void setApproveObject(String approveObject) {
this.approveObject = approveObject;
}
@Override
public boolean equals(Object that) {
if (this == that) {
@ -241,7 +254,8 @@ public class HighApprove implements Serializable {
&& (this.getApproveOperatorName() == null ? other.getApproveOperatorName() == null : this.getApproveOperatorName().equals(other.getApproveOperatorName()))
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1()))
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2()))
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3()));
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3()))
&& (this.getApproveObject() == null ? other.getApproveObject() == null : this.getApproveObject().equals(other.getApproveObject()));
}
@Override
@ -264,6 +278,7 @@ public class HighApprove implements Serializable {
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode());
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode());
result = prime * result + ((getApproveObject() == null) ? 0 : getApproveObject().hashCode());
return result;
}
@ -289,6 +304,7 @@ public class HighApprove implements Serializable {
sb.append(", ext1=").append(ext1);
sb.append(", ext2=").append(ext2);
sb.append(", ext3=").append(ext3);
sb.append(", approveObject=").append(approveObject);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();

@ -2,6 +2,7 @@ package com.hai.entity;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
public class HighApproveExample {
@ -125,6 +126,32 @@ public class HighApproveExample {
criteria.add(new Criterion(condition, value1, value2));
}
protected void addCriterionForJDBCDate(String condition, Date value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
addCriterion(condition, new java.sql.Date(value.getTime()), property);
}
protected void addCriterionForJDBCDate(String condition, List<Date> values, String property) {
if (values == null || values.size() == 0) {
throw new RuntimeException("Value list for " + property + " cannot be null or empty");
}
List<java.sql.Date> dateList = new ArrayList<java.sql.Date>();
Iterator<Date> iter = values.iterator();
while (iter.hasNext()) {
dateList.add(new java.sql.Date(iter.next().getTime()));
}
addCriterion(condition, dateList, property);
}
protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property);
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
@ -646,52 +673,52 @@ public class HighApproveExample {
}
public Criteria andUpdateTimeEqualTo(Date value) {
addCriterion("update_time =", value, "updateTime");
addCriterionForJDBCDate("update_time =", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Date value) {
addCriterion("update_time <>", value, "updateTime");
addCriterionForJDBCDate("update_time <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Date value) {
addCriterion("update_time >", value, "updateTime");
addCriterionForJDBCDate("update_time >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("update_time >=", value, "updateTime");
addCriterionForJDBCDate("update_time >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Date value) {
addCriterion("update_time <", value, "updateTime");
addCriterionForJDBCDate("update_time <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
addCriterion("update_time <=", value, "updateTime");
addCriterionForJDBCDate("update_time <=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Date> values) {
addCriterion("update_time in", values, "updateTime");
addCriterionForJDBCDate("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Date> values) {
addCriterion("update_time not in", values, "updateTime");
addCriterionForJDBCDate("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
addCriterion("update_time between", value1, value2, "updateTime");
addCriterionForJDBCDate("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
addCriterionForJDBCDate("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}

@ -7,7 +7,8 @@ package com.hai.enum_type;
*/
public enum ApproveType {
UP_SHELF_APPROVE(1, "卡卷上架审批"),
COUPON_PRICE_APPROVE(2, "卡卷价格审批")
COUPON_PRICE_APPROVE(2, "卡卷价格审批"),
COUPON_DISTRIBUTE_APPROVE(3, "卡卷分发审批"),
;
private Integer type;

@ -77,8 +77,24 @@ public interface BsIntegralRebateService {
**/
void deleteIntegralRebate(Long id);
/**
* @Author Sum1Dream
* @Name integralRebate
* @Description // 订单积分返利
* @Date 11:32 2022/9/1
* @Param [object]
* @Return void
*/
void integralRebate(JSONObject object);
/**
* @Author Sum1Dream
* @Name integralRechargeRebate
* @Description // 话费订单返利
* @Date 11:33 2022/9/1
* @Param [object]
* @Return void
*/
void integralRechargeRebate(JSONObject object);
}

@ -15,6 +15,8 @@ import com.hai.model.IndexCountModel;
import com.hai.model.LineCountModel;
import com.hai.model.OrderCountModel;
import com.hai.model.OrderSumModel;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.bean.result.WxMpQrCodeTicket;
import org.apache.ibatis.type.BigDecimalTypeHandler;
import java.math.BigDecimal;
@ -293,4 +295,5 @@ public interface CommonService {
*/
ApiCity findCityByName(String name);
}

@ -73,6 +73,16 @@ public interface HighCouponService {
**/
void priceApproveResult(HighApprove highApprove);
/**
* @Author Sum1Dream
* @Name distributeApprove
* @Description // 卡券分发审批
* @Date 16:57 2022/8/31
* @Param [highApprove]
* @Return void
*/
void distributeApprove(HighApprove highApprove);
/**
* @Author 胡锐
* @Description 根据id查询卡卷基本信息赠送信息
@ -105,6 +115,13 @@ public interface HighCouponService {
**/
List<HighCoupon> getCouponList(Map<String, Object> map);
/**
* @Author 胡锐
* @Description 获取卡卷集合
* @Date 2021/3/15 23:12
**/
List<HighCoupon> getCouponListByAll(Map<String, Object> map);
/**
* @Author 胡锐
* @Description 获取数量

@ -17,7 +17,9 @@ 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 org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@ -694,5 +696,4 @@ public class CommonServiceImpl implements CommonService {
}
}

@ -1,15 +1,16 @@
package com.hai.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.dao.HighApproveMapper;
import com.hai.entity.HighApprove;
import com.hai.entity.HighApproveExample;
import com.hai.entity.HighCoupon;
import com.hai.entity.*;
import com.hai.enum_type.ApproveType;
import com.hai.model.HighCouponModel;
import com.hai.service.HighAgentService;
import com.hai.service.HighApproveService;
import com.hai.service.HighCouponAgentService;
import com.hai.service.HighCouponService;
import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service;
@ -36,8 +37,9 @@ public class HighApproveServiceImpl implements HighApproveService {
@Resource
private HighCouponService highCouponService;
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
@Transactional(propagation= Propagation.REQUIRES_NEW ,rollbackFor = Exception.class)
public void insertApprove(HighApprove highApprove) {
// 卡卷上架审批
@ -49,6 +51,11 @@ public class HighApproveServiceImpl implements HighApproveService {
if (Objects.equals(highApprove.getObjectType(), ApproveType.COUPON_PRICE_APPROVE.getType())) {
// 暂时不需要调用接口
}
// 卡卷分发审批
if (Objects.equals(highApprove.getObjectType(), ApproveType.COUPON_DISTRIBUTE_APPROVE.getType())) {
// 暂时不需要调用接口
}
highApproveMapper.insert(highApprove);
}
@ -64,14 +71,18 @@ public class HighApproveServiceImpl implements HighApproveService {
@Override
public void approveProcessed(HighApprove highApprove) {
if (highApprove.getObjectType() == ApproveType.UP_SHELF_APPROVE.getType()) {
if (highApprove.getObjectType().equals(ApproveType.UP_SHELF_APPROVE.getType())) {
highCouponService.upShelfApproveResult(highApprove);
}
if (highApprove.getObjectType() == ApproveType.COUPON_PRICE_APPROVE.getType()) {
if (highApprove.getObjectType().equals(ApproveType.COUPON_PRICE_APPROVE.getType())) {
highCouponService.priceApproveResult(highApprove);
}
if (highApprove.getObjectType().equals(ApproveType.COUPON_DISTRIBUTE_APPROVE.getType())) {
highCouponService.distributeApprove(highApprove);
}
updateApprove(highApprove);
}

@ -71,7 +71,7 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService {
private HighCouponCodeOtherService couponCodeOtherService;
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
@Transactional(propagation= Propagation.REQUIRES_NEW , rollbackFor = Exception.class)
public void assignCouponAgent(HighCouponAgentRel highCouponAgentRel,Integer stockCount) {
if (highCouponAgentRel.getId() != null) {
highCouponAgentRelMapper.updateByPrimaryKey(highCouponAgentRel);

@ -1,6 +1,7 @@
package com.hai.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
@ -33,6 +34,9 @@ public class HighCouponServiceImpl implements HighCouponService {
@Resource
private HighCouponMapper highCouponMapper;
@Resource
private HighCouponService highCouponService;
@Resource
private HighCouponHandselService highCouponHandselService;
@ -51,6 +55,13 @@ public class HighCouponServiceImpl implements HighCouponService {
@Resource
private HighApproveService highApproveService;
@Resource
private HighAgentService highAgentService;
@Resource
private HighCouponAgentService highCouponAgentService;
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void insertCoupon(HighCoupon highCouponModel) {
@ -279,6 +290,53 @@ public class HighCouponServiceImpl implements HighCouponService {
highGoodsPriceReferService.updatePriceRefer(highGoodsPriceRefer);
}
@Override
public void distributeApprove(HighApprove highApprove) {
JSONObject object = JSONObject.parseObject(highApprove.getApproveObject());
if (highApprove.getStatus() == 3) {
// 查询卡券详情
HighCoupon coupon = highCouponService.getCouponById(object.getLong("couponId"));
if (coupon == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_COUPON, "");
}
// 查询代理商
HighAgent highAgent = highAgentService.findByAgentMsgId(object.getLong("agentId"));
if (highAgent == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_AGENT, "");
}
// 校验是否分配过
HighCouponAgentRel couponAgent = highCouponAgentService.getRelByCouponAgent(object.getLong("couponId"), object.getLong("agentId"), object.getInteger("type"));
if (couponAgent != null) {
couponAgent.setStockCount(couponAgent.getStockCount() + object.getInteger("stockCount"));
couponAgent.setOperatorId(highApprove.getSubmitOperatorId());
couponAgent.setOperatorName(highApprove.getSubmitOperatorName());
highCouponAgentService.assignCouponAgent(couponAgent,object.getInteger("stockCount"));
} else {
HighCouponAgentRel highCouponAgentRel = new HighCouponAgentRel();
highCouponAgentRel.setCouponName(coupon.getCouponName());
highCouponAgentRel.setSalesPrice(coupon.getSalesPrice());
// 状态 0:删除 1:正常
highCouponAgentRel.setStatus(1);
highCouponAgentRel.setSalesCount(0);
highCouponAgentRel.setType(object.getInteger("type"));
highCouponAgentRel.setCouponId(object.getLong("couponId"));
highCouponAgentRel.setAgentId(object.getLong("agentId"));
highCouponAgentRel.setStockCount(object.getInteger("stockCount"));
highCouponAgentRel.setCreateTime(new Date());
highCouponAgentRel.setOperatorId(highApprove.getSubmitOperatorId());
highCouponAgentRel.setOperatorName(highApprove.getSubmitOperatorName());
highCouponAgentService.assignCouponAgent(highCouponAgentRel,highCouponAgentRel.getStockCount());
}
}
}
@Override
public HighCoupon getCouponById(Long id) {
HighCoupon highCoupon = highCouponMapper.selectByPrimaryKey(id);
@ -390,6 +448,60 @@ public class HighCouponServiceImpl implements HighCouponService {
return coupons;
}
@Override
public List<HighCoupon> getCouponListByAll(Map<String, Object> map) {
HighCouponExample example = new HighCouponExample();
HighCouponExample.Criteria criteria = example.createCriteria();
if (MapUtils.getLong(map, "companyId") != null) {
criteria.andCompanyIdEqualTo(MapUtils.getLong(map, "companyId"));
}
if (MapUtils.getLong(map, "merchantId") != null) {
criteria.andMerchantIdEqualTo(MapUtils.getLong(map, "merchantId"));
}
if (StringUtils.isNotBlank(MapUtils.getString(map, "couponName"))) {
criteria.andCouponNameLike("%" + MapUtils.getString(map, "couponName") + "%");
}
if (MapUtils.getInteger(map, "couponType") != null) {
criteria.andCouponTypeEqualTo(MapUtils.getInteger(map, "couponType"));
}
if (MapUtils.getInteger(map, "displayArea") != null) {
criteria.andDisplayAreaEqualTo(MapUtils.getInteger(map, "displayArea"));
}
if (MapUtils.getInteger(map, "displayArea") != null) {
criteria.andDisplayAreaEqualTo(MapUtils.getInteger(map, "displayArea"));
}
if (MapUtils.getInteger(map, "brandId") != null) {
criteria.andBrandIdEqualTo(MapUtils.getInteger(map, "brandId"));
}
if (MapUtils.getInteger(map, "goodsTypeId") != null) {
criteria.andGoodsTypeIdEqualTo(MapUtils.getInteger(map, "goodsTypeId"));
}
if (MapUtils.getInteger(map, "status") != null) {
criteria.andStatusEqualTo(MapUtils.getInteger(map, "status"));
}
if (MapUtils.getInteger(map, "couponSource") != null) {
criteria.andCouponSourceEqualTo(MapUtils.getInteger(map, "status"));
}
if (MapUtils.getInteger(map, "notCouponSource") != null) {
criteria.andCouponSourceNotEqualTo(MapUtils.getInteger(map, "notCouponSource"));
}
example.setOrderByClause("create_time");
return highCouponMapper.selectByExample(example);
}
@Override
public Long getCouponByCouponName(Long companyId,String couponName) {
HighCouponExample example = new HighCouponExample();

@ -2262,8 +2262,6 @@ public class HighOrderServiceImpl implements HighOrderService {
// 1 星巴克 2 肯德基 3 会员充值
if (object.getInteger("productType") == 1) {
List<String> List = new ArrayList<>();
JSONArray array = object.getJSONArray("orderItems");
@ -2292,7 +2290,7 @@ public class HighOrderServiceImpl implements HighOrderService {
if (!object1.getString("milkBubble").equals("")) {
contentMap.put("milkBubble", object1.getString("milkBubble"));
}
if (!object1.getString("num").equals("")) {
if (!"".equals(object1.getString("num"))) {
contentMap.put("num", object1.getString("num"));
}
List.add(JSON.toJSONString(contentMap));

@ -166,6 +166,19 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
DateUtil.format(MapUtils.getString(map, "createTimeE"), "yyyy-MM-dd HH:mm:ss"));
}
if (MapUtils.getBoolean(map , "whetherTimeOut") != null && MapUtils.getBoolean(map , "whetherTimeOut")) {
// 获取当前时间
Date date= new Date();
Calendar calendar = new GregorianCalendar();
calendar.setTime(date);
// 把日期往前减少三天,整数 往后推,负数往前移动
calendar.add(Calendar.DATE, -3);
// 这个时间就是日期往后推一天的结果
date = calendar.getTime();
criteria.andCreateTimedLessThan(date);
}
example.setOrderByClause("create_timed desc");
return outRechargeOrderMapper.selectByExample(example);
}
@ -962,7 +975,7 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
}
if (childOrder.getStatus() == 103) {
outRechargeOrder.setRechargeStatus(204);
outRechargeOrder.setRechargeStatus(205);
}
outRechargeOrderService.updateOrder(outRechargeOrder);
System.out.println("话费定时任务 -> 需要重新充值:结束");

@ -95,6 +95,7 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/thirdParty/*")
.excludePathPatterns("/selfOilStation/*")
.excludePathPatterns("/order/*")
.excludePathPatterns("/wxMsg/*")
;
}

@ -9,5 +9,22 @@ import org.springframework.stereotype.Component;
@PropertySource("classpath:/config.properties")
public class SysConfig {
private String wxH5AppId;
private String wxH5AppSecret;
public String getWxH5AppId() {
return wxH5AppId;
}
public void setWxH5AppId(String wxH5AppId) {
this.wxH5AppId = wxH5AppId;
}
public String getWxH5AppSecret() {
return wxH5AppSecret;
}
public void setWxH5AppSecret(String wxH5AppSecret) {
this.wxH5AppSecret = wxH5AppSecret;
}
}

@ -0,0 +1,121 @@
package com.v1.config;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.result.WxMpQrCodeTicket;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.io.File;
/**
* @serviceName WeChatQrcodeUtils.java
* @author Sum1Dream
* @version 1.0.0
* @Description // 生成带参数的二维码
* @createTime 16:11 2022/9/2
**/
@Slf4j
@Component
public class WeChatQrcodeUtils {
@Autowired
private WxMpService wxMpService;
/**
* <pre>
* 创建临时二维码ticket
* @param sceneId 场景值ID临时二维码时为32位非0整型
* @param expireSeconds 该二维码有效时间以秒为单位 最大不超过2592000即30天此字段如果不填则默认有效期为30秒
* @auther: cao_wencao
* @date: 2019/2/18 16:58
* </pre>
*/
public WxMpQrCodeTicket qrCodeCreateTmpTicket(int sceneId, Integer expireSeconds) throws WxErrorException {
WxMpQrCodeTicket wxMpQrCodeTicket = wxMpService.getQrcodeService().qrCodeCreateTmpTicket(sceneId, expireSeconds);
return wxMpQrCodeTicket;
}
/**
* <pre>
* 创建临时二维码ticket
* @param sceneStr 场景值ID字符串形式的ID字符串类型长度限制为1到64
* @param expireSeconds 该二维码有效时间以秒为单位 最大不超过2592000即30天此字段如果不填则默认有效期为30秒
* @auther: cao_wencao
* @date: 2019/2/18 17:01
* </pre>
*/
public WxMpQrCodeTicket qrCodeCreateTmpTicket(String sceneStr, Integer expireSeconds) throws WxErrorException {
WxMpQrCodeTicket wxMpQrCodeTicket = wxMpService.getQrcodeService().qrCodeCreateTmpTicket(sceneStr, expireSeconds);
return wxMpQrCodeTicket;
}
/**
* <pre>
* 创建永久二维码ticket
* @param sceneId 场景值ID最大值为100000目前参数只支持1--100000
* @auther: cao_wencao
* @date: 2019/2/18 17:03
* </pre>
*/
public WxMpQrCodeTicket qrCodeCreateLastTicket(int sceneId) throws WxErrorException {
return wxMpService.getQrcodeService().qrCodeCreateLastTicket(sceneId);
}
/**
* <pre>
* 创建永久字符串二维码ticket
* @param sceneStr 参数字符串类型长度现在为1到64
* @auther: cao_wencao
* @date: 2019/2/18 17:05
* </pre>
*/
public WxMpQrCodeTicket qrCodeCreateLastTicket(String sceneStr) throws WxErrorException {
return wxMpService.getQrcodeService().qrCodeCreateLastTicket(sceneStr);
}
/**
* <pre>
* 换取二维码图片文件jpg格式
* @param ticket 二维码ticket
* @auther: cao_wencao
* @date: 2019/2/18 17:07
* </pre>
*/
public File qrCodePicture(WxMpQrCodeTicket ticket) throws WxErrorException {
return wxMpService.getQrcodeService().qrCodePicture(ticket);
}
/**
* <pre>
* 换取二维码图片url地址可以选择是否生成压缩的网址
* @param ticket 二维码ticket
* @param needShortUrl 是否需要压缩的二维码地址
* @auther: cao_wencao
* @date: 2019/2/18 17:10
* </pre>
*/
public String qrCodePictureUrl(String ticket, boolean needShortUrl) throws WxErrorException {
String qrCodeUrl = wxMpService.getQrcodeService().qrCodePictureUrl(ticket, needShortUrl);
return qrCodeUrl;
}
/**
* <pre>
* 换取二维码图片url地址
* @param ticket 二维码ticket
* @auther: cao_wencao
* @date: 2019/2/18 17:11
* </pre>
*/
public String qrCodePictureUrl(String ticket) throws WxErrorException {
String url = wxMpService.getQrcodeService().qrCodePictureUrl(ticket);
return url;
}
}

@ -0,0 +1,51 @@
package com.v1.config;
import com.hai.config.CommonSysConst;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
import me.chanjar.weixin.mp.config.WxMpConfigStorage;
import me.chanjar.weixin.mp.config.impl.WxMpDefaultConfigImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @serviceName .java
* @author Sum1Dream
* @version 1.0.0
* @Description //TODO
* @createTime 16:24 2022/9/2
**/
@Configuration
public class WxConfig {
/**
* 微信客户端配置存储
*
* @return
*/
@Bean
public WxMpConfigStorage wxMpConfigStorage() {
WxMpDefaultConfigImpl configStorage = new WxMpDefaultConfigImpl();
// 公众号appId
configStorage.setAppId(SysConst.getSysConfig().getWxH5AppId());
// 公众号appSecret
configStorage.setSecret(SysConst.getSysConfig().getWxH5AppSecret());
return configStorage;
}
/**
* @Author Sum1Dream
* @Name wxMpService
* @Description //TODO
* @Date 16:24 2022/9/2
* @Param []
* @Return WxMpService
*/
@Bean
public WxMpService wxMpService() {
WxMpService wxMpService = new WxMpServiceImpl();
wxMpService.setWxMpConfigStorage(wxMpConfigStorage());
return wxMpService;
}
}

@ -0,0 +1,140 @@
package com.v1.controller;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.pay.util.IOUtil;
import com.hai.common.pay.util.XmlUtil;
import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.common.utils.WxUtils;
import com.hai.model.ResponseData;
import com.hai.service.CommonService;
import com.v1.config.SysConst;
import com.v1.config.WeChatQrcodeUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import me.chanjar.weixin.common.error.WxErrorException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
import java.util.SortedMap;
/**
* @author sum1dream
*/
@Controller
@RequestMapping(value = "/wxMsg")
@Api(value = "自建站接口")
public class WxMsgController {
private static Logger log = LoggerFactory.getLogger(ThirdPartyController.class);
@Autowired
private WeChatQrcodeUtils weChatQrcodeUtils;
@RequestMapping(value = "/verifyWxToken", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "验证servlet")
public String verifyWxToken(HttpServletRequest request) {
try {
log.info("进入公众号!!!!!!!");
// 反馈给微信服务器
String resXml = "";
// 微信支付系统发送的数据(<![CDATA[product_001]]>格式)
String notifyXml;
notifyXml = IOUtil.inputStreamToString(request.getInputStream(), "UTF-8");
log.info("微信支付系统发送的数据:" + notifyXml);
SortedMap<String, String> map = XmlUtil.parseXmlToTreeMap(notifyXml, "UTF-8");
// 区分消息类型
String msgType = map.get("MsgType");
log.info("微信支付系统发送的数据:" + msgType);
return null;
} catch (Exception e) {
return null;
}
}
@RequestMapping(value = "/getWxToken", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "获取微信token")
public ResponseData getWxToken() {
try {
Map<String, Object> params = new HashMap<>();
params.put("appid", SysConst.getSysConfig().getWxH5AppId());
params.put("secret", SysConst.getSysConfig().getWxH5AppSecret());
params.put("grant_type", "client_credential");
JSONObject accessTokenObject = HttpsUtils.doGet("https://api.weixin.qq.com/cgi-bin/token", params);
if (accessTokenObject == null) {
log.error("getH5UserInfo error!", "获取微信access_token失败" );
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "获取微信access_token失败");
}
return ResponseMsgUtil.success(accessTokenObject);
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
/**
* <pre>
* @desc: 创建生成二维码
* @auth: cao_wencao
* @date: 2019/4/10 14:00
* </pre>
*/
@RequestMapping(value = "/createQrcode", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "创建生成二维码")
public ResponseData createQrcode(@RequestParam(name = "sceneId", required = false) Integer sceneId) {
try {
return ResponseMsgUtil.success(weChatQrcodeUtils.qrCodeCreateLastTicket(sceneId));
} catch (WxErrorException e) {
return ResponseMsgUtil.exception(e);
}
}
/**
* <pre>
* @desc: 通过ticket获取二维码长链接URL
* @auth: cao_wencao
* @date: 2019/4/10 14:00
* </pre>
*/
@RequestMapping(value = "/getQrcodeUrl", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "创建生成二维码")
public ResponseData getQrcodeUrl(@RequestParam(name = "ticket", required = false) String ticket) {
try {
return ResponseMsgUtil.success(weChatQrcodeUtils.qrCodePictureUrl(ticket));
} catch (WxErrorException e) {
return ResponseMsgUtil.exception(e);
}
}
}

@ -0,0 +1,2 @@
wxH5AppId=wxa075e8509802f826
wxH5AppSecret=0e606fc1378d35e359fcf3f15570b2c5

@ -63,6 +63,9 @@
<logger name="com.hai" level="DEBUG">
<appender-ref ref="baselog" />
</logger>
<logger name="com.hai" level="INFO">
<appender-ref ref="baselog" />
</logger>
<logger name="com.hai.dao" level="DEBUG">
<appender-ref ref="daolog" />
</logger>

Loading…
Cancel
Save