提交代码

dev-discount
胡锐 2 years ago
parent f6092f9954
commit 96b72fbc51
  1. 37
      hai-bweb/src/main/java/com/bweb/controller/CommonController.java
  2. 14
      hai-bweb/src/main/resources/dev/application.yml
  3. 10
      hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java
  4. 6
      hai-service/src/main/java/com/hai/config/WxOrderConfig.java
  5. 9
      hai-service/src/main/java/com/hai/service/SecConfigService.java
  6. 5
      hai-service/src/main/java/com/hai/service/impl/SecConfigServiceImpl.java

@ -1,6 +1,9 @@
package com.bweb.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.utils.DateUtil;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.TuanYouConfig;
@ -11,6 +14,7 @@ import com.hai.service.CommonService;
import com.hai.service.SecConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
@ -144,6 +148,39 @@ public class CommonController {
}
}
@RequestMapping(value="/editConfig",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "添加配置")
public ResponseData editConfig(@RequestBody JSONObject body) {
try {
if (body == null
|| StringUtils.isBlank(body.getString("codeType"))
|| StringUtils.isBlank(body.getString("codeValue"))
) {
log.error("OrderController --> orderToPay() ERROR", "");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
SecConfig config = secConfigService.findByCodeType(body.getString("codeType"));
if (config == null) {
config = new SecConfig();
config.setCodeType(body.getString("codeType"));
config.setCodeValue(body.getString("codeValue"));
secConfigService.insertSecConfig(config);
} else {
config.setCodeValue(body.getString("codeValue"));
secConfigService.updateSecConfig(config);
}
return ResponseMsgUtil.success("修改成功");
} catch (Exception e) {
log.error("CommonController --> editConfig() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/updateDictionary",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据 码值类型 查询数据字典")

@ -39,6 +39,20 @@ spring:
max-wait: -1
max-idle: 10
min-idle: 0
#MQTT配置信息
mqtt:
#MQTT服务地址
url: ws://139.159.177.244:8083/mqtt
#用户名
username: printer_provider
#密码
password: 123654
#客户端id(不能重复)
# client:
# id: provider-id
#MQTT默认的消息推送主题,实际可在调用接口是指定
# default:
# topic: topic
#配置日期返回至前台为时间戳
jackson:
serialization:

@ -108,6 +108,9 @@ public class OrderController {
@Resource
private UnionStagingPayConfig unionStagingPayConfig;
@Resource
private SecConfigService configService;
/**
*
* @Title: orderToPay
@ -214,7 +217,12 @@ public class OrderController {
weChatPayReqInfo.setSub_mch_id(SysConst.getSysConfig().getWxGzSubMchId());//商户号
} else if (order.getHighChildOrderList().get(0).getGoodsType() == 3) {
weChatPayReqInfo.setSub_mch_id("1609882817"); // 浩联商户号
SecConfig wxMerNumber = configService.findByCodeType("OIL_WX_MER");
if (wxMerNumber == null) {
weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1624126902); // 浩联商户号
} else {
weChatPayReqInfo.setSub_mch_id(wxMerNumber.getCodeValue());
}
profitSharing = "Y";
// 查询油站

@ -62,6 +62,12 @@ public class WxOrderConfig {
*/
public static final String MCH_ID_1619676214 = "1619676214";
/**
* 微信支付商户号
* 渝北区浩联物资经营部
*/
public static final String MCH_ID_1624126902 = "1624126902";
public static OrderRefundModel orderToRefund(String paySerialNo,BigDecimal totalFee,BigDecimal refundFee) throws Exception {
Map<String,String> param = new HashMap<>();

@ -20,6 +20,15 @@ public interface SecConfigService {
**/
SecConfig findById(Integer id);
/**
* @ClassName SecConfigService.java
* @author Sum1Dream
* @version 1.0.0
* @Description //TODO
* @createTime 17:31 2021/6/23
**/
void insertSecConfig(SecConfig secConfig);
/**
* @ClassName SecConfigService.java
* @author Sum1Dream

@ -22,6 +22,11 @@ public class SecConfigServiceImpl implements SecConfigService {
return secConfigMapper.selectByPrimaryKey(id);
}
@Override
public void insertSecConfig(SecConfig secConfig) {
secConfigMapper.insert(secConfig);
}
@Override
public void updateSecConfig(SecConfig secConfig) {
secConfigMapper.updateByPrimaryKeySelective(secConfig);

Loading…
Cancel
Save