dev-discount
袁野 2 years ago
parent ea91185db8
commit c4fe67f5a8
  1. 24
      hai-cweb/src/main/java/com/cweb/controller/HighThirdPartyController.java
  2. 9
      hai-cweb/src/main/resources/dev/application.yml
  3. 5
      hai-order/src/main/java/com/web/controller/OrderController.java
  4. 4
      hai-schedule/src/main/java/com/hai/ScheduleApplication.java
  5. 2
      hai-schedule/src/main/java/com/hai/schedule/ApiThirdProductSchedule.java
  6. 83
      hai-schedule/src/main/resources/dev/application.yml
  7. 2
      hai-service/src/main/java/com/hai/model/ThirdPartyModel.java
  8. 10
      hai-service/src/main/java/com/hai/order/service/OrderCreateHandleService.java
  9. 5
      hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java

@ -380,9 +380,8 @@ public class HighThirdPartyController {
if (order.getHighChildOrderList().get(0).getGoodsType() == 4) {
object = QianZhuConfig.getKfcOrderByOrderNo(order.getOrderNo());
object = QianZhuConfig.getKfcOrderByOrderNo(order.getHighChildOrderList().get(0).getChannelOrderNo());
if (object.getBoolean("success")) {
BeanUtils.copyProperties(order, partyModel);
partyModel.setCode(object.getJSONObject("data").getString("ticket"));
partyModel.setThirdOrderStatus(object.getJSONObject("data").getInteger("status"));
partyModel.setStatusDesc(object.getJSONObject("data").getString("statusDesc"));
@ -407,32 +406,14 @@ public class HighThirdPartyController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("message"));
}
} else if (order.getHighChildOrderList().get(0).getGoodsType() == 9) {
// 查询详单订单的实际
JSONObject productDetail = thirdProductConfig.getThirdPartyByDetail(1, 1, order.getCompanyId() , null);
object = QianZhuConfig.starbucksOrderByOrderNo(order.getOrderNo());
if (object.getBoolean("success")) {
BeanUtils.copyProperties(order, partyModel);
partyModel.setCode(object.getJSONObject("data").getString("ticket"));
partyModel.setStatusDesc(object.getJSONObject("data").getString("statusDesc"));
partyModel.setObject(object.getJSONObject("data"));
// 获取星巴克订单内容
JSONArray starbucksOrder = object.getJSONObject("data").getJSONArray("orderItems");
for (Object starbucksObject : starbucksOrder) {
JSONObject childObject = (JSONObject) starbucksObject;
// 计算利润
BigDecimal profitPrice = childObject.getBigDecimal("unitPrice").multiply(productDetail.getBigDecimal("priceDiscount").divide(new BigDecimal(100)));
BigDecimal childPrice = childObject.getBigDecimal("unitPrice").add(profitPrice).setScale(2 , RoundingMode.HALF_UP);
// 计算实际支付金额
orderPayPrice = orderPayPrice.add(childPrice);
childObject.put("unitPrice" , childPrice);
childObject.put("totalPrice" , childPrice.multiply(childObject.getBigDecimal("quantity")));
}
object.getJSONObject("data").put("paymentAmount" , orderPayPrice);
partyModel.setObject(object.getJSONObject("data"));
@ -455,10 +436,7 @@ public class HighThirdPartyController {
log.error("getThirdOrderByOrderId error!", "查询失败!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("message"));
}
} else if (order.getHighChildOrderList().get(0).getGoodsType() == 10) {
BeanUtils.copyProperties(order, partyModel);
}
return ResponseMsgUtil.success(partyModel);
} catch (Exception e) {
log.error("HighUserCardController --> oilCardRefund() error!", e);

@ -53,16 +53,17 @@ spring:
#MQTT默认的消息推送主题,实际可在调用接口是指定
# default:
# topic: topic
#配置日期返回至前台为时间戳
jackson:
serialization:
write-dates-as-timestamps: true
rocketmq:
name-server: 139.159.177.244:9876
producer:
#必须指定group
group: default-group
#配置日期返回至前台为时间戳
jackson:
serialization:
write-dates-as-timestamps: true
mybatis:
mapperLocations:
- classpath*:sqlmap*/*.xml

@ -104,6 +104,11 @@ public class OrderController {
log.error("OrderController -> create() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未填写加油信息;加油金额、油号、抢号");
}
} else if (childModel.getGoodsType().equals(OrderChildGoodsType.TYPE6.getNumber())) {
if (childModel.getRechargeContent() == null) {
log.error("OrderController -> create() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请输入充值内容!");
}
}
}

@ -1,5 +1,7 @@
package com.hai;
import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation;
import com.alicp.jetcache.anno.config.EnableMethodCache;
import com.hai.common.utils.SpringContextUtil;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
@ -13,6 +15,8 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
//@ComponentScan
@EnableTransactionManagement
@EnableScheduling
@EnableMethodCache(basePackages = "com.hai")
@EnableCreateCacheAnnotation
@ServletComponentScan
@MapperScan("com.hai.dao")
public class ScheduleApplication

@ -26,7 +26,7 @@ public class ApiThirdProductSchedule {
private ApiProductService apiProductService;
@Scheduled(cron = "0 0 1 * * ?") // 获取星巴克产品 每日凌晨1点执行一次
@Scheduled(cron="0 0/1 * * * ?") //每10分钟执行一次
public void getStarbucksProducts() throws Exception {
JSONObject jsonObject = QianZhuConfig.getStarbucksProducts(1 , 200);

@ -9,7 +9,7 @@ debug: false
#datasource数据源设置
spring:
datasource:
url: jdbc:mysql://139.159.177.244:3306/hfkj?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
url: jdbc:mysql://139.159.177.244:3306/hsg_order?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root
password: HF123456.
type: com.alibaba.druid.pool.DruidDataSource
@ -27,7 +27,6 @@ spring:
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
redis:
database: 0
host: 139.159.177.244
@ -50,41 +49,55 @@ spring:
password: 123654
#客户端id(不能重复)
# client:
# id: provider-id
#MQTT默认的消息推送主题,实际可在调用接口是指定
# default:
# id: provider-id
#MQTT默认的消息推送主题,实际可在调用接口是指定
# default:
# topic: topic
#thymelea模板配置
thymeleaf:
prefix: classpath:/templates/
suffix: .html
mode: HTML5
encoding: UTF-8
#热部署文件,页面不产生缓存,及时更新
cache: false
#配置日期返回至前台为时间戳
jackson:
serialization:
write-dates-as-timestamps: true
#配置日期返回至前台为时间戳
jackson:
serialization:
write-dates-as-timestamps: true
rocketmq:
name-server: 139.159.177.244:9876
producer:
#必须指定group
group: default-group
thymeleaf:
cache: false
prefix: classpath:/templates/
suffix: .html
encoding: UTF-8
content-type: text/html
mode: HTML5
mybatis:
mapperLocations:
- classpath*:sqlmap*/*.xml
type-aliases-package:
org.springboot.sample.entity
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
#开启MyBatis的二级缓存
cache-enabled: true
mybatis:
mapperLocations:
- classpath*:sqlmap*/*.xml
type-aliases-package:
org.springboot.sample.entity
jetcache:
statIntervalMinutes: 15
areaInCacheName: false
local:
default:
type: linkedhashmap
keyConvertor: fastjson
remote:
default:
type: redis
host: 139.159.177.244
port: 36379
password: HF123456.Redis
keyConvertor: fastjson
broadcastChannel: projectA
valueEncoder: java
valueDecoder: java
poolConfig:
minIdle: 5
maxIdle: 20
maxTotal: 50
pagehelper:
helperDialect: mysql
reasonable: true
supportMethodsArguments: true
params: count=countSql
pagehelper:
helperDialect: mysql
reasonable: true
supportMethodsArguments: true
params: count=countSql

@ -6,7 +6,7 @@ import com.hai.entity.HighOrder;
import java.util.List;
import java.util.Map;
public class ThirdPartyModel extends HighOrder {
public class ThirdPartyModel {
// 取餐码
private String code;

@ -66,4 +66,14 @@ public interface OrderCreateHandleService {
*/
List<HighChildOrder> thirdPartyOrder(JSONObject object) throws Exception;
/**
* @Author Sum1Dream
* @Name prepaidRecharge
* @Description // 话费充值订单校验
* @Date 16:45 2022/10/25
* @Param [object]
* @Return com.hai.entity.HighChildOrder
*/
HighChildOrder prepaidRecharge(JSONObject object) throws Exception;
}

@ -748,4 +748,9 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
return childOrderList;
}
@Override
public HighChildOrder prepaidRecharge(JSONObject object) throws Exception {
return null;
}
}

Loading…
Cancel
Save