Merge remote-tracking branch 'origin/dev' into dev

dev-discount
袁野 3 years ago
commit 8350e9acef
  1. 11
      hai-bweb/src/main/java/com/bweb/controller/CommonController.java
  2. 106
      hai-bweb/src/main/java/com/bweb/controller/HighCouponCodeController.java
  3. 60
      hai-bweb/src/main/java/com/bweb/controller/HighGasController.java
  4. 113
      hai-bweb/src/main/java/com/bweb/controller/HighTyAgentPriceController.java
  5. 76
      hai-cweb/src/main/java/com/cweb/controller/HighGasController.java
  6. 27
      hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java
  7. 2
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  8. 14
      hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java
  9. 8
      hai-cweb/src/main/java/com/cweb/controller/pay/WechatPayController.java
  10. 2
      hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java
  11. 28
      hai-service/src/main/java/com/hai/config/CommonSysConfig.java
  12. 10
      hai-service/src/main/java/com/hai/config/UnionUserConfig.java
  13. 2
      hai-service/src/main/java/com/hai/config/WxOrderConfig.java
  14. 20
      hai-service/src/main/java/com/hai/dao/HighCouponCodeMapperExt.java
  15. 11
      hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapper.java
  16. 1
      hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapperExt.java
  17. 14
      hai-service/src/main/java/com/hai/dao/HighGasOilPriceSqlProvider.java
  18. 38
      hai-service/src/main/java/com/hai/dao/HighTyAgentPriceMapper.java
  19. 42
      hai-service/src/main/java/com/hai/dao/HighTyAgentPriceSqlProvider.java
  20. 16
      hai-service/src/main/java/com/hai/entity/HighGasOilPrice.java
  21. 60
      hai-service/src/main/java/com/hai/entity/HighGasOilPriceExample.java
  22. 48
      hai-service/src/main/java/com/hai/entity/HighTyAgentPrice.java
  23. 190
      hai-service/src/main/java/com/hai/entity/HighTyAgentPriceExample.java
  24. 36
      hai-service/src/main/java/com/hai/enum_type/GasOilPriceStatusEnum.java
  25. 62
      hai-service/src/main/java/com/hai/model/GzSinopecModel.java
  26. 8
      hai-service/src/main/java/com/hai/service/HighCouponCodeService.java
  27. 16
      hai-service/src/main/java/com/hai/service/HighTyAgentPriceService.java
  28. 1
      hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java
  29. 13
      hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java
  30. 4
      hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceServiceImpl.java
  31. 15
      hai-service/src/main/java/com/hai/service/impl/HighTyAgentOilStationServiceImpl.java
  32. 15
      hai-service/src/main/java/com/hai/service/impl/HighTyAgentPriceServiceImpl.java
  33. 81
      hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java
  34. 5
      hai-service/src/main/resources/dev/commonConfig.properties
  35. 5
      hai-service/src/main/resources/pre/commonConfig.properties
  36. 4
      hai-service/src/main/resources/prod-9401/commonConfig.properties
  37. 5
      hai-service/src/main/resources/prod/commonConfig.properties

