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. 51
      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) { if (order.getHighChildOrderList().get(0).getGoodsType() == 4) {
object = QianZhuConfig.getKfcOrderByOrderNo(order.getOrderNo()); object = QianZhuConfig.getKfcOrderByOrderNo(order.getHighChildOrderList().get(0).getChannelOrderNo());
if (object.getBoolean("success")) { if (object.getBoolean("success")) {
BeanUtils.copyProperties(order, partyModel);
partyModel.setCode(object.getJSONObject("data").getString("ticket")); partyModel.setCode(object.getJSONObject("data").getString("ticket"));
partyModel.setThirdOrderStatus(object.getJSONObject("data").getInteger("status")); partyModel.setThirdOrderStatus(object.getJSONObject("data").getInteger("status"));
partyModel.setStatusDesc(object.getJSONObject("data").getString("statusDesc")); 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")); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("message"));
} }
} else if (order.getHighChildOrderList().get(0).getGoodsType() == 9) { } else if (order.getHighChildOrderList().get(0).getGoodsType() == 9) {
// 查询详单订单的实际
JSONObject productDetail = thirdProductConfig.getThirdPartyByDetail(1, 1, order.getCompanyId() , null);
object = QianZhuConfig.starbucksOrderByOrderNo(order.getOrderNo()); object = QianZhuConfig.starbucksOrderByOrderNo(order.getOrderNo());
if (object.getBoolean("success")) { if (object.getBoolean("success")) {
BeanUtils.copyProperties(order, partyModel);
partyModel.setCode(object.getJSONObject("data").getString("ticket")); partyModel.setCode(object.getJSONObject("data").getString("ticket"));
partyModel.setStatusDesc(object.getJSONObject("data").getString("statusDesc")); partyModel.setStatusDesc(object.getJSONObject("data").getString("statusDesc"));
partyModel.setObject(object.getJSONObject("data")); 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); object.getJSONObject("data").put("paymentAmount" , orderPayPrice);
partyModel.setObject(object.getJSONObject("data")); partyModel.setObject(object.getJSONObject("data"));
@ -455,10 +436,7 @@ public class HighThirdPartyController {
log.error("getThirdOrderByOrderId error!", "查询失败!"); log.error("getThirdOrderByOrderId error!", "查询失败!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("message")); 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); return ResponseMsgUtil.success(partyModel);
} catch (Exception e) { } catch (Exception e) {
log.error("HighUserCardController --> oilCardRefund() error!", e); log.error("HighUserCardController --> oilCardRefund() error!", e);

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

@ -104,6 +104,11 @@ public class OrderController {
log.error("OrderController -> create() error!",""); log.error("OrderController -> create() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_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; package com.hai;
import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation;
import com.alicp.jetcache.anno.config.EnableMethodCache;
import com.hai.common.utils.SpringContextUtil; import com.hai.common.utils.SpringContextUtil;
import org.mybatis.spring.annotation.MapperScan; import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
@ -13,6 +15,8 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
//@ComponentScan //@ComponentScan
@EnableTransactionManagement @EnableTransactionManagement
@EnableScheduling @EnableScheduling
@EnableMethodCache(basePackages = "com.hai")
@EnableCreateCacheAnnotation
@ServletComponentScan @ServletComponentScan
@MapperScan("com.hai.dao") @MapperScan("com.hai.dao")
public class ScheduleApplication public class ScheduleApplication

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

@ -9,7 +9,7 @@ debug: false
#datasource数据源设置 #datasource数据源设置
spring: spring:
datasource: 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 username: root
password: HF123456. password: HF123456.
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
@ -27,7 +27,6 @@ spring:
testOnReturn: false testOnReturn: false
poolPreparedStatements: true poolPreparedStatements: true
maxOpenPreparedStatements: 20 maxOpenPreparedStatements: 20
redis: redis:
database: 0 database: 0
host: 139.159.177.244 host: 139.159.177.244
@ -55,33 +54,47 @@ spring:
# default: # default:
# topic: topic # topic: topic
#thymelea模板配置
thymeleaf:
prefix: classpath:/templates/
suffix: .html
mode: HTML5
encoding: UTF-8
#热部署文件,页面不产生缓存,及时更新
cache: false
#配置日期返回至前台为时间戳 #配置日期返回至前台为时间戳
jackson: jackson:
serialization: serialization:
write-dates-as-timestamps: true write-dates-as-timestamps: true
rocketmq:
name-server: 139.159.177.244:9876
thymeleaf: producer:
cache: false #必须指定group
prefix: classpath:/templates/ group: default-group
suffix: .html
encoding: UTF-8
content-type: text/html
mode: HTML5
mybatis: mybatis:
mapperLocations: mapperLocations:
- classpath*:sqlmap*/*.xml - classpath*:sqlmap*/*.xml
type-aliases-package: type-aliases-package:
org.springboot.sample.entity org.springboot.sample.entity
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
#开启MyBatis的二级缓存
cache-enabled: true
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: pagehelper:
helperDialect: mysql helperDialect: mysql

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

@ -66,4 +66,14 @@ public interface OrderCreateHandleService {
*/ */
List<HighChildOrder> thirdPartyOrder(JSONObject object) throws Exception; 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; return childOrderList;
} }
@Override
public HighChildOrder prepaidRecharge(JSONObject object) throws Exception {
return null;
}
} }

Loading…
Cancel
Save