diff --git a/hai-bweb/src/main/java/com/BWebApplication.java b/hai-bweb/src/main/java/com/BWebApplication.java index 80d35618..a7ce2bc7 100644 --- a/hai-bweb/src/main/java/com/BWebApplication.java +++ b/hai-bweb/src/main/java/com/BWebApplication.java @@ -1,5 +1,7 @@ package com; +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; @@ -11,11 +13,12 @@ import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.transaction.annotation.EnableTransactionManagement; @SpringBootApplication -// @ComponentScan +//@ComponentScan @EnableTransactionManagement @EnableScheduling +@EnableMethodCache(basePackages = "com.hai") +@EnableCreateCacheAnnotation @ServletComponentScan -@EnableAspectJAutoProxy(proxyTargetClass = true) @MapperScan("com.hai.dao") public class BWebApplication { diff --git a/hai-bweb/src/main/resources/dev/application.yml b/hai-bweb/src/main/resources/dev/application.yml index 59fb1869..89cd1959 100644 --- a/hai-bweb/src/main/resources/dev/application.yml +++ b/hai-bweb/src/main/resources/dev/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_order?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false username: root password: HF123456. type: com.alibaba.druid.pool.DruidDataSource @@ -63,6 +63,34 @@ mybatis: type-aliases-package: org.springboot.sample.entity +rocketmq: + name-server: 139.159.177.244:9876 + producer: + #必须指定group + group: default-group + +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 diff --git a/hai-order/src/main/java/com/web/controller/OrderBWebController.java b/hai-order/src/main/java/com/web/controller/OrderBWebController.java index f04a891c..c290a9ed 100644 --- a/hai-order/src/main/java/com/web/controller/OrderBWebController.java +++ b/hai-order/src/main/java/com/web/controller/OrderBWebController.java @@ -1,18 +1,26 @@ package com.web.controller; +import com.alibaba.excel.EasyExcel; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.security.UserCenter; +import com.hai.common.utils.ExcelUtils; import com.hai.common.utils.ResponseMsgUtil; +import com.hai.entity.HighGasOrder; import com.hai.enum_type.UserObjectTypeEnum; +import com.hai.enum_type.UserRoleTypeEnum; +import com.hai.model.HighOrderPreModel; import com.hai.model.ResponseData; import com.hai.model.UserInfoModel; +import com.hai.order.model.ExportGasOrderModel; import com.hai.order.service.OrderService; import com.hai.order.service.OrderServiceExt; +import com.hai.order.type.OrderOilStatus; import com.hai.service.HighGasOrderService; +import com.web.config.SysConst; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -24,8 +32,9 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; -import java.util.HashMap; -import java.util.Map; +import java.io.File; +import java.math.BigDecimal; +import java.util.*; /** * @className: OrderExtController @@ -93,19 +102,23 @@ public class OrderBWebController { } } - @RequestMapping(value="/getGasOrderList",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询油站订单列表") public ResponseData getGasOrderList(@RequestParam(name = "companyId", required = false) Long companyId, @RequestParam(name = "merId", required = false) Long merId, @RequestParam(name = "storeId", required = false) Long storeId, + @RequestParam(name = "storeName", required = false) String storeName, @RequestParam(name = "orderNo", required = false) String orderNo, @RequestParam(name = "childOrderNo", required = false) String childOrderNo, + @RequestParam(name = "memPhone", required = false) String memPhone, @RequestParam(name = "gasOilType", required = false) Integer gasOilType, - @RequestParam(name = "gasOilNo", required = false) String gasOilNo, @RequestParam(name = "status", required = false) Integer status, + @RequestParam(name = "gasOrgId", required = false) Long gasOrgId, + @RequestParam(name = "gasAgentId", required = false) Long gasAgentId, @RequestParam(name = "gasSalesmanId", required = false) Long gasSalesmanId, + @RequestParam(name = "gasStaffName", required = false) String gasStaffName, + @RequestParam(name = "gasOilNo", required = false) String gasOilNo, @RequestParam(name = "createTimeS", required = false) Long createTimeS, @RequestParam(name = "createTimeE", required = false) Long createTimeE, @RequestParam(name = "payTimeS", required = false) Long payTimeS, @@ -126,33 +139,56 @@ public class OrderBWebController { param.put("companyId", companyId); param.put("merId", merId); param.put("storeId", storeId); + param.put("storeName", storeName); + param.put("gasOrgId", gasOrgId); + param.put("gasAgentId", gasAgentId); + param.put("gasStaffName", gasStaffName); } else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type1.getType())) { param.put("companyId", userInfoModel.getBsCompany().getId()); param.put("merId", merId); param.put("storeId", storeId); + param.put("storeName", storeName); + param.put("gasStaffName", gasStaffName); } else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type2.getType())) { param.put("merId", userInfoModel.getMerchant().getId()); param.put("storeId", storeId); + param.put("storeName", storeName); + param.put("gasStaffName", gasStaffName); } else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type3.getType())) { param.put("storeId", userInfoModel.getMerchantStore().getId()); + param.put("gasStaffName", gasStaffName); } else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type6.getType())) { - param.put("gasAgentId", userInfoModel.getMerchantStore().getId()); + param.put("gasAgentId", userInfoModel.getHighTyAgent().getId()); param.put("gasSalesmanId", gasSalesmanId); + param.put("storeId", storeId); + param.put("storeName", storeName); + param.put("gasStaffName", gasStaffName); } else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type7.getType())) { - param.put("gasSalesmanId", userInfoModel.getMerchantStore().getId()); + param.put("gasSalesmanId", userInfoModel.getHighTySalesman().getId()); + param.put("storeId", storeId); + param.put("storeName", storeName); + param.put("gasStaffName", gasStaffName); } else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type8.getType())) { param.put("gasStaffId", userInfoModel.getGasStaff().getId()); + param.put("storeId", storeId); + param.put("storeName", storeName); } else { log.error("OrderBWebController -> getGasOrderList() error!", "未知用户身份"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知用户身份"); } + + param.put("gasOrgId", gasOrgId); + param.put("gasAgentId", gasAgentId); + param.put("gasSalesmanId", gasAgentId); + param.put("memPhone", memPhone); + param.put("gasOilNo", gasOilNo); param.put("orderNo", orderNo); param.put("childOrderNo", childOrderNo); param.put("status", status); @@ -172,4 +208,225 @@ public class OrderBWebController { } } + + @RequestMapping(value="/getGasOrderDetail",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询油站详情") + public ResponseData getGasOrderDetail(@RequestParam(name = "orderNo", required = true) String orderNo) { + try { + Map map = new HashMap<>(); + map.put("tradeOrder", orderService.getOrderDetailByNo(orderNo)); + map.put("gasOrder", gasOrderService.getDetailByOrderNo(orderNo)); + + return ResponseMsgUtil.success(map); + + } catch (Exception e) { + log.error("OrderExtController -> getGasOrderDetail() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/exportGasOrder",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询油站订单列表") + public ResponseData exportGasOrder(@RequestParam(name = "companyId", required = false) Long companyId, + @RequestParam(name = "merId", required = false) Long merId, + @RequestParam(name = "storeId", required = false) Long storeId, + @RequestParam(name = "storeName", required = false) String storeName, + @RequestParam(name = "orderNo", required = false) String orderNo, + @RequestParam(name = "childOrderNo", required = false) String childOrderNo, + @RequestParam(name = "memPhone", required = false) String memPhone, + @RequestParam(name = "gasOilType", required = false) Integer gasOilType, + @RequestParam(name = "status", required = false) Integer status, + @RequestParam(name = "gasOrgId", required = false) Long gasOrgId, + @RequestParam(name = "gasAgentId", required = false) Long gasAgentId, + @RequestParam(name = "gasSalesmanId", required = false) Long gasSalesmanId, + @RequestParam(name = "gasStaffName", required = false) String gasStaffName, + @RequestParam(name = "gasOilNo", required = false) String gasOilNo, + @RequestParam(name = "createTimeS", required = false) Long createTimeS, + @RequestParam(name = "createTimeE", required = false) Long createTimeE, + @RequestParam(name = "payTimeS", required = false) Long payTimeS, + @RequestParam(name = "payTimeE", required = false) Long payTimeE, + @RequestParam(name = "refundTimeS", required = false) Long refundTimeS, + @RequestParam(name = "refundTimeE", required = false) Long refundTimeE + ) { + try { + UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); + if (userInfoModel == null) { + log.error("OrderBWebController -> exportGasOrderList() error!", "用户身份错误或已过期"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, ""); + } + Map param = new HashMap<>(); + if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type0.getType())) { + param.put("companyId", companyId); + param.put("merId", merId); + param.put("storeId", storeId); + param.put("storeName", storeName); + param.put("gasOrgId", gasOrgId); + param.put("gasAgentId", gasAgentId); + param.put("gasStaffName", gasStaffName); + + } else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type1.getType())) { + param.put("companyId", userInfoModel.getBsCompany().getId()); + param.put("merId", merId); + param.put("storeId", storeId); + param.put("storeName", storeName); + param.put("gasStaffName", gasStaffName); + + } else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type2.getType())) { + param.put("merId", userInfoModel.getMerchant().getId()); + param.put("storeId", storeId); + param.put("storeName", storeName); + param.put("gasStaffName", gasStaffName); + + } else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type3.getType())) { + param.put("storeId", userInfoModel.getMerchantStore().getId()); + param.put("gasStaffName", gasStaffName); + + } else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type6.getType())) { + param.put("gasAgentId", userInfoModel.getHighTyAgent().getId()); + param.put("gasSalesmanId", gasSalesmanId); + param.put("storeId", storeId); + param.put("storeName", storeName); + param.put("gasStaffName", gasStaffName); + + } else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type7.getType())) { + param.put("gasSalesmanId", userInfoModel.getHighTySalesman().getId()); + param.put("storeId", storeId); + param.put("storeName", storeName); + param.put("gasStaffName", gasStaffName); + + } else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type8.getType())) { + param.put("gasStaffId", userInfoModel.getGasStaff().getId()); + param.put("storeId", storeId); + param.put("storeName", storeName); + + } else { + log.error("OrderBWebController -> getGasOrderList() error!", "未知用户身份"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知用户身份"); + } + + param.put("gasOrgId", gasOrgId); + param.put("gasAgentId", gasAgentId); + param.put("gasSalesmanId", gasAgentId); + param.put("memPhone", memPhone); + param.put("gasOilNo", gasOilNo); + param.put("orderNo", orderNo); + param.put("childOrderNo", childOrderNo); + param.put("status", status); + param.put("createTimeS", createTimeS); + param.put("createTimeE", createTimeE); + param.put("payTimeS", payTimeS); + param.put("payTimeE", payTimeE); + param.put("refundTimeS", refundTimeS); + param.put("refundTimeE", refundTimeE); + + // 查询数据 + List orderList = gasOrderService.getGasOrderList(param); + + List dataList = new ArrayList<>(); + ExportGasOrderModel model; + + for (HighGasOrder gasOrder : orderList) { + model = new ExportGasOrderModel(); + model.setOrderNo(gasOrder.getOrderNo()); + model.setStoreName(gasOrder.getStoreName()); + model.setGasStaffName(gasOrder.getGasStaffName()); + model.setMemPhone(gasOrder.getMemPhone()); + model.setGasRefuelPrice(gasOrder.getGasRefuelPrice()); + model.setGasOilLiters(gasOrder.getGasOilLiters()); + model.setGasDiscount(gasOrder.getGasDiscount().compareTo(new BigDecimal("1")) != 0?gasOrder.getGasDiscount().multiply(new BigDecimal("100")).setScale(2).toString():"无"); + model.setGasOilSubsidy(gasOrder.getGasOilSubsidy()); + model.setGasOilNo(gasOrder.getGasOilNo() + "#"); + model.setGasGunNo(gasOrder.getGasGunNo() + "号枪"); + model.setGasPricePlatform(gasOrder.getGasPricePlatform()); + model.setGasPriceGun(gasOrder.getGasPriceGun()); + model.setGasPriceOfficial(gasOrder.getGasPriceOfficial()); + model.setDeductionPrice(gasOrder.getDeductionPrice()); + model.setPayablePrice(gasOrder.getPayablePrice()); + model.setPayGold(gasOrder.getPayGold()); + model.setPayPrice(gasOrder.getPayPrice()!=null?gasOrder.getPayPrice().toString():"未支付"); + model.setStatus(OrderOilStatus.getNameByType(gasOrder.getStatus())); + model.setCreateTime(gasOrder.getCreateTime()); + model.setPayTime(gasOrder.getPayTime()); + model.setRefundTime(gasOrder.getRefundTime()); + model.setCancelTime(gasOrder.getCancelTime()); + model.setCompanyName(gasOrder.getMerName()); + model.setMerName(gasOrder.getMerName()); + model.setGasSalesmanName(gasOrder.getGasSalesmanName()); + model.setGasAgentName(gasOrder.getGasAgentName()); + model.setGasOrgName(gasOrder.getGasOrgName()); + dataList.add(model); + } + + String fileUrl = SysConst.getSysConfig().getFileUrl() + "/temporary/"; + String pathName = System.currentTimeMillis()+".xlsx"; + File file = new File(fileUrl); + if (!file.exists()) { + file.mkdirs(); + } + + Set includeColumnFiledNames = new HashSet(); + includeColumnFiledNames.add("orderNo"); + includeColumnFiledNames.add("memPhone"); + includeColumnFiledNames.add("gasRefuelPrice"); + includeColumnFiledNames.add("gasOilLiters"); + includeColumnFiledNames.add("gasDiscount"); + includeColumnFiledNames.add("gasOilSubsidy"); + includeColumnFiledNames.add("gasOilNo"); + includeColumnFiledNames.add("gasGunNo"); + includeColumnFiledNames.add("gasPricePlatform"); + includeColumnFiledNames.add("gasPriceGun"); + includeColumnFiledNames.add("gasPriceOfficial"); + includeColumnFiledNames.add("deductionPrice"); + includeColumnFiledNames.add("payablePrice"); + includeColumnFiledNames.add("payGold"); + includeColumnFiledNames.add("payPrice"); + includeColumnFiledNames.add("status"); + includeColumnFiledNames.add("createTime"); + includeColumnFiledNames.add("payTime"); + includeColumnFiledNames.add("refundTime"); + includeColumnFiledNames.add("cancelTime"); + + if (!userInfoModel.getSecRole().getRoleType().equals(UserRoleTypeEnum.type3.getType()) + && !userInfoModel.getSecRole().getRoleType().equals(UserRoleTypeEnum.type10.getType())) { + includeColumnFiledNames.add("storeName"); + } + if (!userInfoModel.getSecRole().getRoleType().equals(UserRoleTypeEnum.type10.getType())) { + includeColumnFiledNames.add("gasStaffName"); + } + + if (userInfoModel.getSecRole().getRoleType().equals(UserRoleTypeEnum.type0.getType()) + || userInfoModel.getSecRole().getRoleType().equals(UserRoleTypeEnum.type1.getType())) { + includeColumnFiledNames.add("companyName"); + } + + if (userInfoModel.getSecRole().getRoleType().equals(UserRoleTypeEnum.type0.getType()) + || userInfoModel.getSecRole().getRoleType().equals(UserRoleTypeEnum.type1.getType()) + || userInfoModel.getSecRole().getRoleType().equals(UserRoleTypeEnum.type5.getType())) { + includeColumnFiledNames.add("merName"); + includeColumnFiledNames.add("gasOrgName"); + includeColumnFiledNames.add("gasAgentName"); + } + + if (userInfoModel.getSecRole().getRoleType().equals(UserRoleTypeEnum.type0.getType()) + || userInfoModel.getSecRole().getRoleType().equals(UserRoleTypeEnum.type1.getType()) + || userInfoModel.getSecRole().getRoleType().equals(UserRoleTypeEnum.type5.getType()) + || userInfoModel.getSecRole().getRoleType().equals(UserRoleTypeEnum.type8.getType())) { + includeColumnFiledNames.add("gasSalesmanName"); + } + + EasyExcel.write(fileUrl+pathName) + .head(ExportGasOrderModel.class) + .includeColumnFiledNames(includeColumnFiledNames) + .sheet("交易订单") + .doWrite(dataList); + return ResponseMsgUtil.success(pathName); + + } catch (Exception e) { + log.error("OrderExtController -> exportGasOrderList() error!",e); + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/hai-service/src/main/java/com/hai/common/utils/ExcelUtils.java b/hai-service/src/main/java/com/hai/common/utils/ExcelUtils.java new file mode 100644 index 00000000..63311c7d --- /dev/null +++ b/hai-service/src/main/java/com/hai/common/utils/ExcelUtils.java @@ -0,0 +1,29 @@ +package com.hai.common.utils; + +import java.util.ArrayList; +import java.util.List; + +/** + * excel工具类 + * @className: ExcelUtils + * @author: HuRui + * @date: 2022/9/20 + **/ +public class ExcelUtils { + + /** + * 生成头部 + * @param headList + * @return + */ + public static List> generationHead(List headList) { + List> list = new ArrayList<>(); + List head; + for (String headStr : headList) { + head = new ArrayList<>(); + head.add(headStr); + list.add(head); + } + return list; + } +} diff --git a/hai-service/src/main/java/com/hai/dao/HighGasOrderMapper.java b/hai-service/src/main/java/com/hai/dao/HighGasOrderMapper.java index a7c4d974..c56ce369 100644 --- a/hai-service/src/main/java/com/hai/dao/HighGasOrderMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighGasOrderMapper.java @@ -42,8 +42,11 @@ public interface HighGasOrderMapper extends HighGasOrderMapperExt { "insert into high_gas_order (order_no, child_order_no, ", "channel_type, channel_order_no, ", "mem_id, mem_phone, ", + "company_id, company_name, ", "mer_id, mer_name, store_id, ", - "store_name, gas_refuel_price, ", + "store_name, deduction_price, ", + "payable_price, pay_gold, ", + "pay_price, gas_refuel_price, ", "gas_oil_no, gas_gun_no, ", "gas_oil_type, gas_price_platform, ", "gas_price_gun, gas_price_vip, ", @@ -59,15 +62,17 @@ public interface HighGasOrderMapper extends HighGasOrderMapperExt { "gas_org_id, gas_org_name, ", "`status`, create_time, ", "cancel_time, pay_time, ", - "finish_time, refund_time, ", - "refund_remarks, ext_1, ", - "ext_2, ext_3, ext_4, ", - "ext_5, ext_6)", + "refund_time, refund_remarks, ", + "ext_1, ext_2, ext_3, ", + "ext_4, ext_5, ext_6)", "values (#{orderNo,jdbcType=VARCHAR}, #{childOrderNo,jdbcType=VARCHAR}, ", "#{channelType,jdbcType=INTEGER}, #{channelOrderNo,jdbcType=VARCHAR}, ", "#{memId,jdbcType=BIGINT}, #{memPhone,jdbcType=VARCHAR}, ", + "#{companyId,jdbcType=BIGINT}, #{companyName,jdbcType=VARCHAR}, ", "#{merId,jdbcType=BIGINT}, #{merName,jdbcType=VARCHAR}, #{storeId,jdbcType=BIGINT}, ", - "#{storeName,jdbcType=VARCHAR}, #{gasRefuelPrice,jdbcType=DECIMAL}, ", + "#{storeName,jdbcType=VARCHAR}, #{deductionPrice,jdbcType=DECIMAL}, ", + "#{payablePrice,jdbcType=DECIMAL}, #{payGold,jdbcType=INTEGER}, ", + "#{payPrice,jdbcType=DECIMAL}, #{gasRefuelPrice,jdbcType=DECIMAL}, ", "#{gasOilNo,jdbcType=VARCHAR}, #{gasGunNo,jdbcType=VARCHAR}, ", "#{gasOilType,jdbcType=INTEGER}, #{gasPricePlatform,jdbcType=DECIMAL}, ", "#{gasPriceGun,jdbcType=DECIMAL}, #{gasPriceVip,jdbcType=DECIMAL}, ", @@ -83,10 +88,9 @@ public interface HighGasOrderMapper extends HighGasOrderMapperExt { "#{gasOrgId,jdbcType=BIGINT}, #{gasOrgName,jdbcType=VARCHAR}, ", "#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", "#{cancelTime,jdbcType=TIMESTAMP}, #{payTime,jdbcType=TIMESTAMP}, ", - "#{finishTime,jdbcType=TIMESTAMP}, #{refundTime,jdbcType=TIMESTAMP}, ", - "#{refundRemarks,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ", - "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, #{ext4,jdbcType=VARCHAR}, ", - "#{ext5,jdbcType=VARCHAR}, #{ext6,jdbcType=VARCHAR})" + "#{refundTime,jdbcType=TIMESTAMP}, #{refundRemarks,jdbcType=VARCHAR}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, ", + "#{ext4,jdbcType=VARCHAR}, #{ext5,jdbcType=VARCHAR}, #{ext6,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(HighGasOrder record); @@ -104,10 +108,16 @@ public interface HighGasOrderMapper extends HighGasOrderMapperExt { @Result(column="channel_order_no", property="channelOrderNo", jdbcType=JdbcType.VARCHAR), @Result(column="mem_id", property="memId", jdbcType=JdbcType.BIGINT), @Result(column="mem_phone", property="memPhone", jdbcType=JdbcType.VARCHAR), + @Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT), + @Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR), @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), @Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT), @Result(column="store_name", property="storeName", jdbcType=JdbcType.VARCHAR), + @Result(column="deduction_price", property="deductionPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="payable_price", property="payablePrice", jdbcType=JdbcType.DECIMAL), + @Result(column="pay_gold", property="payGold", jdbcType=JdbcType.INTEGER), + @Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL), @Result(column="gas_refuel_price", property="gasRefuelPrice", jdbcType=JdbcType.DECIMAL), @Result(column="gas_oil_no", property="gasOilNo", jdbcType=JdbcType.VARCHAR), @Result(column="gas_gun_no", property="gasGunNo", jdbcType=JdbcType.VARCHAR), @@ -139,7 +149,6 @@ public interface HighGasOrderMapper extends HighGasOrderMapperExt { @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="cancel_time", property="cancelTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP), - @Result(column="finish_time", property="finishTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="refund_remarks", property="refundRemarks", jdbcType=JdbcType.VARCHAR), @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), @@ -154,14 +163,15 @@ public interface HighGasOrderMapper extends HighGasOrderMapperExt { @Select({ "select", "id, order_no, child_order_no, channel_type, channel_order_no, mem_id, mem_phone, ", - "mer_id, mer_name, store_id, store_name, gas_refuel_price, gas_oil_no, gas_gun_no, ", + "company_id, company_name, mer_id, mer_name, store_id, store_name, deduction_price, ", + "payable_price, pay_gold, pay_price, gas_refuel_price, gas_oil_no, gas_gun_no, ", "gas_oil_type, gas_price_platform, gas_price_gun, gas_price_vip, gas_price_official, ", "gas_price_cost, gas_price_cost_total, gas_price_channel_pay, gas_oil_liters, ", "gas_discount, gas_oil_subsidy, gas_liters_preferences, gas_price_preferences, ", "gas_class_group_id, gas_class_group_name, gas_class_group_task_id, gas_staff_id, ", "gas_staff_name, gas_salesman_id, gas_salesman_name, gas_agent_id, gas_agent_name, ", - "gas_org_id, gas_org_name, `status`, create_time, cancel_time, pay_time, finish_time, ", - "refund_time, refund_remarks, ext_1, ext_2, ext_3, ext_4, ext_5, ext_6", + "gas_org_id, gas_org_name, `status`, create_time, cancel_time, pay_time, refund_time, ", + "refund_remarks, ext_1, ext_2, ext_3, ext_4, ext_5, ext_6", "from high_gas_order", "where id = #{id,jdbcType=BIGINT}" }) @@ -173,10 +183,16 @@ public interface HighGasOrderMapper extends HighGasOrderMapperExt { @Result(column="channel_order_no", property="channelOrderNo", jdbcType=JdbcType.VARCHAR), @Result(column="mem_id", property="memId", jdbcType=JdbcType.BIGINT), @Result(column="mem_phone", property="memPhone", jdbcType=JdbcType.VARCHAR), + @Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT), + @Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR), @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), @Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT), @Result(column="store_name", property="storeName", jdbcType=JdbcType.VARCHAR), + @Result(column="deduction_price", property="deductionPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="payable_price", property="payablePrice", jdbcType=JdbcType.DECIMAL), + @Result(column="pay_gold", property="payGold", jdbcType=JdbcType.INTEGER), + @Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL), @Result(column="gas_refuel_price", property="gasRefuelPrice", jdbcType=JdbcType.DECIMAL), @Result(column="gas_oil_no", property="gasOilNo", jdbcType=JdbcType.VARCHAR), @Result(column="gas_gun_no", property="gasGunNo", jdbcType=JdbcType.VARCHAR), @@ -208,7 +224,6 @@ public interface HighGasOrderMapper extends HighGasOrderMapperExt { @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="cancel_time", property="cancelTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP), - @Result(column="finish_time", property="finishTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="refund_remarks", property="refundRemarks", jdbcType=JdbcType.VARCHAR), @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), @@ -237,10 +252,16 @@ public interface HighGasOrderMapper extends HighGasOrderMapperExt { "channel_order_no = #{channelOrderNo,jdbcType=VARCHAR},", "mem_id = #{memId,jdbcType=BIGINT},", "mem_phone = #{memPhone,jdbcType=VARCHAR},", + "company_id = #{companyId,jdbcType=BIGINT},", + "company_name = #{companyName,jdbcType=VARCHAR},", "mer_id = #{merId,jdbcType=BIGINT},", "mer_name = #{merName,jdbcType=VARCHAR},", "store_id = #{storeId,jdbcType=BIGINT},", "store_name = #{storeName,jdbcType=VARCHAR},", + "deduction_price = #{deductionPrice,jdbcType=DECIMAL},", + "payable_price = #{payablePrice,jdbcType=DECIMAL},", + "pay_gold = #{payGold,jdbcType=INTEGER},", + "pay_price = #{payPrice,jdbcType=DECIMAL},", "gas_refuel_price = #{gasRefuelPrice,jdbcType=DECIMAL},", "gas_oil_no = #{gasOilNo,jdbcType=VARCHAR},", "gas_gun_no = #{gasGunNo,jdbcType=VARCHAR},", @@ -272,7 +293,6 @@ public interface HighGasOrderMapper extends HighGasOrderMapperExt { "create_time = #{createTime,jdbcType=TIMESTAMP},", "cancel_time = #{cancelTime,jdbcType=TIMESTAMP},", "pay_time = #{payTime,jdbcType=TIMESTAMP},", - "finish_time = #{finishTime,jdbcType=TIMESTAMP},", "refund_time = #{refundTime,jdbcType=TIMESTAMP},", "refund_remarks = #{refundRemarks,jdbcType=VARCHAR},", "ext_1 = #{ext1,jdbcType=VARCHAR},", diff --git a/hai-service/src/main/java/com/hai/dao/HighGasOrderSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighGasOrderSqlProvider.java index d70a6784..bc2068f0 100644 --- a/hai-service/src/main/java/com/hai/dao/HighGasOrderSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighGasOrderSqlProvider.java @@ -52,6 +52,14 @@ public class HighGasOrderSqlProvider { sql.VALUES("mem_phone", "#{memPhone,jdbcType=VARCHAR}"); } + if (record.getCompanyId() != null) { + sql.VALUES("company_id", "#{companyId,jdbcType=BIGINT}"); + } + + if (record.getCompanyName() != null) { + sql.VALUES("company_name", "#{companyName,jdbcType=VARCHAR}"); + } + if (record.getMerId() != null) { sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}"); } @@ -68,6 +76,22 @@ public class HighGasOrderSqlProvider { sql.VALUES("store_name", "#{storeName,jdbcType=VARCHAR}"); } + if (record.getDeductionPrice() != null) { + sql.VALUES("deduction_price", "#{deductionPrice,jdbcType=DECIMAL}"); + } + + if (record.getPayablePrice() != null) { + sql.VALUES("payable_price", "#{payablePrice,jdbcType=DECIMAL}"); + } + + if (record.getPayGold() != null) { + sql.VALUES("pay_gold", "#{payGold,jdbcType=INTEGER}"); + } + + if (record.getPayPrice() != null) { + sql.VALUES("pay_price", "#{payPrice,jdbcType=DECIMAL}"); + } + if (record.getGasRefuelPrice() != null) { sql.VALUES("gas_refuel_price", "#{gasRefuelPrice,jdbcType=DECIMAL}"); } @@ -192,10 +216,6 @@ public class HighGasOrderSqlProvider { sql.VALUES("pay_time", "#{payTime,jdbcType=TIMESTAMP}"); } - if (record.getFinishTime() != null) { - sql.VALUES("finish_time", "#{finishTime,jdbcType=TIMESTAMP}"); - } - if (record.getRefundTime() != null) { sql.VALUES("refund_time", "#{refundTime,jdbcType=TIMESTAMP}"); } @@ -244,10 +264,16 @@ public class HighGasOrderSqlProvider { sql.SELECT("channel_order_no"); sql.SELECT("mem_id"); sql.SELECT("mem_phone"); + sql.SELECT("company_id"); + sql.SELECT("company_name"); sql.SELECT("mer_id"); sql.SELECT("mer_name"); sql.SELECT("store_id"); sql.SELECT("store_name"); + sql.SELECT("deduction_price"); + sql.SELECT("payable_price"); + sql.SELECT("pay_gold"); + sql.SELECT("pay_price"); sql.SELECT("gas_refuel_price"); sql.SELECT("gas_oil_no"); sql.SELECT("gas_gun_no"); @@ -279,7 +305,6 @@ public class HighGasOrderSqlProvider { sql.SELECT("create_time"); sql.SELECT("cancel_time"); sql.SELECT("pay_time"); - sql.SELECT("finish_time"); sql.SELECT("refund_time"); sql.SELECT("refund_remarks"); sql.SELECT("ext_1"); @@ -333,6 +358,14 @@ public class HighGasOrderSqlProvider { sql.SET("mem_phone = #{record.memPhone,jdbcType=VARCHAR}"); } + if (record.getCompanyId() != null) { + sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}"); + } + + if (record.getCompanyName() != null) { + sql.SET("company_name = #{record.companyName,jdbcType=VARCHAR}"); + } + if (record.getMerId() != null) { sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); } @@ -349,6 +382,22 @@ public class HighGasOrderSqlProvider { sql.SET("store_name = #{record.storeName,jdbcType=VARCHAR}"); } + if (record.getDeductionPrice() != null) { + sql.SET("deduction_price = #{record.deductionPrice,jdbcType=DECIMAL}"); + } + + if (record.getPayablePrice() != null) { + sql.SET("payable_price = #{record.payablePrice,jdbcType=DECIMAL}"); + } + + if (record.getPayGold() != null) { + sql.SET("pay_gold = #{record.payGold,jdbcType=INTEGER}"); + } + + if (record.getPayPrice() != null) { + sql.SET("pay_price = #{record.payPrice,jdbcType=DECIMAL}"); + } + if (record.getGasRefuelPrice() != null) { sql.SET("gas_refuel_price = #{record.gasRefuelPrice,jdbcType=DECIMAL}"); } @@ -473,10 +522,6 @@ public class HighGasOrderSqlProvider { sql.SET("pay_time = #{record.payTime,jdbcType=TIMESTAMP}"); } - if (record.getFinishTime() != null) { - sql.SET("finish_time = #{record.finishTime,jdbcType=TIMESTAMP}"); - } - if (record.getRefundTime() != null) { sql.SET("refund_time = #{record.refundTime,jdbcType=TIMESTAMP}"); } @@ -524,10 +569,16 @@ public class HighGasOrderSqlProvider { sql.SET("channel_order_no = #{record.channelOrderNo,jdbcType=VARCHAR}"); sql.SET("mem_id = #{record.memId,jdbcType=BIGINT}"); sql.SET("mem_phone = #{record.memPhone,jdbcType=VARCHAR}"); + sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}"); + sql.SET("company_name = #{record.companyName,jdbcType=VARCHAR}"); sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); sql.SET("store_id = #{record.storeId,jdbcType=BIGINT}"); sql.SET("store_name = #{record.storeName,jdbcType=VARCHAR}"); + sql.SET("deduction_price = #{record.deductionPrice,jdbcType=DECIMAL}"); + sql.SET("payable_price = #{record.payablePrice,jdbcType=DECIMAL}"); + sql.SET("pay_gold = #{record.payGold,jdbcType=INTEGER}"); + sql.SET("pay_price = #{record.payPrice,jdbcType=DECIMAL}"); sql.SET("gas_refuel_price = #{record.gasRefuelPrice,jdbcType=DECIMAL}"); sql.SET("gas_oil_no = #{record.gasOilNo,jdbcType=VARCHAR}"); sql.SET("gas_gun_no = #{record.gasGunNo,jdbcType=VARCHAR}"); @@ -559,7 +610,6 @@ public class HighGasOrderSqlProvider { sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); sql.SET("cancel_time = #{record.cancelTime,jdbcType=TIMESTAMP}"); sql.SET("pay_time = #{record.payTime,jdbcType=TIMESTAMP}"); - sql.SET("finish_time = #{record.finishTime,jdbcType=TIMESTAMP}"); sql.SET("refund_time = #{record.refundTime,jdbcType=TIMESTAMP}"); sql.SET("refund_remarks = #{record.refundRemarks,jdbcType=VARCHAR}"); sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); @@ -602,6 +652,14 @@ public class HighGasOrderSqlProvider { sql.SET("mem_phone = #{memPhone,jdbcType=VARCHAR}"); } + if (record.getCompanyId() != null) { + sql.SET("company_id = #{companyId,jdbcType=BIGINT}"); + } + + if (record.getCompanyName() != null) { + sql.SET("company_name = #{companyName,jdbcType=VARCHAR}"); + } + if (record.getMerId() != null) { sql.SET("mer_id = #{merId,jdbcType=BIGINT}"); } @@ -618,6 +676,22 @@ public class HighGasOrderSqlProvider { sql.SET("store_name = #{storeName,jdbcType=VARCHAR}"); } + if (record.getDeductionPrice() != null) { + sql.SET("deduction_price = #{deductionPrice,jdbcType=DECIMAL}"); + } + + if (record.getPayablePrice() != null) { + sql.SET("payable_price = #{payablePrice,jdbcType=DECIMAL}"); + } + + if (record.getPayGold() != null) { + sql.SET("pay_gold = #{payGold,jdbcType=INTEGER}"); + } + + if (record.getPayPrice() != null) { + sql.SET("pay_price = #{payPrice,jdbcType=DECIMAL}"); + } + if (record.getGasRefuelPrice() != null) { sql.SET("gas_refuel_price = #{gasRefuelPrice,jdbcType=DECIMAL}"); } @@ -742,10 +816,6 @@ public class HighGasOrderSqlProvider { sql.SET("pay_time = #{payTime,jdbcType=TIMESTAMP}"); } - if (record.getFinishTime() != null) { - sql.SET("finish_time = #{finishTime,jdbcType=TIMESTAMP}"); - } - if (record.getRefundTime() != null) { sql.SET("refund_time = #{refundTime,jdbcType=TIMESTAMP}"); } diff --git a/hai-service/src/main/java/com/hai/entity/HighGasOrder.java b/hai-service/src/main/java/com/hai/entity/HighGasOrder.java index 4bec4e73..89c02664 100644 --- a/hai-service/src/main/java/com/hai/entity/HighGasOrder.java +++ b/hai-service/src/main/java/com/hai/entity/HighGasOrder.java @@ -49,6 +49,16 @@ public class HighGasOrder implements Serializable { */ private String memPhone; + /** + * 公司id + */ + private Long companyId; + + /** + * 公司名称 + */ + private String companyName; + /** * 商户id */ @@ -69,6 +79,26 @@ public class HighGasOrder implements Serializable { */ private String storeName; + /** + * 优惠金额 + */ + private BigDecimal deductionPrice; + + /** + * 应付金额 + */ + private BigDecimal payablePrice; + + /** + * 积分抵扣 + */ + private Integer payGold; + + /** + * 支付金额 + */ + private BigDecimal payPrice; + /** * 【加油站】加油金额 */ @@ -230,11 +260,6 @@ public class HighGasOrder implements Serializable { */ private Date payTime; - /** - * 完成时间 - */ - private Date finishTime; - /** * 退款时间 */ @@ -315,6 +340,22 @@ public class HighGasOrder implements Serializable { this.memPhone = memPhone; } + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + public String getCompanyName() { + return companyName; + } + + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + public Long getMerId() { return merId; } @@ -347,6 +388,38 @@ public class HighGasOrder implements Serializable { this.storeName = storeName; } + public BigDecimal getDeductionPrice() { + return deductionPrice; + } + + public void setDeductionPrice(BigDecimal deductionPrice) { + this.deductionPrice = deductionPrice; + } + + public BigDecimal getPayablePrice() { + return payablePrice; + } + + public void setPayablePrice(BigDecimal payablePrice) { + this.payablePrice = payablePrice; + } + + public Integer getPayGold() { + return payGold; + } + + public void setPayGold(Integer payGold) { + this.payGold = payGold; + } + + public BigDecimal getPayPrice() { + return payPrice; + } + + public void setPayPrice(BigDecimal payPrice) { + this.payPrice = payPrice; + } + public BigDecimal getGasRefuelPrice() { return gasRefuelPrice; } @@ -595,14 +668,6 @@ public class HighGasOrder implements Serializable { this.payTime = payTime; } - public Date getFinishTime() { - return finishTime; - } - - public void setFinishTime(Date finishTime) { - this.finishTime = finishTime; - } - public Date getRefundTime() { return refundTime; } @@ -686,10 +751,16 @@ public class HighGasOrder implements Serializable { && (this.getChannelOrderNo() == null ? other.getChannelOrderNo() == null : this.getChannelOrderNo().equals(other.getChannelOrderNo())) && (this.getMemId() == null ? other.getMemId() == null : this.getMemId().equals(other.getMemId())) && (this.getMemPhone() == null ? other.getMemPhone() == null : this.getMemPhone().equals(other.getMemPhone())) + && (this.getCompanyId() == null ? other.getCompanyId() == null : this.getCompanyId().equals(other.getCompanyId())) + && (this.getCompanyName() == null ? other.getCompanyName() == null : this.getCompanyName().equals(other.getCompanyName())) && (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId())) && (this.getMerName() == null ? other.getMerName() == null : this.getMerName().equals(other.getMerName())) && (this.getStoreId() == null ? other.getStoreId() == null : this.getStoreId().equals(other.getStoreId())) && (this.getStoreName() == null ? other.getStoreName() == null : this.getStoreName().equals(other.getStoreName())) + && (this.getDeductionPrice() == null ? other.getDeductionPrice() == null : this.getDeductionPrice().equals(other.getDeductionPrice())) + && (this.getPayablePrice() == null ? other.getPayablePrice() == null : this.getPayablePrice().equals(other.getPayablePrice())) + && (this.getPayGold() == null ? other.getPayGold() == null : this.getPayGold().equals(other.getPayGold())) + && (this.getPayPrice() == null ? other.getPayPrice() == null : this.getPayPrice().equals(other.getPayPrice())) && (this.getGasRefuelPrice() == null ? other.getGasRefuelPrice() == null : this.getGasRefuelPrice().equals(other.getGasRefuelPrice())) && (this.getGasOilNo() == null ? other.getGasOilNo() == null : this.getGasOilNo().equals(other.getGasOilNo())) && (this.getGasGunNo() == null ? other.getGasGunNo() == null : this.getGasGunNo().equals(other.getGasGunNo())) @@ -721,7 +792,6 @@ public class HighGasOrder implements Serializable { && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) && (this.getCancelTime() == null ? other.getCancelTime() == null : this.getCancelTime().equals(other.getCancelTime())) && (this.getPayTime() == null ? other.getPayTime() == null : this.getPayTime().equals(other.getPayTime())) - && (this.getFinishTime() == null ? other.getFinishTime() == null : this.getFinishTime().equals(other.getFinishTime())) && (this.getRefundTime() == null ? other.getRefundTime() == null : this.getRefundTime().equals(other.getRefundTime())) && (this.getRefundRemarks() == null ? other.getRefundRemarks() == null : this.getRefundRemarks().equals(other.getRefundRemarks())) && (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) @@ -743,10 +813,16 @@ public class HighGasOrder implements Serializable { result = prime * result + ((getChannelOrderNo() == null) ? 0 : getChannelOrderNo().hashCode()); result = prime * result + ((getMemId() == null) ? 0 : getMemId().hashCode()); result = prime * result + ((getMemPhone() == null) ? 0 : getMemPhone().hashCode()); + result = prime * result + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode()); + result = prime * result + ((getCompanyName() == null) ? 0 : getCompanyName().hashCode()); result = prime * result + ((getMerId() == null) ? 0 : getMerId().hashCode()); result = prime * result + ((getMerName() == null) ? 0 : getMerName().hashCode()); result = prime * result + ((getStoreId() == null) ? 0 : getStoreId().hashCode()); result = prime * result + ((getStoreName() == null) ? 0 : getStoreName().hashCode()); + result = prime * result + ((getDeductionPrice() == null) ? 0 : getDeductionPrice().hashCode()); + result = prime * result + ((getPayablePrice() == null) ? 0 : getPayablePrice().hashCode()); + result = prime * result + ((getPayGold() == null) ? 0 : getPayGold().hashCode()); + result = prime * result + ((getPayPrice() == null) ? 0 : getPayPrice().hashCode()); result = prime * result + ((getGasRefuelPrice() == null) ? 0 : getGasRefuelPrice().hashCode()); result = prime * result + ((getGasOilNo() == null) ? 0 : getGasOilNo().hashCode()); result = prime * result + ((getGasGunNo() == null) ? 0 : getGasGunNo().hashCode()); @@ -778,7 +854,6 @@ public class HighGasOrder implements Serializable { result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); result = prime * result + ((getCancelTime() == null) ? 0 : getCancelTime().hashCode()); result = prime * result + ((getPayTime() == null) ? 0 : getPayTime().hashCode()); - result = prime * result + ((getFinishTime() == null) ? 0 : getFinishTime().hashCode()); result = prime * result + ((getRefundTime() == null) ? 0 : getRefundTime().hashCode()); result = prime * result + ((getRefundRemarks() == null) ? 0 : getRefundRemarks().hashCode()); result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); @@ -803,10 +878,16 @@ public class HighGasOrder implements Serializable { sb.append(", channelOrderNo=").append(channelOrderNo); sb.append(", memId=").append(memId); sb.append(", memPhone=").append(memPhone); + sb.append(", companyId=").append(companyId); + sb.append(", companyName=").append(companyName); sb.append(", merId=").append(merId); sb.append(", merName=").append(merName); sb.append(", storeId=").append(storeId); sb.append(", storeName=").append(storeName); + sb.append(", deductionPrice=").append(deductionPrice); + sb.append(", payablePrice=").append(payablePrice); + sb.append(", payGold=").append(payGold); + sb.append(", payPrice=").append(payPrice); sb.append(", gasRefuelPrice=").append(gasRefuelPrice); sb.append(", gasOilNo=").append(gasOilNo); sb.append(", gasGunNo=").append(gasGunNo); @@ -838,7 +919,6 @@ public class HighGasOrder implements Serializable { sb.append(", createTime=").append(createTime); sb.append(", cancelTime=").append(cancelTime); sb.append(", payTime=").append(payTime); - sb.append(", finishTime=").append(finishTime); sb.append(", refundTime=").append(refundTime); sb.append(", refundRemarks=").append(refundRemarks); sb.append(", ext1=").append(ext1); diff --git a/hai-service/src/main/java/com/hai/entity/HighGasOrderExample.java b/hai-service/src/main/java/com/hai/entity/HighGasOrderExample.java index f9698624..ddecc6e7 100644 --- a/hai-service/src/main/java/com/hai/entity/HighGasOrderExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighGasOrderExample.java @@ -586,6 +586,136 @@ public class HighGasOrderExample { return (Criteria) this; } + public Criteria andCompanyIdIsNull() { + addCriterion("company_id is null"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNotNull() { + addCriterion("company_id is not null"); + return (Criteria) this; + } + + public Criteria andCompanyIdEqualTo(Long value) { + addCriterion("company_id =", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotEqualTo(Long value) { + addCriterion("company_id <>", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThan(Long value) { + addCriterion("company_id >", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) { + addCriterion("company_id >=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThan(Long value) { + addCriterion("company_id <", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThanOrEqualTo(Long value) { + addCriterion("company_id <=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdIn(List values) { + addCriterion("company_id in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotIn(List values) { + addCriterion("company_id not in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdBetween(Long value1, Long value2) { + addCriterion("company_id between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotBetween(Long value1, Long value2) { + addCriterion("company_id not between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyNameIsNull() { + addCriterion("company_name is null"); + return (Criteria) this; + } + + public Criteria andCompanyNameIsNotNull() { + addCriterion("company_name is not null"); + return (Criteria) this; + } + + public Criteria andCompanyNameEqualTo(String value) { + addCriterion("company_name =", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotEqualTo(String value) { + addCriterion("company_name <>", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameGreaterThan(String value) { + addCriterion("company_name >", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameGreaterThanOrEqualTo(String value) { + addCriterion("company_name >=", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLessThan(String value) { + addCriterion("company_name <", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLessThanOrEqualTo(String value) { + addCriterion("company_name <=", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLike(String value) { + addCriterion("company_name like", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotLike(String value) { + addCriterion("company_name not like", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameIn(List values) { + addCriterion("company_name in", values, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotIn(List values) { + addCriterion("company_name not in", values, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameBetween(String value1, String value2) { + addCriterion("company_name between", value1, value2, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotBetween(String value1, String value2) { + addCriterion("company_name not between", value1, value2, "companyName"); + return (Criteria) this; + } + public Criteria andMerIdIsNull() { addCriterion("mer_id is null"); return (Criteria) this; @@ -846,6 +976,246 @@ public class HighGasOrderExample { return (Criteria) this; } + public Criteria andDeductionPriceIsNull() { + addCriterion("deduction_price is null"); + return (Criteria) this; + } + + public Criteria andDeductionPriceIsNotNull() { + addCriterion("deduction_price is not null"); + return (Criteria) this; + } + + public Criteria andDeductionPriceEqualTo(BigDecimal value) { + addCriterion("deduction_price =", value, "deductionPrice"); + return (Criteria) this; + } + + public Criteria andDeductionPriceNotEqualTo(BigDecimal value) { + addCriterion("deduction_price <>", value, "deductionPrice"); + return (Criteria) this; + } + + public Criteria andDeductionPriceGreaterThan(BigDecimal value) { + addCriterion("deduction_price >", value, "deductionPrice"); + return (Criteria) this; + } + + public Criteria andDeductionPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("deduction_price >=", value, "deductionPrice"); + return (Criteria) this; + } + + public Criteria andDeductionPriceLessThan(BigDecimal value) { + addCriterion("deduction_price <", value, "deductionPrice"); + return (Criteria) this; + } + + public Criteria andDeductionPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("deduction_price <=", value, "deductionPrice"); + return (Criteria) this; + } + + public Criteria andDeductionPriceIn(List values) { + addCriterion("deduction_price in", values, "deductionPrice"); + return (Criteria) this; + } + + public Criteria andDeductionPriceNotIn(List values) { + addCriterion("deduction_price not in", values, "deductionPrice"); + return (Criteria) this; + } + + public Criteria andDeductionPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("deduction_price between", value1, value2, "deductionPrice"); + return (Criteria) this; + } + + public Criteria andDeductionPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("deduction_price not between", value1, value2, "deductionPrice"); + return (Criteria) this; + } + + public Criteria andPayablePriceIsNull() { + addCriterion("payable_price is null"); + return (Criteria) this; + } + + public Criteria andPayablePriceIsNotNull() { + addCriterion("payable_price is not null"); + return (Criteria) this; + } + + public Criteria andPayablePriceEqualTo(BigDecimal value) { + addCriterion("payable_price =", value, "payablePrice"); + return (Criteria) this; + } + + public Criteria andPayablePriceNotEqualTo(BigDecimal value) { + addCriterion("payable_price <>", value, "payablePrice"); + return (Criteria) this; + } + + public Criteria andPayablePriceGreaterThan(BigDecimal value) { + addCriterion("payable_price >", value, "payablePrice"); + return (Criteria) this; + } + + public Criteria andPayablePriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("payable_price >=", value, "payablePrice"); + return (Criteria) this; + } + + public Criteria andPayablePriceLessThan(BigDecimal value) { + addCriterion("payable_price <", value, "payablePrice"); + return (Criteria) this; + } + + public Criteria andPayablePriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("payable_price <=", value, "payablePrice"); + return (Criteria) this; + } + + public Criteria andPayablePriceIn(List values) { + addCriterion("payable_price in", values, "payablePrice"); + return (Criteria) this; + } + + public Criteria andPayablePriceNotIn(List values) { + addCriterion("payable_price not in", values, "payablePrice"); + return (Criteria) this; + } + + public Criteria andPayablePriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("payable_price between", value1, value2, "payablePrice"); + return (Criteria) this; + } + + public Criteria andPayablePriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("payable_price not between", value1, value2, "payablePrice"); + return (Criteria) this; + } + + public Criteria andPayGoldIsNull() { + addCriterion("pay_gold is null"); + return (Criteria) this; + } + + public Criteria andPayGoldIsNotNull() { + addCriterion("pay_gold is not null"); + return (Criteria) this; + } + + public Criteria andPayGoldEqualTo(Integer value) { + addCriterion("pay_gold =", value, "payGold"); + return (Criteria) this; + } + + public Criteria andPayGoldNotEqualTo(Integer value) { + addCriterion("pay_gold <>", value, "payGold"); + return (Criteria) this; + } + + public Criteria andPayGoldGreaterThan(Integer value) { + addCriterion("pay_gold >", value, "payGold"); + return (Criteria) this; + } + + public Criteria andPayGoldGreaterThanOrEqualTo(Integer value) { + addCriterion("pay_gold >=", value, "payGold"); + return (Criteria) this; + } + + public Criteria andPayGoldLessThan(Integer value) { + addCriterion("pay_gold <", value, "payGold"); + return (Criteria) this; + } + + public Criteria andPayGoldLessThanOrEqualTo(Integer value) { + addCriterion("pay_gold <=", value, "payGold"); + return (Criteria) this; + } + + public Criteria andPayGoldIn(List values) { + addCriterion("pay_gold in", values, "payGold"); + return (Criteria) this; + } + + public Criteria andPayGoldNotIn(List values) { + addCriterion("pay_gold not in", values, "payGold"); + return (Criteria) this; + } + + public Criteria andPayGoldBetween(Integer value1, Integer value2) { + addCriterion("pay_gold between", value1, value2, "payGold"); + return (Criteria) this; + } + + public Criteria andPayGoldNotBetween(Integer value1, Integer value2) { + addCriterion("pay_gold not between", value1, value2, "payGold"); + return (Criteria) this; + } + + public Criteria andPayPriceIsNull() { + addCriterion("pay_price is null"); + return (Criteria) this; + } + + public Criteria andPayPriceIsNotNull() { + addCriterion("pay_price is not null"); + return (Criteria) this; + } + + public Criteria andPayPriceEqualTo(BigDecimal value) { + addCriterion("pay_price =", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceNotEqualTo(BigDecimal value) { + addCriterion("pay_price <>", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceGreaterThan(BigDecimal value) { + addCriterion("pay_price >", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("pay_price >=", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceLessThan(BigDecimal value) { + addCriterion("pay_price <", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("pay_price <=", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceIn(List values) { + addCriterion("pay_price in", values, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceNotIn(List values) { + addCriterion("pay_price not in", values, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("pay_price between", value1, value2, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("pay_price not between", value1, value2, "payPrice"); + return (Criteria) this; + } + public Criteria andGasRefuelPriceIsNull() { addCriterion("gas_refuel_price is null"); return (Criteria) this; @@ -2776,66 +3146,6 @@ public class HighGasOrderExample { return (Criteria) this; } - public Criteria andFinishTimeIsNull() { - addCriterion("finish_time is null"); - return (Criteria) this; - } - - public Criteria andFinishTimeIsNotNull() { - addCriterion("finish_time is not null"); - return (Criteria) this; - } - - public Criteria andFinishTimeEqualTo(Date value) { - addCriterion("finish_time =", value, "finishTime"); - return (Criteria) this; - } - - public Criteria andFinishTimeNotEqualTo(Date value) { - addCriterion("finish_time <>", value, "finishTime"); - return (Criteria) this; - } - - public Criteria andFinishTimeGreaterThan(Date value) { - addCriterion("finish_time >", value, "finishTime"); - return (Criteria) this; - } - - public Criteria andFinishTimeGreaterThanOrEqualTo(Date value) { - addCriterion("finish_time >=", value, "finishTime"); - return (Criteria) this; - } - - public Criteria andFinishTimeLessThan(Date value) { - addCriterion("finish_time <", value, "finishTime"); - return (Criteria) this; - } - - public Criteria andFinishTimeLessThanOrEqualTo(Date value) { - addCriterion("finish_time <=", value, "finishTime"); - return (Criteria) this; - } - - public Criteria andFinishTimeIn(List values) { - addCriterion("finish_time in", values, "finishTime"); - return (Criteria) this; - } - - public Criteria andFinishTimeNotIn(List values) { - addCriterion("finish_time not in", values, "finishTime"); - return (Criteria) this; - } - - public Criteria andFinishTimeBetween(Date value1, Date value2) { - addCriterion("finish_time between", value1, value2, "finishTime"); - return (Criteria) this; - } - - public Criteria andFinishTimeNotBetween(Date value1, Date value2) { - addCriterion("finish_time not between", value1, value2, "finishTime"); - return (Criteria) this; - } - public Criteria andRefundTimeIsNull() { addCriterion("refund_time is null"); return (Criteria) this; diff --git a/hai-service/src/main/java/com/hai/enum_type/UserRoleTypeEnum.java b/hai-service/src/main/java/com/hai/enum_type/UserRoleTypeEnum.java new file mode 100644 index 00000000..df831fd0 --- /dev/null +++ b/hai-service/src/main/java/com/hai/enum_type/UserRoleTypeEnum.java @@ -0,0 +1,46 @@ +package com.hai.enum_type; + +/** + * @className: UserRoelTypeEnum + * @author: HuRui + * @date: 2022/9/21 + **/ +public enum UserRoleTypeEnum { + type0(0, "超级管理员"), + type1(1, "运营中心"), + type2(2, "商户角色"), + type3(3, "门店角色"), + type4(4, "代理商角色"), + type5(5, "分公司角色"), + type6(6, "充值后台人员"), + type7(7, "渠道公司角色"), + type8(8, "团油代理商"), + type9(9, "团油业务员"), + type10(10, "加油站员工"), + ; + + private Integer type; + + private String name; + + UserRoleTypeEnum(Integer type,String name) { + this.type = type; + this.name = name; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/hai-service/src/main/java/com/hai/order/model/ExportGasOrderModel.java b/hai-service/src/main/java/com/hai/order/model/ExportGasOrderModel.java new file mode 100644 index 00000000..64321e9b --- /dev/null +++ b/hai-service/src/main/java/com/hai/order/model/ExportGasOrderModel.java @@ -0,0 +1,127 @@ +package com.hai.order.model; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 导出油站订单模型 + * @className: ExportGasOrderModel + * @author: HuRui + * @date: 2022/9/20 + **/ +@Data +public class ExportGasOrderModel { + + @ColumnWidth(25) + @ExcelProperty("交易订单号") + private String orderNo; + + @ColumnWidth(25) + @ExcelProperty("加油站") + private String storeName; + + @ColumnWidth(15) + @ExcelProperty("加油员") + private String gasStaffName; + + @ColumnWidth(15) + @ExcelProperty("客户手机号") + private String memPhone; + + @ColumnWidth(15) + @ExcelProperty({ "加油信息", "加油金额"}) + private BigDecimal gasRefuelPrice; + + @ColumnWidth(15) + @ExcelProperty({ "加油信息", "加油升数"}) + private BigDecimal gasOilLiters; + + @ColumnWidth(10) + @ExcelProperty({ "加油信息", "油号"}) + private String gasOilNo; + + @ColumnWidth(10) + @ExcelProperty({ "加油信息", "油枪号"}) + private String gasGunNo; + + @ColumnWidth(10) + @ExcelProperty({ "加油信息", "平台折扣"}) + private String gasDiscount; + + @ColumnWidth(10) + @ExcelProperty({ "加油信息", "平台补贴"}) + private BigDecimal gasOilSubsidy; + + @ColumnWidth(10) + @ExcelProperty({ "加油信息", "平台价"}) + private BigDecimal gasPricePlatform; + + @ColumnWidth(10) + @ExcelProperty({ "加油信息", "油站价"}) + private BigDecimal gasPriceGun; + + @ColumnWidth(10) + @ExcelProperty({ "加油信息", "国标价"}) + private BigDecimal gasPriceOfficial; + + @ColumnWidth(15) + @ExcelProperty({ "支付信息", "加油优惠"}) + private BigDecimal deductionPrice; + + @ColumnWidth(15) + @ExcelProperty({ "支付信息", "应付金额"}) + private BigDecimal payablePrice; + + @ColumnWidth(15) + @ExcelProperty({ "支付信息", "积分抵扣"}) + private Integer payGold; + + @ColumnWidth(15) + @ExcelProperty({ "支付信息", "实付金额"}) + private String payPrice; + + @ColumnWidth(15) + @ExcelProperty("交易状态") + private String status; + + @ColumnWidth(22) + @ExcelProperty("创建时间") + private Date createTime; + + @ColumnWidth(22) + @ExcelProperty("支付时间") + private Date payTime; + + @ColumnWidth(22) + @ExcelProperty("退款时间") + private Date refundTime; + + @ColumnWidth(22) + @ExcelProperty("取消时间") + private Date cancelTime; + + @ColumnWidth(20) + @ExcelProperty("分公司") + private String companyName; + + @ColumnWidth(20) + @ExcelProperty("商户") + private String merName; + + @ColumnWidth(20) + @ExcelProperty("业务员") + private String gasSalesmanName; + + @ColumnWidth(20) + @ExcelProperty("代理商") + private String gasAgentName; + + @ColumnWidth(20) + @ExcelProperty("代理公司") + private String gasOrgName; + +} diff --git a/hai-service/src/main/java/com/hai/order/service/OrderCreateHandleService.java b/hai-service/src/main/java/com/hai/order/service/OrderCreateHandleService.java index 38ce4ee2..c44110ce 100644 --- a/hai-service/src/main/java/com/hai/order/service/OrderCreateHandleService.java +++ b/hai-service/src/main/java/com/hai/order/service/OrderCreateHandleService.java @@ -6,6 +6,7 @@ import com.hai.entity.HighOrder; import com.hai.model.ResponseData; import com.hai.order.model.CreateOrderCheckReturnData; import com.hai.order.model.CreateOrderChildModel; +import com.hai.order.model.CreateOrderModel; import java.util.List; @@ -38,7 +39,7 @@ public interface OrderCreateHandleService { * @param createOrderChild 子订单参数 * @return */ - HighChildOrder oilHandle(HighOrder order,HighDiscountUserRel discountUserRel, CreateOrderChildModel createOrderChild) throws Exception; + HighChildOrder oilHandle(HighOrder order, HighDiscountUserRel discountUserRel, CreateOrderModel createOrderModel,CreateOrderChildModel createOrderChild) throws Exception; /** * 优惠券包校验 diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderCancelHandleServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderCancelHandleServiceImpl.java index b2d58a8b..eb01fcde 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderCancelHandleServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderCancelHandleServiceImpl.java @@ -5,6 +5,7 @@ import com.hai.entity.HighCouponCode; import com.hai.entity.HighGasOrder; import com.hai.order.service.OrderCancelHandleService; import com.hai.order.type.OrderChildStatus; +import com.hai.order.type.OrderOilStatus; import com.hai.service.HighCouponCodeService; import com.hai.service.HighGasOrderService; import org.springframework.stereotype.Service; @@ -43,7 +44,7 @@ public class OrderCancelHandleServiceImpl implements OrderCancelHandleService { HighGasOrder gasOrder = gasOrderService.getDetailByChildOrderNo(childOrder.getChildOrderNo()); if (gasOrder != null) { gasOrder.setCancelTime(new Date()); - gasOrder.setStatus(OrderChildStatus.STATUS5.getNumber()); + gasOrder.setStatus(OrderOilStatus.STATUS3.getNumber()); gasOrderService.updateGasOrder(gasOrder); } } diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java index 1e18a234..5906878a 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java @@ -19,11 +19,13 @@ import com.hai.model.GasPayPriceModel; import com.hai.model.HighMerchantModel; import com.hai.model.ResponseData; import com.hai.order.model.CreateOrderChildModel; +import com.hai.order.model.CreateOrderModel; import com.hai.order.service.OrderCreateHandleService; import com.hai.order.service.OrderService; import com.hai.order.service.OrderServiceExt; import com.hai.order.type.OrderChildGoodsType; import com.hai.order.type.OrderChildStatus; +import com.hai.order.type.OrderOilStatus; import com.hai.order.utils.OrderUtil; import com.hai.service.*; import org.apache.commons.lang3.StringUtils; @@ -51,6 +53,9 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { @Resource private CommonService commonService; + @Resource + private BsCompanyService companyService; + @Resource private OrderService orderService; @@ -255,7 +260,7 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { } @Override - public HighChildOrder oilHandle(HighOrder order,HighDiscountUserRel discountUserRel, CreateOrderChildModel createOrderChild) throws Exception { + public HighChildOrder oilHandle(HighOrder order, HighDiscountUserRel discountUserRel, CreateOrderModel createOrderModel, CreateOrderChildModel createOrderChild) throws Exception { // 查询油品类型 SecDictionary gasOilType = commonService.mappingSysCode("GAS_OIL_TYPE", createOrderChild.getGasOilNo()); if (gasOilType == null) { @@ -283,6 +288,11 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { if (merchant == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的油站"); } + // 查询分公司 + BsCompany company = companyService.getCompanyById(merchant.getCompanyId()); + if (company == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的分公司"); + } // 营销减免的金额 BigDecimal marketingPrice = merchantAccountMarketingService.getPrice(store.getMerchantId(), MerAccountMarketingType.type3.getType(), Integer.valueOf(createOrderChild.getGasOilNo())); @@ -317,6 +327,8 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { gasOrder.setChannelType(store.getSourceType()); gasOrder.setOrderNo(order.getOrderNo()); gasOrder.setChildOrderNo(childOrder.getChildOrderNo()); + gasOrder.setCompanyId(company.getId()); + gasOrder.setCompanyName(company.getName()); gasOrder.setMemId(childOrder.getMemId()); gasOrder.setMemPhone(childOrder.getMemPhone()); gasOrder.setMerId(store.getMerchantId()); @@ -327,7 +339,8 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { gasOrder.setGasOilNo(createOrderChild.getGasOilNo()); gasOrder.setGasGunNo(createOrderChild.getGasGunNo()); gasOrder.setGasOilType(Integer.parseInt(gasOilType.getExt1())); - gasOrder.setStatus(OrderChildStatus.STATUS1.getNumber()); + gasOrder.setStatus(OrderOilStatus.STATUS1.getNumber()); + gasOrder.setGasDiscount(new BigDecimal("0")); // 成本价 油站价 减 营销策略价 gasOrder.setGasPriceCost(priceModel.getPriceGun().subtract(marketingPrice)); @@ -337,10 +350,35 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { gasOrder.setGasPriceCostTotal(gasOrder.getGasRefuelPrice().multiply(gasOrder.getGasOilLiters()).setScale(2, BigDecimal.ROUND_HALF_DOWN)); } - // 使用了优惠价 + // 使用了优惠券 if (discountUserRel != null) { // 支付价格 childOrder.setGoodsActualPrice(childOrder.getGoodsPrice()); + + // 优惠券类型 1:满减 2:抵扣 3:折扣 + if (discountUserRel.getHighDiscount().getDiscountType() == 1) { + // 如果订单总额 小于 满减价格 + if (gasOrder.getGasRefuelPrice().compareTo(discountUserRel.getHighDiscount().getDiscountCondition()) > 1) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.UN_MEMBER_ERROR, "订单未达到"+discountUserRel.getHighDiscount().getDiscountCondition()+"元,无法使用此优惠券"); + } + gasOrder.setDeductionPrice(discountUserRel.getHighDiscount().getDiscountPrice()); + } + else if (discountUserRel.getHighDiscount().getDiscountType() == 2) { + gasOrder.setDeductionPrice(discountUserRel.getHighDiscount().getDiscountPrice()); + } + else if (discountUserRel.getHighDiscount().getDiscountType() == 3) { + // 加油金额 * 折扣 + BigDecimal deductionPrice = gasOrder.getGasRefuelPrice() + .multiply(discountUserRel.getHighDiscount().getDiscountPrice()) + .setScale(2, BigDecimal.ROUND_HALF_DOWN); + gasOrder.setDeductionPrice(gasOrder.getGasRefuelPrice().subtract(deductionPrice)); + } + + gasOrder.setPayablePrice(gasOrder.getGasRefuelPrice().subtract(gasOrder.getDeductionPrice())); + if (gasOrder.getPayablePrice().compareTo(new BigDecimal("0")) < 0) { + gasOrder.setPayablePrice(new BigDecimal("0")); + } + // 油价信息 gasOrder.setGasPriceGun(priceModel.getPriceGun()); gasOrder.setGasPriceVip(priceModel.getPriceGun()); @@ -351,9 +389,13 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { gasOrder.setGasOilSubsidy(new BigDecimal("0")); gasOrder.setGasLitersPreferences(new BigDecimal("0")); gasOrder.setGasPricePreferences(priceModel.getPriceGun()); - } else { + } + else { // 支付价格 childOrder.setGoodsActualPrice(priceModel.getPayPrice()); + gasOrder.setDeductionPrice(priceModel.getTotalPreferences()); + gasOrder.setPayablePrice(priceModel.getPayPrice()); + // 油价信息 gasOrder.setGasPriceGun(priceModel.getPriceGun()); gasOrder.setGasPriceVip(priceModel.getPriceVip()); @@ -366,6 +408,8 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { gasOrder.setGasPricePreferences(priceModel.getPricePreferences()); } + gasOrder.setPayGold(createOrderModel.getPayGold()!=null?createOrderModel.getPayGold():0); + if (store.getSourceType().equals(MerchantStoreSourceType.type4.getNumber())) { // 查询金猪油品数据 JinZhuJiaYouOilNo jzOilNo = JinZhuJiaYouOilNo.getDataByOilNo(Integer.valueOf(gasOrder.getGasOilNo())); diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java index d1e87b31..b766f9bf 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java @@ -14,10 +14,7 @@ import com.hai.msg.entity.MsgTopic; import com.hai.order.service.OrderPaySuccessService; import com.hai.order.service.OrderService; import com.hai.order.topic.OrderTopic; -import com.hai.order.type.OrderChildGoodsType; -import com.hai.order.type.OrderChildStatus; -import com.hai.order.type.OrderPayType; -import com.hai.order.type.OrderStatus; +import com.hai.order.type.*; import com.hai.service.*; import org.apache.rocketmq.client.producer.SendCallback; import org.apache.rocketmq.client.producer.SendResult; @@ -141,6 +138,9 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { } else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE3.getNumber())) { oilHandle(order,childOrder); + order.setOrderStatus(OrderStatus.STATUS3.getNumber()); + order.setFinishTime(new Date()); + orderService.updateOrderData(order); } else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE4.getNumber())) { @@ -217,7 +217,8 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { HighGasOrder gasOrder = gasOrderService.getDetailByChildOrderNo(childOrder.getChildOrderNo()); if (gasOrder != null) { gasOrder.setPayTime(new Date()); - gasOrder.setStatus(OrderChildStatus.STATUS2.getNumber()); + gasOrder.setStatus(OrderOilStatus.STATUS2.getNumber()); + gasOrder.setPayPrice(order.getPayPrice()); gasOrderService.updateGasOrder(gasOrder); // 查询油站 diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java index 3ee526e5..c0fb9c77 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java @@ -140,7 +140,6 @@ public class OrderServiceImpl implements OrderService { order.setCreateTime(new Date()); order.setPayGold(0); - /*********** 组装处理子订单 商品业务************/ List childOrderList = new ArrayList<>(); for (CreateOrderChildModel child : createOrderModel.getChildOrderList()) { @@ -161,7 +160,7 @@ public class OrderServiceImpl implements OrderService { // 加油订单 } else if (child.getGoodsType().equals(OrderChildGoodsType.TYPE3.getNumber())) { order.setProductType(OrderProductType.PRODUCT_TYPE6.getNumber()); - childOrderList.add(orderCreateHandleService.oilHandle(order, discountUserRel, child)); + childOrderList.add(orderCreateHandleService.oilHandle(order, discountUserRel, createOrderModel, child)); // 肯德基 } else if (child.getGoodsType().equals(OrderChildGoodsType.TYPE4.getNumber())) { @@ -346,20 +345,9 @@ public class OrderServiceImpl implements OrderService { HighOrder orderData = insertOrderData(order); if (orderData.getOrderStatus().equals(OrderStatus.STATUS1.getNumber())) { - SendCallback sendCallback = new SendCallback() { - @Override - public void onSuccess(SendResult sendResult) { - System.out.println("发送成功!"); - } - - @Override - public void onException(Throwable throwable) { - System.out.println("发送失败!"); - } - }; - // 10分钟后取消订单 + // 10分钟内未支付,自动取消订单 Message rocketMsg = MessageBuilder.withPayload(order).build(); - rocketMQTemplate.asyncSend(OrderTopic.ORDER_TOPIC_CANCEL.getTopic(), rocketMsg, sendCallback,1000,14); + rocketMQTemplate.syncSend(OrderTopic.ORDER_TOPIC_CANCEL.getTopic(), rocketMsg,1000,14); } else if (orderData.getOrderStatus().equals(OrderStatus.STATUS2.getNumber())) { // 异步处理业务 diff --git a/hai-service/src/main/java/com/hai/order/type/OrderOilStatus.java b/hai-service/src/main/java/com/hai/order/type/OrderOilStatus.java new file mode 100644 index 00000000..dd541ad6 --- /dev/null +++ b/hai-service/src/main/java/com/hai/order/type/OrderOilStatus.java @@ -0,0 +1,62 @@ +package com.hai.order.type; + +import java.util.Objects; + +/** + * @className: OrderOilStatus + * @author: HuRui + * @date: 2022/9/19 + **/ +public enum OrderOilStatus { + STATUS1(1, "待支付"), + STATUS2(2, "已支付"), + STATUS3(3, "已取消"), + STATUS4(4, "已退款"), + STATUS6(5, "退款中"), + STATUS8(6, "退款失败"), + ; + + private Integer number; + + private String name; + + OrderOilStatus(int number, String name) { + this.number = number; + this.name = name; + } + + /** + * 根据类型查询数据 + * @param type + * @return + */ + public static OrderOilStatus getDataByType(Integer type) { + for (OrderOilStatus ele : values()) { + if(Objects.equals(type,ele.getNumber())) return ele; + } + return null; + } + + public static String getNameByType(Integer type) { + for (OrderOilStatus ele : values()) { + if(Objects.equals(type,ele.getNumber())) return ele.getName(); + } + return null; + } + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/hai-service/src/main/java/com/hai/service/HighGasOrderService.java b/hai-service/src/main/java/com/hai/service/HighGasOrderService.java index 59ebaf9c..5c4a97c4 100644 --- a/hai-service/src/main/java/com/hai/service/HighGasOrderService.java +++ b/hai-service/src/main/java/com/hai/service/HighGasOrderService.java @@ -32,6 +32,13 @@ public interface HighGasOrderService { */ HighGasOrder getDetailByChildOrderNo(String childOrderNo); + /** + * 查询交易订单号获取详情 + * @param orderNo + * @return + */ + HighGasOrder getDetailByOrderNo(String orderNo); + /** * 查询油站订单列表 * @param param diff --git a/hai-service/src/main/java/com/hai/service/impl/HighGasOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighGasOrderServiceImpl.java index f4d5c085..affb6ea9 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighGasOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighGasOrderServiceImpl.java @@ -46,13 +46,24 @@ public class HighGasOrderServiceImpl implements HighGasOrderService { return null; } + @Override + public HighGasOrder getDetailByOrderNo(String orderNo) { + HighGasOrderExample example = new HighGasOrderExample(); + example.createCriteria().andOrderNoEqualTo(orderNo); + List list = gasOrderMapper.selectByExample(example); + if (list.size() > 0) { + return list.get(0); + } + return null; + } + @Override public List getGasOrderList(Map param) { HighGasOrderExample example = new HighGasOrderExample(); HighGasOrderExample.Criteria criteria = example.createCriteria(); if (MapUtils.getLong(param, "companyId") != null) { - + criteria.andCompanyIdEqualTo(MapUtils.getLong(param, "companyId")); } if (MapUtils.getLong(param, "merId") != null) { @@ -63,6 +74,22 @@ public class HighGasOrderServiceImpl implements HighGasOrderService { criteria.andStoreIdEqualTo(MapUtils.getLong(param, "storeId")); } + if (MapUtils.getLong(param, "gasOrgId") != null) { + criteria.andGasOrgIdEqualTo(MapUtils.getLong(param, "gasOrgId")); + } + + if (MapUtils.getLong(param, "gasAgentId") != null) { + criteria.andGasAgentIdEqualTo(MapUtils.getLong(param, "gasAgentId")); + } + + if (MapUtils.getLong(param, "gasSalesmanId") != null) { + criteria.andGasSalesmanIdEqualTo(MapUtils.getLong(param, "gasSalesmanId")); + } + + if (MapUtils.getLong(param, "gasStaffId") != null) { + criteria.andGasStaffIdEqualTo(MapUtils.getLong(param, "gasStaffId")); + } + if (StringUtils.isNotBlank(MapUtils.getString(param, "storeName"))) { criteria.andStoreNameLike("%"+MapUtils.getString(param, "storeName")+"%"); } @@ -83,6 +110,10 @@ public class HighGasOrderServiceImpl implements HighGasOrderService { criteria.andGasOilTypeEqualTo(MapUtils.getInteger(param, "storeId")); } + if (StringUtils.isNotBlank(MapUtils.getString(param, "gasStaffName"))) { + criteria.andGasStaffNameLike("%"+MapUtils.getString(param, "gasStaffName")+"%"); + } + if (StringUtils.isNotBlank(MapUtils.getString(param, "gasOilNo"))) { criteria.andGasOilNoEqualTo(MapUtils.getString(param, "gasOilNo")); }