diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighTyAgentOilStationController.java b/hai-bweb/src/main/java/com/bweb/controller/HighTyAgentOilStationController.java index c65ec855..a2a3531a 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighTyAgentOilStationController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighTyAgentOilStationController.java @@ -30,6 +30,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.io.File; +import java.math.BigDecimal; import java.util.*; @Controller @@ -385,7 +386,12 @@ public class HighTyAgentOilStationController { } PageHelper.startPage(pageNum,pageSize); - return ResponseMsgUtil.success(new PageInfo<>(highTyAgentOilStationService.getOrderList(param))); + + PageInfo pageInfo = new PageInfo<>(highTyAgentOilStationService.getOrderList(param)); + for (TyOrderModel orderModel : pageInfo.getList()) { + orderModel.setOilLiters(orderModel.getTotalPrice().divide(orderModel.getGasPriceGun(), 2, BigDecimal.ROUND_HALF_DOWN)); + } + return ResponseMsgUtil.success(pageInfo); } catch (Exception e) { log.error("HighTyAgentController --> getAgentList() error!", e); @@ -471,6 +477,7 @@ public class HighTyAgentOilStationController { headList.add("团油订单号"); headList.add("支付类型"); headList.add("加油金额"); + headList.add("加油升数"); headList.add("优惠金额"); headList.add("实付金额"); headList.add("油号"); @@ -502,6 +509,7 @@ public class HighTyAgentOilStationController { data.add(orderModel.getGasOrderNo()); data.add(orderModel.getPayType()); data.add(orderModel.getTotalPrice()); + data.add(orderModel.getTotalPrice().divide(orderModel.getGasPriceGun(), 2, BigDecimal.ROUND_HALF_DOWN)); data.add(orderModel.getDeductionPrice()); data.add(orderModel.getPayRealPrice()); data.add(orderModel.getGasOilNo()); diff --git a/hai-bweb/src/main/resources/pre/application.yml b/hai-bweb/src/main/resources/pre/application.yml index f945f8c0..4c2e5f66 100644 --- a/hai-bweb/src/main/resources/pre/application.yml +++ b/hai-bweb/src/main/resources/pre/application.yml @@ -9,7 +9,7 @@ debug: false #datasource数据源设置 spring: datasource: - url: jdbc:mysql://122.9.135.148:3306/hsg?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false + url: jdbc:mysql://139.159.177.244:3306/hsg_pre?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false username: root password: HF123456. type: com.alibaba.druid.pool.DruidDataSource diff --git a/hai-cweb/src/main/resources/pre/application.yml b/hai-cweb/src/main/resources/pre/application.yml index da2d8a16..1012ea5c 100644 --- a/hai-cweb/src/main/resources/pre/application.yml +++ b/hai-cweb/src/main/resources/pre/application.yml @@ -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_pre?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false username: root password: HF123456. type: com.alibaba.druid.pool.DruidDataSource diff --git a/hai-service/src/main/java/com/hai/model/TyOrderModel.java b/hai-service/src/main/java/com/hai/model/TyOrderModel.java index 565ec9e6..1d40025d 100644 --- a/hai-service/src/main/java/com/hai/model/TyOrderModel.java +++ b/hai-service/src/main/java/com/hai/model/TyOrderModel.java @@ -10,6 +10,7 @@ public class TyOrderModel { private String gasOrderNo; private String payType; private BigDecimal totalPrice; + private BigDecimal oilLiters; private BigDecimal deductionPrice; private BigDecimal payRealPrice; private String goodsName; @@ -24,6 +25,14 @@ public class TyOrderModel { private String agentName; private String salesmanName; + public BigDecimal getOilLiters() { + return oilLiters; + } + + public void setOilLiters(BigDecimal oilLiters) { + this.oilLiters = oilLiters; + } + public String getMemPhone() { return memPhone; } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOilCardRecordServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOilCardRecordServiceImpl.java index 9833422a..5c0d2a3c 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOilCardRecordServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOilCardRecordServiceImpl.java @@ -27,12 +27,16 @@ public class HighOilCardRecordServiceImpl implements HighOilCardRecordService { @Override public void insertRecord(HighOilCardRecord oilCardRecord) { + oilCardRecord.setOpUserId(0L); + oilCardRecord.setOpUserName("无"); + UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); if (userInfoModel != null) { oilCardRecord.setOpUserId(userInfoModel.getSecUser().getId()); oilCardRecord.setOpUserName(userInfoModel.getSecUser().getUserName()); - } else { - HighUserModel userModel = userCenter.getSessionModel(HighUserModel.class); + } + HighUserModel userModel = userCenter.getSessionModel(HighUserModel.class); + if (userModel == null) { oilCardRecord.setOpUserId(userModel.getHighUser().getId()); oilCardRecord.setOpUserName(userModel.getHighUser().getName()); }