@ -5,6 +5,7 @@ import com.hai.common.utils.DateUtil;
import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.TuanYouConfig; import com.hai.config.TuanYouConfig;
import com.hai.entity.SecConfig; import com.hai.entity.SecConfig;
import com.hai.entity.SecDictionary;
import com.hai.model.*; import com.hai.model.*;
import com.hai.service.CommonService; import com.hai.service.CommonService;
import com.hai.service.SecConfigService; import com.hai.service.SecConfigService;
@ -16,8 +17,11 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Comparator;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@RestController @RestController
@ -87,8 +91,11 @@ public class CommonController {
@ApiOperation(value = "根据 码值类型 查询数据字典") @ApiOperation(value = "根据 码值类型 查询数据字典")
public ResponseData getDictionaryByCodeType(@RequestParam(name = "codeType", required = true) String codeType) { public ResponseData getDictionaryByCodeType(@RequestParam(name = "codeType", required = true) String codeType) {
try { try {
List<SecDictionary> list = commonService.getDictionarys(codeType);
return ResponseMsgUtil.success(commonService.getDictionarys(codeType)); if (list != null && list.size() > 0) {
list = list.stream().sorted(Comparator.comparingDouble(entry -> entry.getSortId())).collect(Collectors.toList());
}
return ResponseMsgUtil.success(list);
} catch (Exception e) { } catch (Exception e) {
log.error("CommonController --> getDictionaryByCodeType() error!", e); log.error("CommonController --> getDictionaryByCodeType() error!", e);

@ -1,6 +1,8 @@
package com.bweb.controller; package com.bweb.controller;
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.bweb.config.SysConst;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorCode;
@ -8,7 +10,10 @@ import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode; import com.hai.common.exception.SysCode;
import com.hai.common.security.SessionObject; import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter; import com.hai.common.security.UserCenter;
import com.hai.common.utils.DateUtil;
import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.ResponseMsgUtil;
import com.hai.model.GzSinopecModel;
import com.hai.model.OilCardOrderModel;
import com.hai.model.ResponseData; import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel; import com.hai.model.UserInfoModel;
import com.hai.service.HighCouponCodeService; import com.hai.service.HighCouponCodeService;
@ -22,7 +27,10 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -94,4 +102,102 @@ public class HighCouponCodeController {
return ResponseMsgUtil.exception(e); return ResponseMsgUtil.exception(e);
} }
} }
@RequestMapping(value="/getGzSinopecAssignList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询贵州中石化分配列表")
public ResponseData getGzSinopecAssignList(@RequestParam(name = "couponName", required = false) String couponName,
@RequestParam(name = "status", required = false) Integer status,
@RequestParam(name = "assignTimeS", required = false) Long assignTimeS,
@RequestParam(name = "assignTimeE", required = false) Long assignTimeE,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
Map<String, Object> map = new HashMap<>();
map.put("couponName", couponName);
map.put("status", status);
map.put("assignTimeS", assignTimeS);
map.put("assignTimeE", assignTimeE);
PageHelper.startPage(pageNum, pageSize);
return ResponseMsgUtil.success(new PageInfo<>(highCouponCodeService.getGzSinopecAssignList(map)));
} catch (Exception e) {
log.error("HighCouponController -> getGzSinopeAssigncList() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/importGzSinopecAssign",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "导出贵州中石化分配列表")
public ResponseData importGzSinopecAssign(@RequestParam(name = "couponName", required = false) String couponName,
@RequestParam(name = "assignTimeS", required = false) Long assignTimeS,
@RequestParam(name = "assignTimeE", required = false) Long assignTimeE,
@RequestParam(name = "status", required = false) Integer status) {
try {
Map<String, Object> map = new HashMap<>();
map.put("couponName", couponName);
map.put("status", status);
map.put("assignTimeS", assignTimeS);
map.put("assignTimeE", assignTimeE);
List<GzSinopecModel> list = highCouponCodeService.getGzSinopecAssignList(map);
List<String> headList = new ArrayList<>();
headList.add("卡券名称");
headList.add("卡券金额");
headList.add("分发时间");
headList.add("分发手机号");
headList.add("状态");
List<List<Object>> dataList = new ArrayList<>();
List<Object> data;
for (GzSinopecModel gzSinopecModel: list) {
data = new ArrayList<>();
data.add(gzSinopecModel.getCouponName());
data.add(gzSinopecModel.getSalesPrice());
data.add(DateUtil.format(gzSinopecModel.getSalesTime(), "yyyy-MM-dd HH:mm:ss"));
data.add(gzSinopecModel.getConvertUserPhone());
if (gzSinopecModel.getStatus().equals(2)) {
data.add("待使用");
} else if (gzSinopecModel.getStatus().equals(3)) {
data.add("已使用");
}
dataList.add(data);
}
String fileUrl = SysConst.getSysConfig().getFileUrl() + "/temporary/";
String pathName = System.currentTimeMillis()+".xlsx";
File file = new File(fileUrl);
if (!file.exists()) {
file.mkdirs();
}
EasyExcel.write(fileUrl+pathName).head(generationHead(headList)).sheet("sheet1").doWrite(dataList);
return ResponseMsgUtil.success(pathName);
} catch (Exception e) {
log.error("HighCouponController -> importGzSinopecAssign() error!",e);
return ResponseMsgUtil.exception(e);
}
}
/**
* 生成头部
* @param headList
* @return
*/
private static List<List<String>> generationHead(List<String> headList) {
List<List<String>> list = new ArrayList<>();
List<String> head;
for (String headStr : headList) {
head = new ArrayList<>();
head.add(headStr);
list.add(head);
}
return list;
}
} }

@ -9,7 +9,10 @@ import com.hai.common.utils.CoordCommonUtil;
import com.hai.common.utils.PageUtil; import com.hai.common.utils.PageUtil;
import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.TuanYouConfig; import com.hai.config.TuanYouConfig;
import com.hai.entity.HighGasDiscountOilPrice;
import com.hai.entity.HighGasOilPrice;
import com.hai.entity.HighOrder; import com.hai.entity.HighOrder;
import com.hai.enum_type.GasOilPriceStatusEnum;
import com.hai.model.ResponseData; import com.hai.model.ResponseData;
import com.hai.service.HighGasOilPriceService; import com.hai.service.HighGasOilPriceService;
import com.hai.service.HighOrderService; import com.hai.service.HighOrderService;
@ -22,10 +25,7 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Comparator; import java.util.*;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Controller @Controller
@ -41,6 +41,58 @@ public class HighGasController {
@Resource @Resource
private HighOrderService highOrderService; private HighOrderService highOrderService;
@RequestMapping(value="/disabledOil",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "禁用油品")
public ResponseData disabledOil(@RequestBody JSONObject body) {
try {
if (body.getLong("storeId") == null || body.getInteger("oilNo") == null) {
log.error("HighGasController -> disabledOil() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 查询油品价格
HighGasOilPrice oilNo = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(body.getLong("storeId"), body.getInteger("oilNo"));
if (oilNo == null) {
log.error("HighGasController -> disabledOil() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
oilNo.setStatus(GasOilPriceStatusEnum.status2.getStatus());
highGasOilPriceService.editGasOilPrice(oilNo);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighGasController -> disabledOil() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/enableOil",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "启用油品")
public ResponseData enableOil(@RequestBody JSONObject body) {
try {
if (body.getLong("storeId") == null || body.getInteger("oilNo") == null) {
log.error("HighGasController -> enableOil() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 查询油品价格
HighGasOilPrice oilNo = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(body.getLong("storeId"), body.getInteger("oilNo"));
if (oilNo == null) {
log.error("HighGasController -> enableOil() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
oilNo.setStatus(GasOilPriceStatusEnum.status1.getStatus());
highGasOilPriceService.editGasOilPrice(oilNo);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighGasController -> enableOil() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getGasStoreList",method = RequestMethod.GET) @RequestMapping(value="/getGasStoreList",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "查询加油站列表") @ApiOperation(value = "查询加油站列表")

@ -9,6 +9,7 @@ import com.hai.common.exception.SysCode;
import com.hai.common.security.UserCenter; import com.hai.common.security.UserCenter;
import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.*; import com.hai.entity.*;
import com.hai.model.HighMerchantStoreModel;
import com.hai.model.ResponseData; import com.hai.model.ResponseData;
import com.hai.service.*; import com.hai.service.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -66,7 +67,9 @@ public class HighTyAgentPriceController {
for (Object obj : bodyArray) { for (Object obj : bodyArray) {
JSONObject body = (JSONObject)JSONObject.toJSON(obj); JSONObject body = (JSONObject)JSONObject.toJSON(obj);
if (body.getLong("tyAgentOilStationId") == null if (body.getInteger("belongType") == null
|| body.getLong("oilStationId") == null
|| StringUtils.isBlank(body.getString("oilStationName"))
|| StringUtils.isBlank(body.getString("oilNoName")) || StringUtils.isBlank(body.getString("oilNoName"))
|| StringUtils.isBlank(body.getString("oilNo")) || StringUtils.isBlank(body.getString("oilNo"))
|| body.getBigDecimal("priceRate") == null) { || body.getBigDecimal("priceRate") == null) {
@ -74,9 +77,12 @@ public class HighTyAgentPriceController {
} }
// 查询油站 // 查询油站
HighTyAgentPrice agentOilStation = tyAgentPriceService.getDetail(body.getLong("tyAgentOilStationId"), body.getString("oilNo")); HighTyAgentPrice agentOilStation = tyAgentPriceService.getDetail(body.getInteger("belongType"),body.getLong("oilStationId"), body.getString("oilNo"));
if (agentOilStation == null) { if (agentOilStation == null) {
agentOilStation = new HighTyAgentPrice(); agentOilStation = new HighTyAgentPrice();
agentOilStation.setBelongType(body.getInteger("belongType"));
agentOilStation.setOilStationId(body.getLong("oilStationId"));
agentOilStation.setOilStationName(body.getString("oilStationName"));
agentOilStation.setTyAgentOilStationId(body.getLong("tyAgentOilStationId")); agentOilStation.setTyAgentOilStationId(body.getLong("tyAgentOilStationId"));
agentOilStation.setOilNoName(body.getString("oilNoName")); agentOilStation.setOilNoName(body.getString("oilNoName"));
agentOilStation.setOilNo(body.getString("oilNo")); agentOilStation.setOilNo(body.getString("oilNo"));
@ -87,6 +93,53 @@ public class HighTyAgentPriceController {
tyAgentPriceService.editTyAgentPrice(agentOilStation); tyAgentPriceService.editTyAgentPrice(agentOilStation);
} }
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighTyAgentPriceController --> editPrice() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/batchConfigPrice", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "批量配置价格")
public ResponseData batchConfigPrice(@RequestBody JSONObject body) {
try {
if (body.getInteger("belongType") == null
|| body.getInteger("oilNo") == null
|| body.getBigDecimal("priceRate") == null
|| body.getJSONArray("oilStationList") == null
) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
String oilNoName = commonService.getDictionaryCodeName("GAS_OIL_TYPE", body.getInteger("oilNo").toString());
if (StringUtils.isBlank(oilNoName)) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的油品");
}
for (Object obj : body.getJSONArray("oilStationList")) {
JSONObject oilStation = (JSONObject)JSONObject.toJSON(obj);
if (oilStation.getLong("oilStationId") == null || StringUtils.isBlank(oilStation.getString("oilStationName"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
// 查询油站
HighTyAgentPrice agentOilStation = tyAgentPriceService.getDetail(body.getInteger("belongType"), oilStation.getLong("oilStationId"), body.getString("oilNo"));
if (agentOilStation == null) {
agentOilStation = new HighTyAgentPrice();
agentOilStation.setBelongType(body.getInteger("belongType"));
agentOilStation.setOilStationId(oilStation.getLong("oilStationId"));
agentOilStation.setOilStationName(oilStation.getString("oilStationName"));
agentOilStation.setTyAgentOilStationId(oilStation.getLong("tyAgentOilStationId"));
agentOilStation.setOilNoName(oilNoName);
agentOilStation.setOilNo(body.getString("oilNo"));
agentOilStation.setPriceRate(body.getBigDecimal("priceRate"));
} else {
agentOilStation.setPriceRate(body.getBigDecimal("priceRate"));
}
tyAgentPriceService.editTyAgentPrice(agentOilStation);
}
return ResponseMsgUtil.success("操作成功"); return ResponseMsgUtil.success("操作成功");
@ -96,16 +149,48 @@ public class HighTyAgentPriceController {
} }
} }
@RequestMapping(value = "/getOilStationPrice", method = RequestMethod.GET) @RequestMapping(value = "/batchConfigOilNo", method = RequestMethod.POST)
@ResponseBody @ResponseBody
@ApiOperation(value = "油站价格") @ApiOperation(value = "批量油品管理")
public ResponseData getOilStationPrice(@RequestParam(name = "oilStationId", required = true) Long oilStationId) { public ResponseData batchConfigOilNo(@RequestBody JSONObject body) {
try { try {
if (body.getInteger("oilNo") == null
|| body.getInteger("status") == null
|| body.getJSONArray("oilStationList") == null
) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
HighTyAgentOilStation station = tyAgentOilStationService.getDetailByOilStationId(oilStationId); String oilNoName = commonService.getDictionaryCodeName("GAS_OIL_TYPE", body.getInteger("oilNo").toString());
if (station == null) { if (StringUtils.isBlank(oilNoName)) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "加油站未分配,无法查看"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的油品");
} }
for (Object obj : body.getJSONArray("oilStationList")) {
JSONObject oilStation = (JSONObject)JSONObject.toJSON(obj);
if (oilStation.getLong("oilStationId") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
HighGasOilPrice oilNo = gasOilPriceService.getGasOilPriceByStoreAndOilNo(oilStation.getLong("oilStationId"), body.getInteger("oilNo"));
if (oilNo != null) {
oilNo.setStatus(body.getInteger("status"));
gasOilPriceService.editGasOilPrice(oilNo);
}
}
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighTyAgentPriceController --> batchConfigOilNo() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getOilStationPrice", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "油站价格")
public ResponseData getOilStationPrice(@RequestParam(name = "belongType", required = true) Integer belongType,
@RequestParam(name = "oilStationId", required = true) Long oilStationId) {
try {
List<HighGasOilPrice> oilPriceList = gasOilPriceService.getGasOilPriceByStore(oilStationId); List<HighGasOilPrice> oilPriceList = gasOilPriceService.getGasOilPriceByStore(oilStationId);
if (oilPriceList == null) { if (oilPriceList == null) {
@ -116,16 +201,24 @@ public class HighTyAgentPriceController {
for (HighGasOilPrice price : oilPriceList) { for (HighGasOilPrice price : oilPriceList) {
oilPriceMap = new HashMap<>(); oilPriceMap = new HashMap<>();
oilPriceMap.put("tyAgentOilStationId", station.getId());
oilPriceMap.put("oilNo", price.getOilNo()); oilPriceMap.put("oilNo", price.getOilNo());
oilPriceMap.put("oilNoName", price.getOilNoName()); oilPriceMap.put("oilNoName", price.getOilNoName());
oilPriceMap.put("status", price.getStatus());
oilPriceMap.put("lowPrice", commonService.getDictionaryCodeName("TY_AGENT_OIL_STATION_LOW_PRICE", price.getOilNo().toString())); oilPriceMap.put("lowPrice", commonService.getDictionaryCodeName("TY_AGENT_OIL_STATION_LOW_PRICE", price.getOilNo().toString()));
// 价格 // 价格
HighTyAgentPrice priceRate = tyAgentPriceService.getDetail(station.getId(), price.getOilNo().toString()); HighTyAgentPrice priceRate = tyAgentPriceService.getDetail(belongType, oilStationId, price.getOilNo().toString());
if (priceRate == null) { if (priceRate == null) {
// 油站
HighMerchantStore store = merchantStoreService.getDetailById(price.getMerchantStoreId());
if (store != null) {
oilPriceMap.put("oilStationId", store.getId());
oilPriceMap.put("oilStationName", store.getStoreName());
}
oilPriceMap.put("priceRate", gasDiscountOilPriceService.getDetailByOilNo(price.getOilNo().toString()).getPriceRate()); oilPriceMap.put("priceRate", gasDiscountOilPriceService.getDetailByOilNo(price.getOilNo().toString()).getPriceRate());
} else { } else {
oilPriceMap.put("oilStationId", priceRate.getOilStationId());
oilPriceMap.put("oilStationName", priceRate.getOilStationName());
oilPriceMap.put("priceRate", priceRate.getPriceRate()); oilPriceMap.put("priceRate", priceRate.getPriceRate());
} }
oilPriceMapList.add(oilPriceMap); oilPriceMapList.add(oilPriceMap);

@ -14,6 +14,7 @@ import com.hai.config.CommonSysConst;
import com.hai.config.TuanYouConfig; import com.hai.config.TuanYouConfig;
import com.hai.dao.HighGasOrderPushMapper; import com.hai.dao.HighGasOrderPushMapper;
import com.hai.entity.*; import com.hai.entity.*;
import com.hai.enum_type.GasOilPriceStatusEnum;
import com.hai.enum_type.OrderPushType; import com.hai.enum_type.OrderPushType;
import com.hai.model.HighMerchantStoreModel; import com.hai.model.HighMerchantStoreModel;
import com.hai.model.ResponseData; import com.hai.model.ResponseData;
@ -100,7 +101,16 @@ public class HighGasController {
PageInfo<Map<String, Object>> mapPageInfo = PageUtil.initPageInfoObj(pageNum, distance.size(), pageSize, new PageInfo<>(distance)); PageInfo<Map<String, Object>> mapPageInfo = PageUtil.initPageInfoObj(pageNum, distance.size(), pageSize, new PageInfo<>(distance));
for (Map<String, Object> map : mapPageInfo.getList()) { for (Map<String, Object> map : mapPageInfo.getList()) {
if (StringUtils.isNotBlank(MapUtils.getString(map, "oil_no"))) { if (StringUtils.isNotBlank(MapUtils.getString(map, "oil_no"))) {
// 查询是否配置了优惠比例
// 查询是否配置了【油站的】优惠比例
HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(1, MapUtils.getLong(map, "id"), MapUtils.getString(map, "oil_no"));
if (tyAgentPrice != null) {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = tyAgentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油品国标价 * 最终优惠比例
map.put("price_vip", new BigDecimal(MapUtils.getString(map, "price_official")).multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
} else {
// 查询是否配置了【油品】优惠比例
HighGasDiscountOilPrice gasDiscountOilPrice = highGasDiscountOilPriceService.getDetailByOilNo(MapUtils.getString(map, "oil_no")); HighGasDiscountOilPrice gasDiscountOilPrice = highGasDiscountOilPriceService.getDetailByOilNo(MapUtils.getString(map, "oil_no"));
if (gasDiscountOilPrice != null) { if (gasDiscountOilPrice != null) {
// 优惠比例 / 100 = 最终优惠比例 // 优惠比例 / 100 = 最终优惠比例
@ -108,22 +118,20 @@ public class HighGasController {
// 油品国标价 * 最终优惠比例 // 油品国标价 * 最终优惠比例
map.put("price_vip", new BigDecimal(MapUtils.getString(map, "price_official")).multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP)); map.put("price_vip", new BigDecimal(MapUtils.getString(map, "price_official")).multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
} }
}
// 查询是否配置了【代理商】优惠比例
if (isTyAgent != null && isTyAgent == true) { if (isTyAgent != null && isTyAgent == true) {
// 查询是否配置了优惠比例 HighTyAgentPrice agentPrice = tyAgentPriceService.getDetail(2, MapUtils.getLong(map, "id"), MapUtils.getString(map, "oil_no"));
HighTyAgentOilStation tyAgentOilStation = tyAgentOilStationService.getDetailByOilStationId(MapUtils.getLong(map, "id")); if (agentPrice != null) {
if (tyAgentOilStation != null) {
HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(tyAgentOilStation.getId(), MapUtils.getString(map, "oil_no"));
if (tyAgentPrice != null) {
// 优惠比例 / 100 = 最终优惠比例 // 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = tyAgentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN)); BigDecimal priceRate = agentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油品国标价 * 最终优惠比例 // 油品国标价 * 最终优惠比例
map.put("price_vip", new BigDecimal(MapUtils.getString(map, "price_official")).multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP)); map.put("price_vip", new BigDecimal(MapUtils.getString(map, "price_official")).multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
} }
} }
} }
} }
}
return ResponseMsgUtil.success(mapPageInfo); return ResponseMsgUtil.success(mapPageInfo);
} }
return ResponseMsgUtil.success(new PageInfo<>()); return ResponseMsgUtil.success(new PageInfo<>());
@ -142,21 +150,27 @@ public class HighGasController {
@RequestParam(name = "isTyAgent", required = false) Boolean isTyAgent) { @RequestParam(name = "isTyAgent", required = false) Boolean isTyAgent) {
try { try {
BigDecimal discount = new BigDecimal("1"); BigDecimal discount = new BigDecimal("1");
// 查询是否配置了【油站的】优惠比例
HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(1, goodsId, oilNo);
if (tyAgentPrice != null) {
discount = tyAgentPrice.getPriceRate();
} else {
// 查询是否配置了【油品】优惠比例
HighGasDiscountOilPrice gasDiscountOilPrice = highGasDiscountOilPriceService.getDetailByOilNo(oilNo);
if (gasDiscountOilPrice != null) {
discount = gasDiscountOilPrice.getPriceRate();
}
}
if (isTyAgent != null && isTyAgent.equals(true)) { if (isTyAgent != null && isTyAgent.equals(true)) {
// 查询加油站
HighTyAgentOilStation oilStation = tyAgentOilStationService.getDetailByOilStationId(goodsId);
if (oilStation != null) {
// 价格 // 价格
HighTyAgentPrice priceRate = tyAgentPriceService.getDetail(oilStation.getId(), oilNo); HighTyAgentPrice priceRate = tyAgentPriceService.getDetail(2, goodsId, oilNo);
if (priceRate == null) { if (priceRate == null) {
discount = gasDiscountOilPriceService.getDetailByOilNo(oilNo).getPriceRate(); discount = gasDiscountOilPriceService.getDetailByOilNo(oilNo).getPriceRate();
} else { } else {
discount = priceRate.getPriceRate(); discount = priceRate.getPriceRate();
} }
} }
} else {
discount = gasDiscountOilPriceService.getDetailByOilNo(oilNo).getPriceRate();
}
return ResponseMsgUtil.success(price.multiply(discount.divide(new BigDecimal("100"))).setScale(2,BigDecimal.ROUND_HALF_UP)); return ResponseMsgUtil.success(price.multiply(discount.divide(new BigDecimal("100"))).setScale(2,BigDecimal.ROUND_HALF_UP));
} catch (Exception e) { } catch (Exception e) {
log.error("HighGasController -> oilPriceCompute() error!",e); log.error("HighGasController -> oilPriceCompute() error!",e);
@ -192,7 +206,22 @@ public class HighGasController {
// 处理油品价格 // 处理油品价格
for (Object oilPriceObject : originalOilPriceList) { for (Object oilPriceObject : originalOilPriceList) {
JSONObject price = JSON.parseObject(JSONObject.toJSONString(oilPriceObject), JSONObject.class); JSONObject price = JSON.parseObject(JSONObject.toJSONString(oilPriceObject), JSONObject.class);
// 查询是否配置了优惠比例
// 查询油站油品状态
HighGasOilPrice oilNo = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), price.getInteger("oilNo"));
if (oilNo != null && !oilNo.getStatus().equals(GasOilPriceStatusEnum.status1.getStatus())) {
continue;
}
// 查询是否配置了【油站的】优惠比例
HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(1, store.getId(), price.getString("oilNo"));
if (tyAgentPrice != null) {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = tyAgentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油品国标价 * 最终优惠比例
price.put("priceVip", price.getBigDecimal("priceOfficial").multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
} else {
// 查询是否配置了【油品】优惠比例
HighGasDiscountOilPrice gasDiscountOilPrice = highGasDiscountOilPriceService.getDetailByOilNo(price.getString("oilNo")); HighGasDiscountOilPrice gasDiscountOilPrice = highGasDiscountOilPriceService.getDetailByOilNo(price.getString("oilNo"));
if (gasDiscountOilPrice != null) { if (gasDiscountOilPrice != null) {
// 优惠比例 / 100 = 最终优惠比例 // 优惠比例 / 100 = 最终优惠比例
@ -200,25 +229,20 @@ public class HighGasController {
// 油品国标价 * 最终优惠比例 // 油品国标价 * 最终优惠比例
price.put("priceVip", price.getBigDecimal("priceOfficial").multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP)); price.put("priceVip", price.getBigDecimal("priceOfficial").multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
} }
}
// 查询是否配置了【代理商油站】优惠比例
if (isTyAgent != null && isTyAgent == true) { if (isTyAgent != null && isTyAgent == true) {
// 查询是否配置了优惠比例 HighTyAgentPrice agentPrice = tyAgentPriceService.getDetail(2, store.getId(), price.getString("oilNo"));
HighTyAgentOilStation tyAgentOilStation = tyAgentOilStationService.getDetailByOilStationId(store.getId()); if (agentPrice != null) {
if (tyAgentOilStation != null) {
HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(tyAgentOilStation.getId(), price.getString("oilNo"));
if (tyAgentPrice != null) {
// 优惠比例 / 100 = 最终优惠比例 // 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = tyAgentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN)); BigDecimal priceRate = agentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油品国标价 * 最终优惠比例 // 油品国标价 * 最终优惠比例
price.put("priceVip", price.getBigDecimal("priceOfficial").multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP)); price.put("priceVip", price.getBigDecimal("priceOfficial").multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
} }
} }
}
// 过滤油品,只保留汽油
if (price.getInteger("oilType") == 1) {
newOilPriceList.add(price); newOilPriceList.add(price);
} }
}
result.put("oilPriceList", newOilPriceList); result.put("oilPriceList", newOilPriceList);
double distance = CoordCommonUtil.getDistance(Double.valueOf(result.get("gasAddressLatitude").toString()), Double.valueOf(result.get("gasAddressLongitude").toString()), Double.valueOf(latitude), Double.valueOf(longitude)); double distance = CoordCommonUtil.getDistance(Double.valueOf(result.get("gasAddressLatitude").toString()), Double.valueOf(result.get("gasAddressLongitude").toString()), Double.valueOf(latitude), Double.valueOf(longitude));

@ -234,28 +234,27 @@ public class HighOrderController {
highOrder.setPayType(2); // 第三方平台 highOrder.setPayType(2); // 第三方平台
BigDecimal discount = new BigDecimal("1"); BigDecimal discount = new BigDecimal("1");
if (highOrder.getIsTyAgent() != null && highOrder.getIsTyAgent() == true) { // 查询是否配置了【油站的】优惠比例
// 查询加油站 HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(1, childOrder.getGoodsId(), childOrder.getGasOilNo());
HighTyAgentOilStation oilStation = tyAgentOilStationService.getDetailByOilStationId(childOrder.getGoodsId()); if (tyAgentPrice != null) {
if (oilStation != null) { discount = tyAgentPrice.getPriceRate();
childOrder.setGasSalesmanId(oilStation.getTySalesmanId()); } else {
childOrder.setGasSalesmanName(oilStation.getTySalesmanName()); // 查询是否配置了【油品】优惠比例
childOrder.setGasAgentId(oilStation.getTyAgentId()); HighGasDiscountOilPrice gasDiscountOilPrice = gasDiscountOilPriceService.getDetailByOilNo(childOrder.getGasOilNo());
childOrder.setGasAgentName(oilStation.getTyAgentName()); if (gasDiscountOilPrice != null) {
childOrder.setGasOrgId(oilStation.getOrganizationId()); discount = gasDiscountOilPrice.getPriceRate();
childOrder.setGasOrgName(oilStation.getOrganizationName()); }
}
if (highOrder.getIsTyAgent() != null && highOrder.getIsTyAgent().equals(true)) {
// 价格 // 价格
HighTyAgentPrice priceRate = tyAgentPriceService.getDetail(oilStation.getId(), childOrder.getGasOilNo()); HighTyAgentPrice priceRate = tyAgentPriceService.getDetail(2, childOrder.getGoodsId(), childOrder.getGasOilNo());
if (priceRate == null) { if (priceRate == null) {
discount = gasDiscountOilPriceService.getDetailByOilNo(childOrder.getGasOilNo()).getPriceRate(); discount = gasDiscountOilPriceService.getDetailByOilNo(childOrder.getGasOilNo()).getPriceRate();
} else { } else {
discount = priceRate.getPriceRate(); discount = priceRate.getPriceRate();
} }
} }
} else {
discount = gasDiscountOilPriceService.getDetailByOilNo(childOrder.getGasOilNo()).getPriceRate();
}
// 获取当前加油价格 // 获取当前加油价格
JSONObject jsonObject = TuanYouConfig.queryCompanyPriceDetail(store.getStoreKey(), childOrder.getGasOilNo()); JSONObject jsonObject = TuanYouConfig.queryCompanyPriceDetail(store.getStoreKey(), childOrder.getGasOilNo());

File diff suppressed because one or more lines are too long

@ -183,6 +183,8 @@ public class OrderController {
map.put("body","购买产品"); map.put("body","购买产品");
map.put("subject","购买产品"); map.put("subject","购买产品");
// 是否分账
String profitSharing = "N";
//微信支付 //微信支付
String nonce_str = MD5Util.MD5Encode(String.valueOf(ThreadLocalRandom.current().nextInt(10000)), "UTF-8"); String nonce_str = MD5Util.MD5Encode(String.valueOf(ThreadLocalRandom.current().nextInt(10000)), "UTF-8");
int total_fee = MathUtils.objectConvertBigDecimal(map.get("payPrice")).multiply(new BigDecimal("100")).intValue(); int total_fee = MathUtils.objectConvertBigDecimal(map.get("payPrice")).multiply(new BigDecimal("100")).intValue();
@ -199,12 +201,12 @@ public class OrderController {
weChatPayReqInfo.setSub_mch_id(SysConst.getSysConfig().getWxGzSubMchId());//商户号 weChatPayReqInfo.setSub_mch_id(SysConst.getSysConfig().getWxGzSubMchId());//商户号
} else if (order.getHighChildOrderList().get(0).getGoodsType() == 3) { } else if (order.getHighChildOrderList().get(0).getGoodsType() == 3) {
weChatPayReqInfo.setSub_mch_id("1609882817");//商户号 weChatPayReqInfo.setSub_mch_id("1624126902"); // 浩联商户号
profitSharing = "Y";
} else { } else {
//子商户号
weChatPayReqInfo.setSub_mch_id(SysConst.getSysConfig().getWxSubMchId()); weChatPayReqInfo.setSub_mch_id(SysConst.getSysConfig().getWxSubMchId());
} }
//子商户号
// weChatPayReqInfo.setOpenid(openId); // weChatPayReqInfo.setOpenid(openId);
weChatPayReqInfo.setSub_openid(openId); weChatPayReqInfo.setSub_openid(openId);
@ -216,7 +218,8 @@ public class OrderController {
weChatPayReqInfo.setNotify_url(SysConst.getSysConfig().getNotifyUrl()); //通知url weChatPayReqInfo.setNotify_url(SysConst.getSysConfig().getNotifyUrl()); //通知url
weChatPayReqInfo.setTrade_type("JSAPI"); //交易类型 weChatPayReqInfo.setTrade_type("JSAPI"); //交易类型
weChatPayReqInfo.setAttach(map.get("orderScene").toString()); weChatPayReqInfo.setAttach(map.get("orderScene").toString());
weChatPayReqInfo.setProfit_sharing("N"); weChatPayReqInfo.setProfit_sharing(profitSharing);
//附加数据,区分订单类型 //附加数据,区分订单类型
Map<String,String> payMap = new HashMap<>(); Map<String,String> payMap = new HashMap<>();
@ -224,6 +227,9 @@ public class OrderController {
payMap.put("api_key",SysConst.getSysConfig().getWxApiKey()); payMap.put("api_key",SysConst.getSysConfig().getWxApiKey());
payMap.put("unified_order_url",SysConst.getSysConfig().getWxUnifiedOrderUrl()); payMap.put("unified_order_url",SysConst.getSysConfig().getWxUnifiedOrderUrl());
SortedMap<Object, Object> sortedMap = wechatPayUtil.goWechatPay(weChatPayReqInfo,payMap); SortedMap<Object, Object> sortedMap = wechatPayUtil.goWechatPay(weChatPayReqInfo,payMap);
order.setExt1(weChatPayReqInfo.getSub_appid());
highOrderService.updateOrderDetail(order);
return ResponseMsgUtil.success(sortedMap); return ResponseMsgUtil.success(sortedMap);
} catch (Exception e) { } catch (Exception e) {
log.error("orderToPay error!", e); log.error("orderToPay error!", e);

@ -148,16 +148,16 @@ public class WechatPayController {
try { try {
WxSharingReceiversVO receiversVO = new WxSharingReceiversVO(); WxSharingReceiversVO receiversVO = new WxSharingReceiversVO();
receiversVO.setAccount("1611202250"); receiversVO.setAccount("1603942866");
receiversVO.setType("MERCHANT_ID"); receiversVO.setType("MERCHANT_ID");
receiversVO.setName("重庆众卡汇电子商务有限公司"); receiversVO.setName("重庆惠昕石化有限责任公司");
receiversVO.setRelation_type("SERVICE_PROVIDER"); receiversVO.setRelation_type("SERVICE_PROVIDER");
Map<String , String> map = new HashMap<>(); Map<String , String> map = new HashMap<>();
map.put("mch_id" , "1289663601"); map.put("mch_id" , "1289663601");
map.put("sub_mch_id" , "1607303848"); map.put("sub_mch_id" , "1624126902");
map.put("appid" , "wx637bd6f7314daa46"); map.put("appid" , "wxa075e8509802f826");
map.put("nonce_str" , WxUtils.makeNonStr()); map.put("nonce_str" , WxUtils.makeNonStr());
map.put("sign_type" , "HMAC-SHA256"); map.put("sign_type" , "HMAC-SHA256");
map.put("receiver" , JSONObject.toJSONString(receiversVO)); map.put("receiver" , JSONObject.toJSONString(receiversVO));

@ -8,6 +8,7 @@ import com.hai.common.exception.SysCode;
import com.hai.config.TuanYouConfig; import com.hai.config.TuanYouConfig;
import com.hai.entity.HighGasOilPrice; import com.hai.entity.HighGasOilPrice;
import com.hai.entity.HighMerchantStore; import com.hai.entity.HighMerchantStore;
import com.hai.enum_type.GasOilPriceStatusEnum;
import com.hai.model.HighMerchantModel; import com.hai.model.HighMerchantModel;
import com.hai.model.HighMerchantStoreModel; import com.hai.model.HighMerchantStoreModel;
import com.hai.service.HighGasOilPriceService; import com.hai.service.HighGasOilPriceService;
@ -88,6 +89,7 @@ public class HighGasSchedule {
highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial"));
highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType"));
highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName"));
highGasOilPrice.setStatus(GasOilPriceStatusEnum.status1.getStatus());
} else { } else {
highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setMerchantStoreId(store.getId());
highGasOilPrice.setOilNo(oilPriceObject.getInteger("oilNo")); highGasOilPrice.setOilNo(oilPriceObject.getInteger("oilNo"));

@ -62,6 +62,34 @@ public class CommonSysConfig {
private String CzUrl; private String CzUrl;
private String CzAppSecret; private String CzAppSecret;
private String unionAppId;
private String unionSecret;
private String unionRsaKey;
public String getUnionAppId() {
return unionAppId;
}
public void setUnionAppId(String unionAppId) {
this.unionAppId = unionAppId;
}
public String getUnionSecret() {
return unionSecret;
}
public void setUnionSecret(String unionSecret) {
this.unionSecret = unionSecret;
}
public String getUnionRsaKey() {
return unionRsaKey;
}
public void setUnionRsaKey(String unionRsaKey) {
this.unionRsaKey = unionRsaKey;
}
public String getTuanYouUrl() { public String getTuanYouUrl() {
return tuanYouUrl; return tuanYouUrl;
} }

@ -1,16 +1,13 @@
package com.hai.config; package com.hai.config;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.pay.util.sdk.WXPayConstants;
import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.RedisUtil; import com.hai.common.utils.RedisUtil;
import com.hai.common.utils.UnionUtils; import com.hai.common.utils.UnionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.ws.rs.core.MediaType;
import javax.xml.bind.DatatypeConverter; import javax.xml.bind.DatatypeConverter;
import java.security.KeyPair; import java.security.KeyPair;
import java.security.KeyPairGenerator; import java.security.KeyPairGenerator;
@ -28,12 +25,13 @@ import java.util.*;
public class UnionUserConfig { public class UnionUserConfig {
private static String requestUrl = "https://open.95516.com/open/access/1.0/"; private static String requestUrl = "https://open.95516.com/open/access/1.0/";
private static String appId = "cf56ac6f9f6b4744bfba9e5587db147c"; private static String appId = CommonSysConst.getSysConfig().getUnionAppId();
private static String secret = "665193ddd44248acb461594cfe0ded5b"; private static String secret = CommonSysConst.getSysConfig().getUnionSecret();
private static String rsaKey = "df0bdf7f5ef7bff770f2f21fe549c461df0bdf7f5ef7bff7"; private static String rsaKey = CommonSysConst.getSysConfig().getUnionRsaKey();
@Resource @Resource
private RedisUtil redisUtil; private RedisUtil redisUtil;
/** /**
* 获取应用访问令牌backendToken * 获取应用访问令牌backendToken
* @return * @return

@ -67,7 +67,7 @@ public class WxOrderConfig {
Map<String,String> param = new HashMap<>(); Map<String,String> param = new HashMap<>();
param.put("appid", "wx637bd6f7314daa46"); param.put("appid", "wx637bd6f7314daa46");
param.put("mch_id", "1289663601"); param.put("mch_id", "1289663601");
param.put("sub_mch_id" , "1609882817"); param.put("sub_mch_id" , "1624126902");
param.put("nonce_str", WxUtils.makeNonStr()); param.put("nonce_str", WxUtils.makeNonStr());
param.put("transaction_id", paySerialNo); param.put("transaction_id", paySerialNo);
param.put("out_refund_no", "HFR"+new Date().getTime()); param.put("out_refund_no", "HFR"+new Date().getTime());

@ -1,10 +1,12 @@
package com.hai.dao; package com.hai.dao;
import com.hai.entity.HighCouponCode; import com.hai.entity.HighCouponCode;
import com.hai.model.GzSinopecModel;
import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType; import org.apache.ibatis.type.JdbcType;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* mapper扩展类 * mapper扩展类
@ -83,4 +85,22 @@ public interface HighCouponCodeMapperExt {
}) })
HighCouponCode selectCouponCodeByUserDiscount(@Param("discountUserRelId") Long discountUserRelId); HighCouponCode selectCouponCodeByUserDiscount(@Param("discountUserRelId") Long discountUserRelId);
@Select({"<script>" +
" select " +
" a.coupon_name couponName," +
" a.sales_price salesPrice," +
" b.sales_time salesTime," +
" insert(b.convert_user_phone, 4, 4, '****') convertUserPhone," +
" b.`status` status" +
" from (select id,coupon_name,sales_price from high_coupon_agent_rel where coupon_id in (select id from high_coupon where coupon_source = 4)) a" +
" LEFT JOIN high_coupon_agent_code b on b.coupon_agent_id = a.id" +
" where 1 = 1" +
" <if test='param.couponName != null'> and a.coupon_name like concat('%',#{param.couponName},'%') </if> " +
" <if test='param.status == null'> and b.`status` in (2,3) </if> " +
" <if test='param.status != null'> and b.`status` = #{param.status} </if> " +
" <if test='param.assignTimeS != null'> <![CDATA[ and b.sales_time >= #{param.assignTimeS} ]]> </if> " +
" <if test='param.assignTimeE != null'> <![CDATA[ and b.sales_time <= #{param.assignTimeE} ]]> </if> " +
"</script>"})
List<GzSinopecModel> selectGzSinopecAssignList(@Param("param") Map<String, Object> param);
} }

@ -43,12 +43,14 @@ public interface HighGasOilPriceMapper extends HighGasOilPriceMapperExt {
"oil_no_name, price_vip, ", "oil_no_name, price_vip, ",
"price_gun, price_official, ", "price_gun, price_official, ",
"oil_type, oil_type_name, ", "oil_type, oil_type_name, ",
"ext_1, ext_2, ext_3)", "`status`, ext_1, ext_2, ",
"ext_3)",
"values (#{merchantStoreId,jdbcType=BIGINT}, #{oilNo,jdbcType=INTEGER}, ", "values (#{merchantStoreId,jdbcType=BIGINT}, #{oilNo,jdbcType=INTEGER}, ",
"#{oilNoName,jdbcType=VARCHAR}, #{priceVip,jdbcType=DECIMAL}, ", "#{oilNoName,jdbcType=VARCHAR}, #{priceVip,jdbcType=DECIMAL}, ",
"#{priceGun,jdbcType=DECIMAL}, #{priceOfficial,jdbcType=DECIMAL}, ", "#{priceGun,jdbcType=DECIMAL}, #{priceOfficial,jdbcType=DECIMAL}, ",
"#{oilType,jdbcType=INTEGER}, #{oilTypeName,jdbcType=VARCHAR}, ", "#{oilType,jdbcType=INTEGER}, #{oilTypeName,jdbcType=VARCHAR}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" "#{status,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ",
"#{ext3,jdbcType=VARCHAR})"
}) })
@Options(useGeneratedKeys=true,keyProperty="id") @Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighGasOilPrice record); int insert(HighGasOilPrice record);
@ -68,6 +70,7 @@ public interface HighGasOilPriceMapper extends HighGasOilPriceMapperExt {
@Result(column="price_official", property="priceOfficial", jdbcType=JdbcType.DECIMAL), @Result(column="price_official", property="priceOfficial", jdbcType=JdbcType.DECIMAL),
@Result(column="oil_type", property="oilType", jdbcType=JdbcType.INTEGER), @Result(column="oil_type", property="oilType", jdbcType=JdbcType.INTEGER),
@Result(column="oil_type_name", property="oilTypeName", jdbcType=JdbcType.VARCHAR), @Result(column="oil_type_name", property="oilTypeName", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", 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)
@ -77,7 +80,7 @@ public interface HighGasOilPriceMapper extends HighGasOilPriceMapperExt {
@Select({ @Select({
"select", "select",
"id, merchant_store_id, oil_no, oil_no_name, price_vip, price_gun, price_official, ", "id, merchant_store_id, oil_no, oil_no_name, price_vip, price_gun, price_official, ",
"oil_type, oil_type_name, ext_1, ext_2, ext_3", "oil_type, oil_type_name, `status`, ext_1, ext_2, ext_3",
"from high_gas_oil_price", "from high_gas_oil_price",
"where id = #{id,jdbcType=BIGINT}" "where id = #{id,jdbcType=BIGINT}"
}) })
@ -91,6 +94,7 @@ public interface HighGasOilPriceMapper extends HighGasOilPriceMapperExt {
@Result(column="price_official", property="priceOfficial", jdbcType=JdbcType.DECIMAL), @Result(column="price_official", property="priceOfficial", jdbcType=JdbcType.DECIMAL),
@Result(column="oil_type", property="oilType", jdbcType=JdbcType.INTEGER), @Result(column="oil_type", property="oilType", jdbcType=JdbcType.INTEGER),
@Result(column="oil_type_name", property="oilTypeName", jdbcType=JdbcType.VARCHAR), @Result(column="oil_type_name", property="oilTypeName", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", 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)
@ -116,6 +120,7 @@ public interface HighGasOilPriceMapper extends HighGasOilPriceMapperExt {
"price_official = #{priceOfficial,jdbcType=DECIMAL},", "price_official = #{priceOfficial,jdbcType=DECIMAL},",
"oil_type = #{oilType,jdbcType=INTEGER},", "oil_type = #{oilType,jdbcType=INTEGER},",
"oil_type_name = #{oilTypeName,jdbcType=VARCHAR},", "oil_type_name = #{oilTypeName,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},",
"ext_1 = #{ext1,jdbcType=VARCHAR},", "ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},", "ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR}", "ext_3 = #{ext3,jdbcType=VARCHAR}",

@ -25,6 +25,7 @@ public interface HighGasOilPriceMapperExt {
" WHERE" + " WHERE" +
" a.merchant_store_id = b.id " + " a.merchant_store_id = b.id " +
" AND b.`status` = 1 " + " AND b.`status` = 1 " +
" AND a.`status` = 1 " +
" AND b.region_id = #{regionId} " + " AND b.region_id = #{regionId} " +
" AND a.oil_no_name = #{oilNoName}" + " AND a.oil_no_name = #{oilNoName}" +
"<if test='storeName != null'> and b.store_name like '%${storeName}%'</if>" + "<if test='storeName != null'> and b.store_name like '%${storeName}%'</if>" +

@ -60,6 +60,10 @@ public class HighGasOilPriceSqlProvider {
sql.VALUES("oil_type_name", "#{oilTypeName,jdbcType=VARCHAR}"); sql.VALUES("oil_type_name", "#{oilTypeName,jdbcType=VARCHAR}");
} }
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getExt1() != null) { if (record.getExt1() != null) {
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}");
} }
@ -90,6 +94,7 @@ public class HighGasOilPriceSqlProvider {
sql.SELECT("price_official"); sql.SELECT("price_official");
sql.SELECT("oil_type"); sql.SELECT("oil_type");
sql.SELECT("oil_type_name"); sql.SELECT("oil_type_name");
sql.SELECT("`status`");
sql.SELECT("ext_1"); sql.SELECT("ext_1");
sql.SELECT("ext_2"); sql.SELECT("ext_2");
sql.SELECT("ext_3"); sql.SELECT("ext_3");
@ -146,6 +151,10 @@ public class HighGasOilPriceSqlProvider {
sql.SET("oil_type_name = #{record.oilTypeName,jdbcType=VARCHAR}"); sql.SET("oil_type_name = #{record.oilTypeName,jdbcType=VARCHAR}");
} }
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getExt1() != null) { if (record.getExt1() != null) {
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
} }
@ -175,6 +184,7 @@ public class HighGasOilPriceSqlProvider {
sql.SET("price_official = #{record.priceOfficial,jdbcType=DECIMAL}"); sql.SET("price_official = #{record.priceOfficial,jdbcType=DECIMAL}");
sql.SET("oil_type = #{record.oilType,jdbcType=INTEGER}"); sql.SET("oil_type = #{record.oilType,jdbcType=INTEGER}");
sql.SET("oil_type_name = #{record.oilTypeName,jdbcType=VARCHAR}"); sql.SET("oil_type_name = #{record.oilTypeName,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
@ -220,6 +230,10 @@ public class HighGasOilPriceSqlProvider {
sql.SET("oil_type_name = #{oilTypeName,jdbcType=VARCHAR}"); sql.SET("oil_type_name = #{oilTypeName,jdbcType=VARCHAR}");
} }
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getExt1() != null) { if (record.getExt1() != null) {
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}");
} }

@ -39,16 +39,18 @@ public interface HighTyAgentPriceMapper extends HighTyAgentPriceMapperExt {
int deleteByPrimaryKey(Long id); int deleteByPrimaryKey(Long id);
@Insert({ @Insert({
"insert into high_ty_agent_price (ty_agent_oil_station_id, oil_no_name, ", "insert into high_ty_agent_price (belong_type, oil_station_id, ",
"oil_no, price_rate, ", "oil_station_name, ty_agent_oil_station_id, ",
"`status`, create_time, ", "oil_no_name, oil_no, ",
"update_time, ext_1, ", "price_rate, `status`, ",
"ext_2, ext_3)", "create_time, update_time, ",
"values (#{tyAgentOilStationId,jdbcType=BIGINT}, #{oilNoName,jdbcType=VARCHAR}, ", "ext_1, ext_2, ext_3)",
"#{oilNo,jdbcType=VARCHAR}, #{priceRate,jdbcType=DECIMAL}, ", "values (#{belongType,jdbcType=INTEGER}, #{oilStationId,jdbcType=BIGINT}, ",
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", "#{oilStationName,jdbcType=VARCHAR}, #{tyAgentOilStationId,jdbcType=BIGINT}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", "#{oilNoName,jdbcType=VARCHAR}, #{oilNo,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" "#{priceRate,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
}) })
@Options(useGeneratedKeys=true,keyProperty="id") @Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighTyAgentPrice record); int insert(HighTyAgentPrice record);
@ -60,6 +62,9 @@ public interface HighTyAgentPriceMapper extends HighTyAgentPriceMapperExt {
@SelectProvider(type=HighTyAgentPriceSqlProvider.class, method="selectByExample") @SelectProvider(type=HighTyAgentPriceSqlProvider.class, method="selectByExample")
@Results({ @Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="belong_type", property="belongType", jdbcType=JdbcType.INTEGER),
@Result(column="oil_station_id", property="oilStationId", jdbcType=JdbcType.BIGINT),
@Result(column="oil_station_name", property="oilStationName", jdbcType=JdbcType.VARCHAR),
@Result(column="ty_agent_oil_station_id", property="tyAgentOilStationId", jdbcType=JdbcType.BIGINT), @Result(column="ty_agent_oil_station_id", property="tyAgentOilStationId", jdbcType=JdbcType.BIGINT),
@Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR), @Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR),
@Result(column="oil_no", property="oilNo", jdbcType=JdbcType.VARCHAR), @Result(column="oil_no", property="oilNo", jdbcType=JdbcType.VARCHAR),
@ -75,13 +80,17 @@ public interface HighTyAgentPriceMapper extends HighTyAgentPriceMapperExt {
@Select({ @Select({
"select", "select",
"id, ty_agent_oil_station_id, oil_no_name, oil_no, price_rate, `status`, create_time, ", "id, belong_type, oil_station_id, oil_station_name, ty_agent_oil_station_id, ",
"update_time, ext_1, ext_2, ext_3", "oil_no_name, oil_no, price_rate, `status`, create_time, update_time, ext_1, ",
"ext_2, ext_3",
"from high_ty_agent_price", "from high_ty_agent_price",
"where id = #{id,jdbcType=BIGINT}" "where id = #{id,jdbcType=BIGINT}"
}) })
@Results({ @Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="belong_type", property="belongType", jdbcType=JdbcType.INTEGER),
@Result(column="oil_station_id", property="oilStationId", jdbcType=JdbcType.BIGINT),
@Result(column="oil_station_name", property="oilStationName", jdbcType=JdbcType.VARCHAR),
@Result(column="ty_agent_oil_station_id", property="tyAgentOilStationId", jdbcType=JdbcType.BIGINT), @Result(column="ty_agent_oil_station_id", property="tyAgentOilStationId", jdbcType=JdbcType.BIGINT),
@Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR), @Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR),
@Result(column="oil_no", property="oilNo", jdbcType=JdbcType.VARCHAR), @Result(column="oil_no", property="oilNo", jdbcType=JdbcType.VARCHAR),
@ -106,7 +115,10 @@ public interface HighTyAgentPriceMapper extends HighTyAgentPriceMapperExt {
@Update({ @Update({
"update high_ty_agent_price", "update high_ty_agent_price",
"set ty_agent_oil_station_id = #{tyAgentOilStationId,jdbcType=BIGINT},", "set belong_type = #{belongType,jdbcType=INTEGER},",
"oil_station_id = #{oilStationId,jdbcType=BIGINT},",
"oil_station_name = #{oilStationName,jdbcType=VARCHAR},",
"ty_agent_oil_station_id = #{tyAgentOilStationId,jdbcType=BIGINT},",
"oil_no_name = #{oilNoName,jdbcType=VARCHAR},", "oil_no_name = #{oilNoName,jdbcType=VARCHAR},",
"oil_no = #{oilNo,jdbcType=VARCHAR},", "oil_no = #{oilNo,jdbcType=VARCHAR},",
"price_rate = #{priceRate,jdbcType=DECIMAL},", "price_rate = #{priceRate,jdbcType=DECIMAL},",

@ -28,6 +28,18 @@ public class HighTyAgentPriceSqlProvider {
SQL sql = new SQL(); SQL sql = new SQL();
sql.INSERT_INTO("high_ty_agent_price"); sql.INSERT_INTO("high_ty_agent_price");
if (record.getBelongType() != null) {
sql.VALUES("belong_type", "#{belongType,jdbcType=INTEGER}");
}
if (record.getOilStationId() != null) {
sql.VALUES("oil_station_id", "#{oilStationId,jdbcType=BIGINT}");
}
if (record.getOilStationName() != null) {
sql.VALUES("oil_station_name", "#{oilStationName,jdbcType=VARCHAR}");
}
if (record.getTyAgentOilStationId() != null) { if (record.getTyAgentOilStationId() != null) {
sql.VALUES("ty_agent_oil_station_id", "#{tyAgentOilStationId,jdbcType=BIGINT}"); sql.VALUES("ty_agent_oil_station_id", "#{tyAgentOilStationId,jdbcType=BIGINT}");
} }
@ -78,6 +90,9 @@ public class HighTyAgentPriceSqlProvider {
} else { } else {
sql.SELECT("id"); sql.SELECT("id");
} }
sql.SELECT("belong_type");
sql.SELECT("oil_station_id");
sql.SELECT("oil_station_name");
sql.SELECT("ty_agent_oil_station_id"); sql.SELECT("ty_agent_oil_station_id");
sql.SELECT("oil_no_name"); sql.SELECT("oil_no_name");
sql.SELECT("oil_no"); sql.SELECT("oil_no");
@ -109,6 +124,18 @@ public class HighTyAgentPriceSqlProvider {
sql.SET("id = #{record.id,jdbcType=BIGINT}"); sql.SET("id = #{record.id,jdbcType=BIGINT}");
} }
if (record.getBelongType() != null) {
sql.SET("belong_type = #{record.belongType,jdbcType=INTEGER}");
}
if (record.getOilStationId() != null) {
sql.SET("oil_station_id = #{record.oilStationId,jdbcType=BIGINT}");
}
if (record.getOilStationName() != null) {
sql.SET("oil_station_name = #{record.oilStationName,jdbcType=VARCHAR}");
}
if (record.getTyAgentOilStationId() != null) { if (record.getTyAgentOilStationId() != null) {
sql.SET("ty_agent_oil_station_id = #{record.tyAgentOilStationId,jdbcType=BIGINT}"); sql.SET("ty_agent_oil_station_id = #{record.tyAgentOilStationId,jdbcType=BIGINT}");
} }
@ -158,6 +185,9 @@ public class HighTyAgentPriceSqlProvider {
sql.UPDATE("high_ty_agent_price"); sql.UPDATE("high_ty_agent_price");
sql.SET("id = #{record.id,jdbcType=BIGINT}"); sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("belong_type = #{record.belongType,jdbcType=INTEGER}");
sql.SET("oil_station_id = #{record.oilStationId,jdbcType=BIGINT}");
sql.SET("oil_station_name = #{record.oilStationName,jdbcType=VARCHAR}");
sql.SET("ty_agent_oil_station_id = #{record.tyAgentOilStationId,jdbcType=BIGINT}"); sql.SET("ty_agent_oil_station_id = #{record.tyAgentOilStationId,jdbcType=BIGINT}");
sql.SET("oil_no_name = #{record.oilNoName,jdbcType=VARCHAR}"); sql.SET("oil_no_name = #{record.oilNoName,jdbcType=VARCHAR}");
sql.SET("oil_no = #{record.oilNo,jdbcType=VARCHAR}"); sql.SET("oil_no = #{record.oilNo,jdbcType=VARCHAR}");
@ -178,6 +208,18 @@ public class HighTyAgentPriceSqlProvider {
SQL sql = new SQL(); SQL sql = new SQL();
sql.UPDATE("high_ty_agent_price"); sql.UPDATE("high_ty_agent_price");
if (record.getBelongType() != null) {
sql.SET("belong_type = #{belongType,jdbcType=INTEGER}");
}
if (record.getOilStationId() != null) {
sql.SET("oil_station_id = #{oilStationId,jdbcType=BIGINT}");
}
if (record.getOilStationName() != null) {
sql.SET("oil_station_name = #{oilStationName,jdbcType=VARCHAR}");
}
if (record.getTyAgentOilStationId() != null) { if (record.getTyAgentOilStationId() != null) {
sql.SET("ty_agent_oil_station_id = #{tyAgentOilStationId,jdbcType=BIGINT}"); sql.SET("ty_agent_oil_station_id = #{tyAgentOilStationId,jdbcType=BIGINT}");
} }

@ -58,6 +58,11 @@ public class HighGasOilPrice implements Serializable {
*/ */
private String oilTypeName; private String oilTypeName;
/**
* 状态 0删除 1正常 2禁用
*/
private Integer status;
private String ext1; private String ext1;
private String ext2; private String ext2;
@ -138,6 +143,14 @@ public class HighGasOilPrice implements Serializable {
this.oilTypeName = oilTypeName; this.oilTypeName = oilTypeName;
} }
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getExt1() { public String getExt1() {
return ext1; return ext1;
} }
@ -183,6 +196,7 @@ public class HighGasOilPrice implements Serializable {
&& (this.getPriceOfficial() == null ? other.getPriceOfficial() == null : this.getPriceOfficial().equals(other.getPriceOfficial())) && (this.getPriceOfficial() == null ? other.getPriceOfficial() == null : this.getPriceOfficial().equals(other.getPriceOfficial()))
&& (this.getOilType() == null ? other.getOilType() == null : this.getOilType().equals(other.getOilType())) && (this.getOilType() == null ? other.getOilType() == null : this.getOilType().equals(other.getOilType()))
&& (this.getOilTypeName() == null ? other.getOilTypeName() == null : this.getOilTypeName().equals(other.getOilTypeName())) && (this.getOilTypeName() == null ? other.getOilTypeName() == null : this.getOilTypeName().equals(other.getOilTypeName()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) && (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1()))
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) && (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()));
@ -201,6 +215,7 @@ public class HighGasOilPrice implements Serializable {
result = prime * result + ((getPriceOfficial() == null) ? 0 : getPriceOfficial().hashCode()); result = prime * result + ((getPriceOfficial() == null) ? 0 : getPriceOfficial().hashCode());
result = prime * result + ((getOilType() == null) ? 0 : getOilType().hashCode()); result = prime * result + ((getOilType() == null) ? 0 : getOilType().hashCode());
result = prime * result + ((getOilTypeName() == null) ? 0 : getOilTypeName().hashCode()); result = prime * result + ((getOilTypeName() == null) ? 0 : getOilTypeName().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode());
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode());
@ -222,6 +237,7 @@ public class HighGasOilPrice implements Serializable {
sb.append(", priceOfficial=").append(priceOfficial); sb.append(", priceOfficial=").append(priceOfficial);
sb.append(", oilType=").append(oilType); sb.append(", oilType=").append(oilType);
sb.append(", oilTypeName=").append(oilTypeName); sb.append(", oilTypeName=").append(oilTypeName);
sb.append(", status=").append(status);
sb.append(", ext1=").append(ext1); sb.append(", ext1=").append(ext1);
sb.append(", ext2=").append(ext2); sb.append(", ext2=").append(ext2);
sb.append(", ext3=").append(ext3); sb.append(", ext3=").append(ext3);

@ -685,6 +685,66 @@ public class HighGasOilPriceExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andStatusIsNull() {
addCriterion("`status` is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("`status` is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(Integer value) {
addCriterion("`status` =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(Integer value) {
addCriterion("`status` <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(Integer value) {
addCriterion("`status` >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("`status` >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(Integer value) {
addCriterion("`status` <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(Integer value) {
addCriterion("`status` <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<Integer> values) {
addCriterion("`status` in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Integer> values) {
addCriterion("`status` not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(Integer value1, Integer value2) {
addCriterion("`status` between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(Integer value1, Integer value2) {
addCriterion("`status` not between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andExt1IsNull() { public Criteria andExt1IsNull() {
addCriterion("ext_1 is null"); addCriterion("ext_1 is null");
return (Criteria) this; return (Criteria) this;

@ -16,6 +16,21 @@ import java.util.Date;
public class HighTyAgentPrice implements Serializable { public class HighTyAgentPrice implements Serializable {
private Long id; private Long id;
/**
* 类型 1平台 2代理商
*/
private Integer belongType;
/**
* 加油站id
*/
private Long oilStationId;
/**
* 加油站名称
*/
private String oilStationName;
/** /**
* 代理油站id * 代理油站id
*/ */
@ -67,6 +82,30 @@ public class HighTyAgentPrice implements Serializable {
this.id = id; this.id = id;
} }
public Integer getBelongType() {
return belongType;
}
public void setBelongType(Integer belongType) {
this.belongType = belongType;
}
public Long getOilStationId() {
return oilStationId;
}
public void setOilStationId(Long oilStationId) {
this.oilStationId = oilStationId;
}
public String getOilStationName() {
return oilStationName;
}
public void setOilStationName(String oilStationName) {
this.oilStationName = oilStationName;
}
public Long getTyAgentOilStationId() { public Long getTyAgentOilStationId() {
return tyAgentOilStationId; return tyAgentOilStationId;
} }
@ -160,6 +199,9 @@ public class HighTyAgentPrice implements Serializable {
} }
HighTyAgentPrice other = (HighTyAgentPrice) that; HighTyAgentPrice other = (HighTyAgentPrice) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getBelongType() == null ? other.getBelongType() == null : this.getBelongType().equals(other.getBelongType()))
&& (this.getOilStationId() == null ? other.getOilStationId() == null : this.getOilStationId().equals(other.getOilStationId()))
&& (this.getOilStationName() == null ? other.getOilStationName() == null : this.getOilStationName().equals(other.getOilStationName()))
&& (this.getTyAgentOilStationId() == null ? other.getTyAgentOilStationId() == null : this.getTyAgentOilStationId().equals(other.getTyAgentOilStationId())) && (this.getTyAgentOilStationId() == null ? other.getTyAgentOilStationId() == null : this.getTyAgentOilStationId().equals(other.getTyAgentOilStationId()))
&& (this.getOilNoName() == null ? other.getOilNoName() == null : this.getOilNoName().equals(other.getOilNoName())) && (this.getOilNoName() == null ? other.getOilNoName() == null : this.getOilNoName().equals(other.getOilNoName()))
&& (this.getOilNo() == null ? other.getOilNo() == null : this.getOilNo().equals(other.getOilNo())) && (this.getOilNo() == null ? other.getOilNo() == null : this.getOilNo().equals(other.getOilNo()))
@ -177,6 +219,9 @@ public class HighTyAgentPrice implements Serializable {
final int prime = 31; final int prime = 31;
int result = 1; int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getBelongType() == null) ? 0 : getBelongType().hashCode());
result = prime * result + ((getOilStationId() == null) ? 0 : getOilStationId().hashCode());
result = prime * result + ((getOilStationName() == null) ? 0 : getOilStationName().hashCode());
result = prime * result + ((getTyAgentOilStationId() == null) ? 0 : getTyAgentOilStationId().hashCode()); result = prime * result + ((getTyAgentOilStationId() == null) ? 0 : getTyAgentOilStationId().hashCode());
result = prime * result + ((getOilNoName() == null) ? 0 : getOilNoName().hashCode()); result = prime * result + ((getOilNoName() == null) ? 0 : getOilNoName().hashCode());
result = prime * result + ((getOilNo() == null) ? 0 : getOilNo().hashCode()); result = prime * result + ((getOilNo() == null) ? 0 : getOilNo().hashCode());
@ -197,6 +242,9 @@ public class HighTyAgentPrice implements Serializable {
sb.append(" ["); sb.append(" [");
sb.append("Hash = ").append(hashCode()); sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id); sb.append(", id=").append(id);
sb.append(", belongType=").append(belongType);
sb.append(", oilStationId=").append(oilStationId);
sb.append(", oilStationName=").append(oilStationName);
sb.append(", tyAgentOilStationId=").append(tyAgentOilStationId); sb.append(", tyAgentOilStationId=").append(tyAgentOilStationId);
sb.append(", oilNoName=").append(oilNoName); sb.append(", oilNoName=").append(oilNoName);
sb.append(", oilNo=").append(oilNo); sb.append(", oilNo=").append(oilNo);

@ -186,6 +186,196 @@ public class HighTyAgentPriceExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andBelongTypeIsNull() {
addCriterion("belong_type is null");
return (Criteria) this;
}
public Criteria andBelongTypeIsNotNull() {
addCriterion("belong_type is not null");
return (Criteria) this;
}
public Criteria andBelongTypeEqualTo(Integer value) {
addCriterion("belong_type =", value, "belongType");
return (Criteria) this;
}
public Criteria andBelongTypeNotEqualTo(Integer value) {
addCriterion("belong_type <>", value, "belongType");
return (Criteria) this;
}
public Criteria andBelongTypeGreaterThan(Integer value) {
addCriterion("belong_type >", value, "belongType");
return (Criteria) this;
}
public Criteria andBelongTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("belong_type >=", value, "belongType");
return (Criteria) this;
}
public Criteria andBelongTypeLessThan(Integer value) {
addCriterion("belong_type <", value, "belongType");
return (Criteria) this;
}
public Criteria andBelongTypeLessThanOrEqualTo(Integer value) {
addCriterion("belong_type <=", value, "belongType");
return (Criteria) this;
}
public Criteria andBelongTypeIn(List<Integer> values) {
addCriterion("belong_type in", values, "belongType");
return (Criteria) this;
}
public Criteria andBelongTypeNotIn(List<Integer> values) {
addCriterion("belong_type not in", values, "belongType");
return (Criteria) this;
}
public Criteria andBelongTypeBetween(Integer value1, Integer value2) {
addCriterion("belong_type between", value1, value2, "belongType");
return (Criteria) this;
}
public Criteria andBelongTypeNotBetween(Integer value1, Integer value2) {
addCriterion("belong_type not between", value1, value2, "belongType");
return (Criteria) this;
}
public Criteria andOilStationIdIsNull() {
addCriterion("oil_station_id is null");
return (Criteria) this;
}
public Criteria andOilStationIdIsNotNull() {
addCriterion("oil_station_id is not null");
return (Criteria) this;
}
public Criteria andOilStationIdEqualTo(Long value) {
addCriterion("oil_station_id =", value, "oilStationId");
return (Criteria) this;
}
public Criteria andOilStationIdNotEqualTo(Long value) {
addCriterion("oil_station_id <>", value, "oilStationId");
return (Criteria) this;
}
public Criteria andOilStationIdGreaterThan(Long value) {
addCriterion("oil_station_id >", value, "oilStationId");
return (Criteria) this;
}
public Criteria andOilStationIdGreaterThanOrEqualTo(Long value) {
addCriterion("oil_station_id >=", value, "oilStationId");
return (Criteria) this;
}
public Criteria andOilStationIdLessThan(Long value) {
addCriterion("oil_station_id <", value, "oilStationId");
return (Criteria) this;
}
public Criteria andOilStationIdLessThanOrEqualTo(Long value) {
addCriterion("oil_station_id <=", value, "oilStationId");
return (Criteria) this;
}
public Criteria andOilStationIdIn(List<Long> values) {
addCriterion("oil_station_id in", values, "oilStationId");
return (Criteria) this;
}
public Criteria andOilStationIdNotIn(List<Long> values) {
addCriterion("oil_station_id not in", values, "oilStationId");
return (Criteria) this;
}
public Criteria andOilStationIdBetween(Long value1, Long value2) {
addCriterion("oil_station_id between", value1, value2, "oilStationId");
return (Criteria) this;
}
public Criteria andOilStationIdNotBetween(Long value1, Long value2) {
addCriterion("oil_station_id not between", value1, value2, "oilStationId");
return (Criteria) this;
}
public Criteria andOilStationNameIsNull() {
addCriterion("oil_station_name is null");
return (Criteria) this;
}
public Criteria andOilStationNameIsNotNull() {
addCriterion("oil_station_name is not null");
return (Criteria) this;
}
public Criteria andOilStationNameEqualTo(String value) {
addCriterion("oil_station_name =", value, "oilStationName");
return (Criteria) this;
}
public Criteria andOilStationNameNotEqualTo(String value) {
addCriterion("oil_station_name <>", value, "oilStationName");
return (Criteria) this;
}
public Criteria andOilStationNameGreaterThan(String value) {
addCriterion("oil_station_name >", value, "oilStationName");
return (Criteria) this;
}
public Criteria andOilStationNameGreaterThanOrEqualTo(String value) {
addCriterion("oil_station_name >=", value, "oilStationName");
return (Criteria) this;
}
public Criteria andOilStationNameLessThan(String value) {
addCriterion("oil_station_name <", value, "oilStationName");
return (Criteria) this;
}
public Criteria andOilStationNameLessThanOrEqualTo(String value) {
addCriterion("oil_station_name <=", value, "oilStationName");
return (Criteria) this;
}
public Criteria andOilStationNameLike(String value) {
addCriterion("oil_station_name like", value, "oilStationName");
return (Criteria) this;
}
public Criteria andOilStationNameNotLike(String value) {
addCriterion("oil_station_name not like", value, "oilStationName");
return (Criteria) this;
}
public Criteria andOilStationNameIn(List<String> values) {
addCriterion("oil_station_name in", values, "oilStationName");
return (Criteria) this;
}
public Criteria andOilStationNameNotIn(List<String> values) {
addCriterion("oil_station_name not in", values, "oilStationName");
return (Criteria) this;
}
public Criteria andOilStationNameBetween(String value1, String value2) {
addCriterion("oil_station_name between", value1, value2, "oilStationName");
return (Criteria) this;
}
public Criteria andOilStationNameNotBetween(String value1, String value2) {
addCriterion("oil_station_name not between", value1, value2, "oilStationName");
return (Criteria) this;
}
public Criteria andTyAgentOilStationIdIsNull() { public Criteria andTyAgentOilStationIdIsNull() {
addCriterion("ty_agent_oil_station_id is null"); addCriterion("ty_agent_oil_station_id is null");
return (Criteria) this; return (Criteria) this;

@ -0,0 +1,36 @@
package com.hai.enum_type;
/**
* 油站油品价格状态
* @author hurui
*/
public enum GasOilPriceStatusEnum {
status0(0 , "删除"),
status1(1 , "正常"),
status2(2 , "禁用"),
;
private Integer status;
private String name;
GasOilPriceStatusEnum(int status , String name) {
this.status = status;
this.name = name;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

@ -0,0 +1,62 @@
package com.hai.model;
import java.math.BigDecimal;
import java.util.Date;
public class GzSinopecModel {
// 卡券名称
private String couponName;
// 卡券价格
private BigDecimal salesPrice;
// 销售时间
private Date salesTime;
// 领取人
private String convertUserPhone;
// 状态
private Integer status;
public String getCouponName() {
return couponName;
}
public void setCouponName(String couponName) {
this.couponName = couponName;
}
public BigDecimal getSalesPrice() {
return salesPrice;
}
public void setSalesPrice(BigDecimal salesPrice) {
this.salesPrice = salesPrice;
}
public Date getSalesTime() {
return salesTime;
}
public void setSalesTime(Date salesTime) {
this.salesTime = salesTime;
}
public String getConvertUserPhone() {
return convertUserPhone;
}
public void setConvertUserPhone(String convertUserPhone) {
this.convertUserPhone = convertUserPhone;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
}

@ -2,6 +2,7 @@ package com.hai.service;
import com.hai.entity.HighCoupon; import com.hai.entity.HighCoupon;
import com.hai.entity.HighCouponCode; import com.hai.entity.HighCouponCode;
import com.hai.model.GzSinopecModel;
import com.hai.model.OrderSumModel; import com.hai.model.OrderSumModel;
import com.hai.model.UserInfoModel; import com.hai.model.UserInfoModel;
@ -111,4 +112,11 @@ public interface HighCouponCodeService {
**/ **/
List<HighCouponCode> getCouponCodeList(Map<String,Object> map); List<HighCouponCode> getCouponCodeList(Map<String,Object> map);
/**
* 查询贵州中石化卡券
* @param map
* @return
*/
List<GzSinopecModel> getGzSinopecAssignList(Map<String,Object> map) throws Exception;
} }

@ -2,6 +2,8 @@ package com.hai.service;
import com.hai.entity.HighTyAgentPrice; import com.hai.entity.HighTyAgentPrice;
import java.util.List;
/** /**
* 加油价格 * 加油价格
* @author hurui * @author hurui
@ -16,9 +18,19 @@ public interface HighTyAgentPriceService {
/** /**
* 根据代理油站id 查询详情 * 根据代理油站id 查询详情
* @param tyAgentOilStationId * @param belongType
* @param oilStationId
* @param oilNo
* @return
*/
HighTyAgentPrice getDetail(Integer belongType, Long oilStationId, String oilNo);
/**
* 查询油站价格
* @param belongType
* @param oilStationId
* @return * @return
*/ */
HighTyAgentPrice getDetail(Long tyAgentOilStationId, String oilNo); List<HighTyAgentPrice> getPriceList(Integer belongType, Long oilStationId);
} }

@ -553,6 +553,7 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService {
convertCode.setConvertUserPhone(phone); convertCode.setConvertUserPhone(phone);
convertCode.setRemark(remark); convertCode.setRemark(remark);
convertCode.setCouponCode(System.currentTimeMillis()+""); convertCode.setCouponCode(System.currentTimeMillis()+"");
convertCode.setSalesTime(new Date());
convertCode.setStatus(2); convertCode.setStatus(2);
highCouponAgentCodeMapper.updateByPrimaryKey(convertCode); highCouponAgentCodeMapper.updateByPrimaryKey(convertCode);

@ -10,6 +10,7 @@ import com.hai.dao.HighChildOrderMapper;
import com.hai.dao.HighCouponCodeMapper; import com.hai.dao.HighCouponCodeMapper;
import com.hai.dao.HighCouponCodeMapperExt; import com.hai.dao.HighCouponCodeMapperExt;
import com.hai.entity.*; import com.hai.entity.*;
import com.hai.model.GzSinopecModel;
import com.hai.model.UserInfoModel; import com.hai.model.UserInfoModel;
import com.hai.service.*; import com.hai.service.*;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
@ -282,5 +283,17 @@ public class HighCouponCodeServiceImpl implements HighCouponCodeService {
return highCouponCodeMapper.selectByExample(example); return highCouponCodeMapper.selectByExample(example);
} }
@Override
public List<GzSinopecModel> getGzSinopecAssignList(Map<String, Object> map) throws Exception {
if (MapUtils.getLong(map, "assignTimeS") != null) {
map.put("assignTimeS", DateUtil.date2String(new Date(MapUtils.getLong(map, "assignTimeS")), "yyyy-MM-dd HH:mm:ss"));
}
if (MapUtils.getLong(map, "assignTimeE") != null) {
map.put("assignTimeE", DateUtil.date2String(new Date(MapUtils.getLong(map, "assignTimeE")), "yyyy-MM-dd HH:mm:ss"));
}
return highCouponCodeMapper.selectGzSinopecAssignList(map);
}
} }

@ -3,6 +3,7 @@ package com.hai.service.impl;
import com.hai.dao.HighGasOilPriceMapper; import com.hai.dao.HighGasOilPriceMapper;
import com.hai.entity.HighGasOilPrice; import com.hai.entity.HighGasOilPrice;
import com.hai.entity.HighGasOilPriceExample; import com.hai.entity.HighGasOilPriceExample;
import com.hai.enum_type.GasOilPriceStatusEnum;
import com.hai.service.HighGasOilPriceService; import com.hai.service.HighGasOilPriceService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -21,6 +22,7 @@ public class HighGasOilPriceServiceImpl implements HighGasOilPriceService {
if (highGasOilPrice.getId() != null) { if (highGasOilPrice.getId() != null) {
highGasOilPriceMapper.updateByPrimaryKey(highGasOilPrice); highGasOilPriceMapper.updateByPrimaryKey(highGasOilPrice);
} else { } else {
highGasOilPrice.setStatus(GasOilPriceStatusEnum.status1.getStatus());
highGasOilPriceMapper.insert(highGasOilPrice); highGasOilPriceMapper.insert(highGasOilPrice);
} }
} }
@ -39,7 +41,7 @@ public class HighGasOilPriceServiceImpl implements HighGasOilPriceService {
@Override @Override
public List<HighGasOilPrice> getGasOilPriceByStore(Long storeId) { public List<HighGasOilPrice> getGasOilPriceByStore(Long storeId) {
HighGasOilPriceExample example = new HighGasOilPriceExample(); HighGasOilPriceExample example = new HighGasOilPriceExample();
example.createCriteria().andMerchantStoreIdEqualTo(storeId); example.createCriteria().andMerchantStoreIdEqualTo(storeId).andStatusNotEqualTo(0);
return highGasOilPriceMapper.selectByExample(example); return highGasOilPriceMapper.selectByExample(example);
} }

@ -29,6 +29,9 @@ public class HighTyAgentOilStationServiceImpl implements HighTyAgentOilStationSe
@Resource @Resource
private HighTySalesmanService tySalesmanService; private HighTySalesmanService tySalesmanService;
@Resource
private HighTyAgentPriceService tyAgentPriceService;
@Resource @Resource
private HighMerchantStoreService merchantStoreService; private HighMerchantStoreService merchantStoreService;
@ -106,6 +109,12 @@ public class HighTyAgentOilStationServiceImpl implements HighTyAgentOilStationSe
} }
detail.setStatus(0); detail.setStatus(0);
editData(detail); editData(detail);
List<HighTyAgentPrice> priceList = tyAgentPriceService.getPriceList(2, detail.getOilStationId());
for (HighTyAgentPrice price : priceList) {
price.setStatus(0);
tyAgentPriceService.editTyAgentPrice(price);
}
} }
} }
@ -144,6 +153,12 @@ public class HighTyAgentOilStationServiceImpl implements HighTyAgentOilStationSe
detail.setTySalesmanId(null); detail.setTySalesmanId(null);
detail.setTySalesmanName(null); detail.setTySalesmanName(null);
editData(detail); editData(detail);
List<HighTyAgentPrice> priceList = tyAgentPriceService.getPriceList(2, detail.getOilStationId());
for (HighTyAgentPrice price : priceList) {
price.setStatus(0);
tyAgentPriceService.editTyAgentPrice(price);
}
} }
} }

@ -30,11 +30,12 @@ public class HighTyAgentPriceServiceImpl implements HighTyAgentPriceService {
} }
@Override @Override
public HighTyAgentPrice getDetail(Long tyAgentOilStationId, String oilNo) { public HighTyAgentPrice getDetail(Integer belongType, Long oilStationId, String oilNo) {
HighTyAgentPriceExample example = new HighTyAgentPriceExample(); HighTyAgentPriceExample example = new HighTyAgentPriceExample();
example.createCriteria() example.createCriteria()
.andBelongTypeEqualTo(belongType)
.andStatusEqualTo(1) .andStatusEqualTo(1)
.andTyAgentOilStationIdEqualTo(tyAgentOilStationId) .andOilStationIdEqualTo(oilStationId)
.andOilNoEqualTo(oilNo); .andOilNoEqualTo(oilNo);
List<HighTyAgentPrice> list = tyAgentPriceMapper.selectByExample(example); List<HighTyAgentPrice> list = tyAgentPriceMapper.selectByExample(example);
if (list.size() > 0) { if (list.size() > 0) {
@ -42,4 +43,14 @@ public class HighTyAgentPriceServiceImpl implements HighTyAgentPriceService {
} }
return null; return null;
} }
@Override
public List<HighTyAgentPrice> getPriceList(Integer belongType, Long oilStationId) {
HighTyAgentPriceExample example = new HighTyAgentPriceExample();
example.createCriteria()
.andBelongTypeEqualTo(belongType)
.andOilStationIdEqualTo(oilStationId)
.andStatusEqualTo(1);
return tyAgentPriceMapper.selectByExample(example);
}
} }

@ -380,6 +380,24 @@ public class GoodsOrderServiceImpl implements PayService {
highOrderService.updateOrder(order); highOrderService.updateOrder(order);
if (order.getHighChildOrderList().get(0).getGoodsType().equals(3)) {
new Thread(() -> {
try {
Thread.sleep(120*1000);
BigDecimal rake = new BigDecimal("0.05");
// 计算微信收取的手续费 支付金额 * 0.002 注:如果与两个相邻数字的距离相等,则为上舍入的舍入模式。
BigDecimal wxHandlingFee = order.getPayRealPrice().multiply(new BigDecimal("0.002")).setScale(2,BigDecimal.ROUND_HALF_DOWN);
BigDecimal price = order.getPayRealPrice().subtract(wxHandlingFee);
// 计算分账金额 手续费后的价格 * 0.05 注:如果与两个相邻数字的距离相等,则为上舍入的舍入模式。
BigDecimal profitSharingAmount = price.multiply(rake).setScale(2,BigDecimal.ROUND_DOWN);
this.wxGasProfitsharing(order.getExt1(), order.getPaySerialNo(),order.getOrderNo(),profitSharingAmount);
} catch (InterruptedException e) {
e.printStackTrace();
}
}).start();
} else {
new Thread(() -> { new Thread(() -> {
try { try {
Thread.sleep(120*1000); Thread.sleep(120*1000);
@ -391,7 +409,7 @@ public class GoodsOrderServiceImpl implements PayService {
// 计算分账金额 手续费后的价格 * 0.01 注:如果与两个相邻数字的距离相等,则为上舍入的舍入模式。 // 计算分账金额 手续费后的价格 * 0.01 注:如果与两个相邻数字的距离相等,则为上舍入的舍入模式。
BigDecimal profitSharingAmount = price.multiply(rake).setScale(2,BigDecimal.ROUND_DOWN); BigDecimal profitSharingAmount = price.multiply(rake).setScale(2,BigDecimal.ROUND_DOWN);
this.wxProfitsharing(order.getPaySerialNo(),order.getOrderNo(),profitSharingAmount); this.wxProfitsharing(order.getExt1(), order.getPaySerialNo(),order.getOrderNo(),profitSharingAmount);
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -399,14 +417,27 @@ public class GoodsOrderServiceImpl implements PayService {
} }
} }
} }
}
public static void main(String[] args) {
BigDecimal totalPrice = new BigDecimal("100");
public void wxProfitsharing(String transaction_id,String out_order_no, BigDecimal amount) { BigDecimal wxHandlingFee = totalPrice.multiply(new BigDecimal("0.002")).setScale(2,BigDecimal.ROUND_HALF_DOWN);
System.out.println("手续费:" + wxHandlingFee);
BigDecimal price = totalPrice.subtract(wxHandlingFee);
System.out.println("扣除手机费后的价格:" + price);
BigDecimal profitSharingAmount = price.multiply(new BigDecimal("0.05")).setScale(2,BigDecimal.ROUND_DOWN);
System.out.println("实际分账价格:" + profitSharingAmount);
}
public void wxGasProfitsharing(String appid, String transaction_id,String out_order_no, BigDecimal amount) {
try { try {
Map<String,String> param = new LinkedHashMap<>(); Map<String,String> param = new LinkedHashMap<>();
param.put("appid", "wx637bd6f7314daa46"); param.put("appid", appid);
param.put("mch_id", "1289663601"); param.put("mch_id", "1289663601");
param.put("sub_mch_id" , "1609882817"); // 个体户黎杨珍 param.put("sub_mch_id" , "1624126902"); // 渝北区浩联物资经营部
param.put("transaction_id" , transaction_id); param.put("transaction_id" , transaction_id);
param.put("out_order_no" , out_order_no); param.put("out_order_no" , out_order_no);
param.put("nonce_str" , WxUtils.makeNonStr()); param.put("nonce_str" , WxUtils.makeNonStr());
@ -444,6 +475,48 @@ public class GoodsOrderServiceImpl implements PayService {
} }
} }
public void wxProfitsharing(String appid,String transaction_id,String out_order_no, BigDecimal amount) {
try {
Map<String,String> param = new LinkedHashMap<>();
param.put("appid", appid);
param.put("mch_id", "1289663601");
param.put("sub_mch_id" , "1609882817"); // 个体户黎杨珍
param.put("transaction_id" , transaction_id);
param.put("out_order_no" , out_order_no);
param.put("nonce_str" , WxUtils.makeNonStr());
// 分账金额
BigDecimal porofitSharingAmount = amount;
List<Map<String,Object>> receiversList = new ArrayList<>();
Map<String,Object> receiversMap = new LinkedHashMap<>();
receiversMap.put("type", "MERCHANT_ID");
receiversMap.put("account", "1603942866");
receiversMap.put("amount", porofitSharingAmount.multiply(new BigDecimal("100")).intValue());
receiversMap.put("description", "分给商户【惠昕石化】");
receiversList.add(receiversMap);
param.put("receivers" , JSONObject.toJSONString(receiversList));
String signStr = WxUtils.generateSignature(param, "Skufk5oi85wDFGl888i6wsRSTkdd5df5" , WXPayConstants.SignType.HMACSHA256);
param.put("sign" , signStr);
String resultXmL = this.doRefundRequest(param.get("mch_id"),null, WxUtils.mapToXml(param));
// 请求分账返回的结果
ResultProfitSharing resultProfitSharing = XmlUtil.getObjectFromXML(resultXmL, ResultProfitSharing.class);
HighProfitSharingRecord sharingRecord = new HighProfitSharingRecord();
sharingRecord.setOutOrderNo(out_order_no);
sharingRecord.setTransactionId(transaction_id);
sharingRecord.setOrderId(resultProfitSharing.getOrder_id());
sharingRecord.setStatus(resultProfitSharing.getResult_code());
sharingRecord.setPrice(amount);
sharingRecord.setCreateTime(new Date());
sharingRecord.setContent(resultXmL);
highProfitSharingRecordService.insert(sharingRecord);
} catch (Exception e) {
log.error("CmsContentController --> getCorporateAdvertising() error!", e);
}
}
public CloseableHttpClient readCertificate(String mchId) throws Exception{ public CloseableHttpClient readCertificate(String mchId) throws Exception{
/** /**

@ -56,3 +56,8 @@ CzNotifyUrl = https://hsgcs.dctpay.com/crest/czOrder/rechargeCallback
CzAppKey = eaomqcbpdz7yjfih CzAppKey = eaomqcbpdz7yjfih
CzUrl = https://hfcs.dmjvip.com/index.php/third/mobile/ CzUrl = https://hfcs.dmjvip.com/index.php/third/mobile/
CzAppSecret = xkf9eoq2cjh6uvzp0mtrga134lnibdw8 CzAppSecret = xkf9eoq2cjh6uvzp0mtrga134lnibdw8
unionAppId=7113783e75354df2a985efd3f31b9528
unionSecret=e2c731d2a026469aa6d218432f361653
unionRsaKey=891f6775fba7f12cc23df7c75e02b39b891f6775fba7f12c

@ -42,3 +42,8 @@ wx_cert=/home/project/wx_cert/
TelApiKey=2d01f6b520254b1a80f6b167832cea18 TelApiKey=2d01f6b520254b1a80f6b167832cea18
TelApiSecret=d11ee9b41e014a039f030e53ae6f5295 TelApiSecret=d11ee9b41e014a039f030e53ae6f5295
TelMemberId=d13091df65d64aafbf0f35d2093157b7 TelMemberId=d13091df65d64aafbf0f35d2093157b7
unionAppId=7113783e75354df2a985efd3f31b9528
unionSecret=e2c731d2a026469aa6d218432f361653
unionRsaKey=891f6775fba7f12cc23df7c75e02b39b891f6775fba7f12c

@ -51,3 +51,7 @@ CzNotifyUrl = https://hsg.dctpay.com/crest/czOrder/rechargeCallback
CzAppKey = p429mlj3cvn5hb07 CzAppKey = p429mlj3cvn5hb07
CzUrl = https://jj.dmjvip.com/index.php/third/mobile/ CzUrl = https://jj.dmjvip.com/index.php/third/mobile/
CzAppSecret = bf57pnqy8mkexr0v169c3g4odazwu2ij CzAppSecret = bf57pnqy8mkexr0v169c3g4odazwu2ij
unionAppId=cf56ac6f9f6b4744bfba9e5587db147c
unionSecret=665193ddd44248acb461594cfe0ded5b
unionRsaKey=df0bdf7f5ef7bff770f2f21fe549c461df0bdf7f5ef7bff7

@ -51,3 +51,8 @@ CzNotifyUrl = https://hsg.dctpay.com/crest/czOrder/rechargeCallback
CzAppKey = p429mlj3cvn5hb07 CzAppKey = p429mlj3cvn5hb07
CzUrl = https://jj.dmjvip.com/index.php/third/mobile/ CzUrl = https://jj.dmjvip.com/index.php/third/mobile/
CzAppSecret = bf57pnqy8mkexr0v169c3g4odazwu2ij CzAppSecret = bf57pnqy8mkexr0v169c3g4odazwu2ij
unionAppId=cf56ac6f9f6b4744bfba9e5587db147c
unionSecret=665193ddd44248acb461594cfe0ded5b
unionRsaKey=df0bdf7f5ef7bff770f2f21fe549c461df0bdf7f5ef7bff7

Loading…
Cancel
Save