From 8724386e31c4f5165ea9a0b54590fb572c9d665c Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Thu, 7 Jul 2022 18:08:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bweb/controller/HighGasController.java | 138 ++++++++++++------ .../controller/HighGasStaffController.java | 68 +++++++++ .../src/main/resources/dev/config.properties | 4 +- .../cweb/controller/HighOrderController.java | 21 +++ .../hai/common/security/AESEncodeUtil.java | 2 + .../com/hai/dao/HighChildOrderMapper.java | 17 ++- .../hai/dao/HighChildOrderSqlProvider.java | 28 ++++ .../java/com/hai/dao/HighGasStaffMapper.java | 17 ++- .../com/hai/dao/HighGasStaffSqlProvider.java | 14 ++ .../java/com/hai/dao/HighOrderMapperExt.java | 17 +++ .../java/com/hai/entity/HighChildOrder.java | 32 ++++ .../com/hai/entity/HighChildOrderExample.java | 130 +++++++++++++++++ .../java/com/hai/entity/HighGasStaff.java | 16 ++ .../com/hai/entity/HighGasStaffExample.java | 70 +++++++++ .../main/java/com/hai/entity/HighOrder.java | 10 ++ .../com/hai/enum_type/GasPositionType.java | 1 + .../com/hai/enum_type/UserObjectTypeEnum.java | 1 + .../java/com/hai/model/GasOrderModel.java | 9 ++ .../com/hai/service/HighOrderService.java | 16 ++ .../service/impl/HighGasStaffServiceImpl.java | 2 + .../service/impl/HighOrderServiceImpl.java | 10 ++ 21 files changed, 567 insertions(+), 56 deletions(-) diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java b/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java index 056bd7be..d2eeb5d8 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java @@ -111,41 +111,80 @@ public class HighGasController { Map param = new HashMap<>();; param.put("gasName", userInfoModel.getMerchantStore().getStoreName()); - Map history = new HashMap<>(); - // 历史加油总金额 - Map historyTotal = highOrderService.getGasHistoryOrderCount(userInfoModel.getMerchantStore().getId(), "2,3,4,6,7"); - history.put("totalPrice", historyTotal.get("price")); - history.put("totalCount", historyTotal.get("count")); - - // 历史加油金额 - Map historyIncomet = highOrderService.getGasHistoryOrderCount(userInfoModel.getMerchantStore().getId(), "2,3,6,7"); - history.put("incomePrice", historyIncomet.get("price")); - history.put("incomeCount", historyIncomet.get("count")); - - // 历史退款 - Map historyRefund = highOrderService.getGasHistoryOrderCount(userInfoModel.getMerchantStore().getId(), "4"); - history.put("refundPrice", historyRefund.get("price")); - history.put("refundCount", historyRefund.get("count")); - param.put("history", history); - - - Map today = new HashMap<>(); - // 今日加油总金额 - Map todayTotal = highOrderService.getGasTheDayOrderCount(userInfoModel.getMerchantStore().getId(), "2,3,4,6,7"); - today.put("totalPrice", todayTotal.get("price")); - today.put("totalCount", todayTotal.get("count")); - - // 今日加油金额 - Map todayIncomet = highOrderService.getGasTheDayOrderCount(userInfoModel.getMerchantStore().getId(), "2,3,6,7"); - today.put("incomePrice", todayIncomet.get("price")); - today.put("incomeCount", todayIncomet.get("count")); - - // 今日退款 - Map todayRefund = highOrderService.getGasTheDayOrderCount(userInfoModel.getMerchantStore().getId(), "4"); - today.put("refundPrice", todayRefund.get("price")); - today.put("refundCount", todayRefund.get("count")); - param.put("today", today); + if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type8.getType()) + && userInfoModel.getGasStaff().getPositionType().equals(GasPositionType.status2.getStatus())) { + + Map history = new HashMap<>(); + // 历史加油总金额 + Map historyTotal = highOrderService.getGasStaffHistoryOrderCount(userInfoModel.getGasStaff().getId(), "2,3,4,6,7"); + history.put("totalPrice", historyTotal.get("price")); + history.put("totalCount", historyTotal.get("count")); + + // 历史加油金额 + Map historyIncomet = highOrderService.getGasStaffHistoryOrderCount(userInfoModel.getGasStaff().getId(), "2,3,6,7"); + history.put("incomePrice", historyIncomet.get("price")); + history.put("incomeCount", historyIncomet.get("count")); + + // 历史退款 + Map historyRefund = highOrderService.getGasStaffHistoryOrderCount(userInfoModel.getGasStaff().getId(), "4"); + history.put("refundPrice", historyRefund.get("price")); + history.put("refundCount", historyRefund.get("count")); + param.put("history", history); + + + Map today = new HashMap<>(); + // 今日加油总金额 + Map todayTotal = highOrderService.getGasStaffTheDayOrderCount(userInfoModel.getGasStaff().getId(), "2,3,4,6,7"); + today.put("totalPrice", todayTotal.get("price")); + today.put("totalCount", todayTotal.get("count")); + + // 今日加油金额 + Map todayIncomet = highOrderService.getGasStaffTheDayOrderCount(userInfoModel.getGasStaff().getId(), "2,3,6,7"); + today.put("incomePrice", todayIncomet.get("price")); + today.put("incomeCount", todayIncomet.get("count")); + + // 今日退款 + Map todayRefund = highOrderService.getGasStaffTheDayOrderCount(userInfoModel.getGasStaff().getId(), "4"); + today.put("refundPrice", todayRefund.get("price")); + today.put("refundCount", todayRefund.get("count")); + param.put("today", today); + } else { + Map history = new HashMap<>(); + // 历史加油总金额 + Map historyTotal = highOrderService.getGasHistoryOrderCount(userInfoModel.getMerchantStore().getId(), "2,3,4,6,7"); + history.put("totalPrice", historyTotal.get("price")); + history.put("totalCount", historyTotal.get("count")); + + // 历史加油金额 + Map historyIncomet = highOrderService.getGasHistoryOrderCount(userInfoModel.getMerchantStore().getId(), "2,3,6,7"); + history.put("incomePrice", historyIncomet.get("price")); + history.put("incomeCount", historyIncomet.get("count")); + + // 历史退款 + Map historyRefund = highOrderService.getGasHistoryOrderCount(userInfoModel.getMerchantStore().getId(), "4"); + history.put("refundPrice", historyRefund.get("price")); + history.put("refundCount", historyRefund.get("count")); + param.put("history", history); + + + Map today = new HashMap<>(); + // 今日加油总金额 + Map todayTotal = highOrderService.getGasTheDayOrderCount(userInfoModel.getMerchantStore().getId(), "2,3,4,6,7"); + today.put("totalPrice", todayTotal.get("price")); + today.put("totalCount", todayTotal.get("count")); + + // 今日加油金额 + Map todayIncomet = highOrderService.getGasTheDayOrderCount(userInfoModel.getMerchantStore().getId(), "2,3,6,7"); + today.put("incomePrice", todayIncomet.get("price")); + today.put("incomeCount", todayIncomet.get("count")); + + // 今日退款 + Map todayRefund = highOrderService.getGasTheDayOrderCount(userInfoModel.getMerchantStore().getId(), "4"); + today.put("refundPrice", todayRefund.get("price")); + today.put("refundCount", todayRefund.get("count")); + param.put("today", today); + } return ResponseMsgUtil.success(param); } catch (Exception e) { @@ -159,6 +198,7 @@ public class HighGasController { @ApiOperation(value = "查询油站订单列表") public ResponseData getGasOrderList(@RequestParam(name = "orderNo", required = false) String orderNo, @RequestParam(name = "storeId", required = false) Long storeId, + @RequestParam(name = "staffId", required = false) Long staffId, @RequestParam(name = "status", required = false) Integer status, @RequestParam(name = "createTimeS", required = false) Long createTimeS, @RequestParam(name = "createTimeE", required = false) Long createTimeE, @@ -170,7 +210,7 @@ public class HighGasController { log.error("HighGasController -> disabledOil() error!",""); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); } - Map param = new HashMap<>();; + Map param = new HashMap<>(); // 用户来源 0:超级管理员 1:公司 2:商户 3:门店 4. 代理商 5.充值后台工商 6.团油代理商 7.团油业务员 8. 加油站员工 if (userInfoModel.getSecUser().getObjectType().equals(2)) { if (storeId != null) { @@ -191,15 +231,20 @@ public class HighGasController { } else { param.put("storeId", 0); } - } + param.put("gasStaffId", staffId); } else if (userInfoModel.getSecUser().getObjectType().equals(3)) { param.put("storeId", userInfoModel.getMerchantStore().getId()); + param.put("gasStaffId", staffId); } else if (userInfoModel.getSecUser().getObjectType().equals(8)) { - param.put("storeId", userInfoModel.getMerchantStore().getId()); - + if (userInfoModel.getGasStaff().getPositionType().equals(GasPositionType.status1.getStatus())) { + param.put("storeId", userInfoModel.getMerchantStore().getId()); + } + if (userInfoModel.getGasStaff().getPositionType().equals(GasPositionType.status2.getStatus())) { + param.put("gasStaffId", userInfoModel.getGasStaff().getId()); + } } else { log.error("HighGasController -> disabledOil() error!",""); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); @@ -260,6 +305,7 @@ public class HighGasController { @ApiOperation(value = "导出油站订单") public ResponseData exportGasOrder(@RequestParam(name = "orderNo", required = false) String orderNo, @RequestParam(name = "storeId", required = false) Long storeId, + @RequestParam(name = "staffId", required = false) Long staffId, @RequestParam(name = "status", required = false) Integer status, @RequestParam(name = "createTimeS", required = false) Long createTimeS, @RequestParam(name = "createTimeE", required = false) Long createTimeE) { @@ -290,20 +336,24 @@ public class HighGasController { } else { param.put("storeId", 0); } - } + param.put("gasStaffId", staffId); } else if (userInfoModel.getSecUser().getObjectType().equals(3)) { param.put("storeId", userInfoModel.getMerchantStore().getId()); + param.put("gasStaffId", staffId); } else if (userInfoModel.getSecUser().getObjectType().equals(8)) { - param.put("storeId", userInfoModel.getMerchantStore().getId()); - + if (userInfoModel.getGasStaff().getPositionType().equals(GasPositionType.status1.getStatus())) { + param.put("storeId", userInfoModel.getMerchantStore().getId()); + } + if (userInfoModel.getGasStaff().getPositionType().equals(GasPositionType.status2.getStatus())) { + param.put("gasStaffId", userInfoModel.getGasStaff().getId()); + } } else { log.error("HighGasController -> disabledOil() error!",""); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); } - param.put("orderNo", orderNo); param.put("createTimeS", createTimeS); param.put("createTimeE", createTimeE); @@ -317,6 +367,7 @@ public class HighGasController { List headList = new ArrayList<>(); headList.add("订单号"); headList.add("油站名称"); + headList.add("加油员"); headList.add("油品类型"); headList.add("油品油号"); headList.add("油枪号"); @@ -337,6 +388,7 @@ public class HighGasController { data = new ArrayList<>(); data.add(orderModel.getOrderNo()); data.add(orderModel.getGasName()); + data.add(StringUtils.isNotBlank(orderModel.getGasStaffName())?orderModel.getGasStaffName():"未知"); data.add(orderModel.getGasOilType().equals("1") ? "汽油": "柴油"); data.add(orderModel.getGasOilNo() + "#"); data.add(orderModel.getGasGunNo() + "号"); @@ -357,7 +409,7 @@ public class HighGasController { if (!file.exists()) { file.mkdirs(); } - EasyExcel.write(fileUrl+pathName).head(generationHead(headList)).sheet("油卡").doWrite(dataList); + EasyExcel.write(fileUrl+pathName).head(generationHead(headList)).sheet("加油订单").doWrite(dataList); return ResponseMsgUtil.success(pathName); diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighGasStaffController.java b/hai-bweb/src/main/java/com/bweb/controller/HighGasStaffController.java index c1f58211..1f2778d1 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighGasStaffController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighGasStaffController.java @@ -1,28 +1,45 @@ package com.bweb.controller; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; +import com.bweb.config.SysConst; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import com.hai.common.Base64Util; +import com.hai.common.QRCodeGenerator; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; +import com.hai.common.security.AESEncodeUtil; import com.hai.common.security.UserCenter; +import com.hai.common.utils.DateUtil; +import com.hai.common.utils.IDGenerator; import com.hai.common.utils.ResponseMsgUtil; +import com.hai.config.CommonSysConst; import com.hai.entity.HighGasStaff; +import com.hai.entity.HighMerchantStore; import com.hai.enum_type.GasStaffStatus; import com.hai.model.ResponseData; import com.hai.model.UserInfoModel; import com.hai.service.CommonService; import com.hai.service.HighGasStaffService; +import com.hai.service.HighMerchantStoreService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.utils.URLEncodedUtils; +import org.bouncycastle.util.encoders.UrlBase64Encoder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import java.net.URLDecoder; +import java.net.URLEncoder; +import java.util.Base64; +import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -36,6 +53,9 @@ public class HighGasStaffController { @Resource private HighGasStaffService gasStaffService; + @Resource + private HighMerchantStoreService merchantStoreService; + @Resource private CommonService commonService; @@ -112,6 +132,54 @@ public class HighGasStaffController { } } + @RequestMapping(value="/queryQrCode",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "查询二维码") + public ResponseData queryQrCode(@RequestBody JSONObject body) { + try { + if (body.getLong("gasStaffId") == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + // 查询员工信息 + HighGasStaff gasStaff = gasStaffService.getStaffDetailById(body.getLong("gasStaffId")); + if (gasStaff == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到员工信息"); + } + + if (StringUtils.isBlank(gasStaff.getQrCodeImgUrl())) { + + // 查询加油站 + HighMerchantStore merchantStore = merchantStoreService.getDetailById(gasStaff.getMerchantStoreId()); + if (merchantStore == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到加油站信息"); + } + // 查询秘钥 + String key = commonService.getDictionaryCodeName("QR_CODE_SIGN_KEY", "1"); + if (StringUtils.isBlank(key)) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败"); + } + + // 员工ID签名 + String signId = AESEncodeUtil.base64Encode(AESEncodeUtil.aesEncryptToBytes(gasStaff.getId().toString(), key)); + + // 生成二维码 + String param = CommonSysConst.getSysConfig().getHsgDomainName()+"/hsgH5?accountId=000000&gasKey=" + merchantStore.getStoreKey() + "&staffCode=" + URLEncoder.encode(signId, "UTF-8"); + String qrCodeImgUrl = DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + IDGenerator.nextId(1) +".jpg"; + QRCodeGenerator.generateQRCodeImage(param, 350, 350, SysConst.getSysConfig().getFileUrl()+"/gasStaff/"+qrCodeImgUrl); + + gasStaff.setQrCodeImgUrl(qrCodeImgUrl); + gasStaffService.updateStaff(gasStaff); + } + + return ResponseMsgUtil.success(gasStaff.getQrCodeImgUrl()); + + } catch (Exception e) { + log.error("HighGasStaffController -> queryQrCode() error!",e); + return ResponseMsgUtil.exception(e); + } + } + @RequestMapping(value="/disabled",method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "禁用员工") diff --git a/hai-bweb/src/main/resources/dev/config.properties b/hai-bweb/src/main/resources/dev/config.properties index 25674f3d..da0992f7 100644 --- a/hai-bweb/src/main/resources/dev/config.properties +++ b/hai-bweb/src/main/resources/dev/config.properties @@ -1,5 +1,5 @@ -#fileUrl=/home/project/hsg/filesystem -fileUrl=/Volumes/work/code/filesystem/ +fileUrl=/home/project/hsg/filesystem +#fileUrl=/Volumes/work/code/filesystem/ cmsPath=/home/project/hsg/filesystem/cmsPath agentQrCode=/home/project/hsg/filesystem/agentQrCode agentQrCodeWxUrl=https://hsgcs.dctpay.com/wx/?action=ic&id= diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java index 6809c109..228d03d6 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java @@ -8,6 +8,7 @@ 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.AESEncodeUtil; import com.hai.common.security.SessionObject; import com.hai.common.security.UserCenter; import com.hai.common.utils.DateUtil; @@ -38,6 +39,7 @@ import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.math.MathContext; import java.math.RoundingMode; +import java.net.URLDecoder; import java.util.*; import java.util.stream.Collectors; @@ -94,6 +96,9 @@ public class HighOrderController { @Resource private HighGasDiscountOilPriceService gasDiscountOilPriceService; + @Resource + private HighGasStaffService gasStaffService; + @RequestMapping(value="/addOrder",method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "增加订单") @@ -241,6 +246,22 @@ public class HighOrderController { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已达到每日加油次数上限"); } + if (StringUtils.isNotBlank(highOrder.getGasStaffCode())) { + String qrCodeSignKey = commonService.getDictionaryCodeName("QR_CODE_SIGN_KEY", "柴油"); + if (StringUtils.isBlank(qrCodeSignKey)) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知秘钥"); + } + String staffId = AESEncodeUtil.aesDecryptByBytes(AESEncodeUtil.base64Decode(URLDecoder.decode(highOrder.getGasStaffCode(),"UTF-8")), qrCodeSignKey); + + // 查询员工 + HighGasStaff gasStaff = gasStaffService.getStaffDetailById(Long.parseLong(staffId)); + if (gasStaff == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知收银员"); + } + childOrder.setGasStaffId(gasStaff.getId()); + childOrder.setGasStaffName(gasStaff.getName()); + } + // 查询门店 HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreById(childOrder.getGoodsId()); if (store == null) { diff --git a/hai-service/src/main/java/com/hai/common/security/AESEncodeUtil.java b/hai-service/src/main/java/com/hai/common/security/AESEncodeUtil.java index 81c35c16..5f33aa77 100644 --- a/hai-service/src/main/java/com/hai/common/security/AESEncodeUtil.java +++ b/hai-service/src/main/java/com/hai/common/security/AESEncodeUtil.java @@ -7,6 +7,7 @@ import javax.crypto.Cipher; import javax.crypto.KeyGenerator; import javax.crypto.spec.SecretKeySpec; import java.math.BigInteger; +import java.net.URLDecoder; import java.security.SecureRandom; import java.util.Base64; @@ -63,6 +64,7 @@ public class AESEncodeUtil { public static void main(String[] args) throws Exception{ long currentTimeMillis = System.currentTimeMillis(); + System.out.println(URLDecoder.decode("Ble3spwlvhIa%2FArAa2cq0Q%3D%3D", "UTF-8")); System.out.println(AESEncodeUtil.aesDecrypt(Base64Util.decode("ZStZUjRIcFl5SVo4MEhzSU96MldDUEFZa3lmbUhpNTdKMGhCVytIY3NJaz0"))); /* String content = "{\"create_time\":1573544092110,\"order_serial_no\":\"40280e816db49c0b016db4a2c31f0004\",\"product_code\":\"8a9e80045cf85e54015cf8809fcd\",\"product_name\":\"平安发票贷\",\"uscc\":\"91370781687233838E\"}"; System.out.println("加密前" + content); diff --git a/hai-service/src/main/java/com/hai/dao/HighChildOrderMapper.java b/hai-service/src/main/java/com/hai/dao/HighChildOrderMapper.java index 01b0ad14..e252526a 100644 --- a/hai-service/src/main/java/com/hai/dao/HighChildOrderMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighChildOrderMapper.java @@ -54,7 +54,8 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt { "gas_price_vip, gas_price_official, ", "gas_oil_liters, gas_discount, ", "gas_oil_subsidy, gas_liters_preferences, ", - "gas_price_preferences, gas_salesman_id, ", + "gas_price_preferences, gas_staff_id, ", + "gas_staff_name, gas_salesman_id, ", "gas_salesman_name, gas_agent_id, ", "gas_agent_name, gas_org_id, ", "gas_org_name, ext_1, ", @@ -75,7 +76,8 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt { "#{gasPriceVip,jdbcType=DECIMAL}, #{gasPriceOfficial,jdbcType=DECIMAL}, ", "#{gasOilLiters,jdbcType=DECIMAL}, #{gasDiscount,jdbcType=DECIMAL}, ", "#{gasOilSubsidy,jdbcType=DECIMAL}, #{gasLitersPreferences,jdbcType=DECIMAL}, ", - "#{gasPricePreferences,jdbcType=DECIMAL}, #{gasSalesmanId,jdbcType=BIGINT}, ", + "#{gasPricePreferences,jdbcType=DECIMAL}, #{gasStaffId,jdbcType=BIGINT}, ", + "#{gasStaffName,jdbcType=VARCHAR}, #{gasSalesmanId,jdbcType=BIGINT}, ", "#{gasSalesmanName,jdbcType=VARCHAR}, #{gasAgentId,jdbcType=BIGINT}, ", "#{gasAgentName,jdbcType=VARCHAR}, #{gasOrgId,jdbcType=BIGINT}, ", "#{gasOrgName,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ", @@ -123,6 +125,8 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt { @Result(column="gas_oil_subsidy", property="gasOilSubsidy", jdbcType=JdbcType.DECIMAL), @Result(column="gas_liters_preferences", property="gasLitersPreferences", jdbcType=JdbcType.DECIMAL), @Result(column="gas_price_preferences", property="gasPricePreferences", jdbcType=JdbcType.DECIMAL), + @Result(column="gas_staff_id", property="gasStaffId", jdbcType=JdbcType.BIGINT), + @Result(column="gas_staff_name", property="gasStaffName", jdbcType=JdbcType.VARCHAR), @Result(column="gas_salesman_id", property="gasSalesmanId", jdbcType=JdbcType.BIGINT), @Result(column="gas_salesman_name", property="gasSalesmanName", jdbcType=JdbcType.VARCHAR), @Result(column="gas_agent_id", property="gasAgentId", jdbcType=JdbcType.BIGINT), @@ -145,8 +149,9 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt { "sale_count, total_price, giveaway_type, child_orde_status, praise_status, gas_oil_no, ", "gas_gun_no, gas_oil_type, gas_order_no, gas_price_platform, gas_price_gun, gas_price_vip, ", "gas_price_official, gas_oil_liters, gas_discount, gas_oil_subsidy, gas_liters_preferences, ", - "gas_price_preferences, gas_salesman_id, gas_salesman_name, gas_agent_id, gas_agent_name, ", - "gas_org_id, gas_org_name, ext_1, ext_2, ext_3, ext_4, ext_5, ext_6", + "gas_price_preferences, gas_staff_id, gas_staff_name, gas_salesman_id, gas_salesman_name, ", + "gas_agent_id, gas_agent_name, gas_org_id, gas_org_name, ext_1, ext_2, ext_3, ", + "ext_4, ext_5, ext_6", "from high_child_order", "where id = #{id,jdbcType=BIGINT}" }) @@ -183,6 +188,8 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt { @Result(column="gas_oil_subsidy", property="gasOilSubsidy", jdbcType=JdbcType.DECIMAL), @Result(column="gas_liters_preferences", property="gasLitersPreferences", jdbcType=JdbcType.DECIMAL), @Result(column="gas_price_preferences", property="gasPricePreferences", jdbcType=JdbcType.DECIMAL), + @Result(column="gas_staff_id", property="gasStaffId", jdbcType=JdbcType.BIGINT), + @Result(column="gas_staff_name", property="gasStaffName", jdbcType=JdbcType.VARCHAR), @Result(column="gas_salesman_id", property="gasSalesmanId", jdbcType=JdbcType.BIGINT), @Result(column="gas_salesman_name", property="gasSalesmanName", jdbcType=JdbcType.VARCHAR), @Result(column="gas_agent_id", property="gasAgentId", jdbcType=JdbcType.BIGINT), @@ -240,6 +247,8 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt { "gas_oil_subsidy = #{gasOilSubsidy,jdbcType=DECIMAL},", "gas_liters_preferences = #{gasLitersPreferences,jdbcType=DECIMAL},", "gas_price_preferences = #{gasPricePreferences,jdbcType=DECIMAL},", + "gas_staff_id = #{gasStaffId,jdbcType=BIGINT},", + "gas_staff_name = #{gasStaffName,jdbcType=VARCHAR},", "gas_salesman_id = #{gasSalesmanId,jdbcType=BIGINT},", "gas_salesman_name = #{gasSalesmanName,jdbcType=VARCHAR},", "gas_agent_id = #{gasAgentId,jdbcType=BIGINT},", diff --git a/hai-service/src/main/java/com/hai/dao/HighChildOrderSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighChildOrderSqlProvider.java index bde7e53c..80f9f769 100644 --- a/hai-service/src/main/java/com/hai/dao/HighChildOrderSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighChildOrderSqlProvider.java @@ -152,6 +152,14 @@ public class HighChildOrderSqlProvider { sql.VALUES("gas_price_preferences", "#{gasPricePreferences,jdbcType=DECIMAL}"); } + if (record.getGasStaffId() != null) { + sql.VALUES("gas_staff_id", "#{gasStaffId,jdbcType=BIGINT}"); + } + + if (record.getGasStaffName() != null) { + sql.VALUES("gas_staff_name", "#{gasStaffName,jdbcType=VARCHAR}"); + } + if (record.getGasSalesmanId() != null) { sql.VALUES("gas_salesman_id", "#{gasSalesmanId,jdbcType=BIGINT}"); } @@ -241,6 +249,8 @@ public class HighChildOrderSqlProvider { sql.SELECT("gas_oil_subsidy"); sql.SELECT("gas_liters_preferences"); sql.SELECT("gas_price_preferences"); + sql.SELECT("gas_staff_id"); + sql.SELECT("gas_staff_name"); sql.SELECT("gas_salesman_id"); sql.SELECT("gas_salesman_name"); sql.SELECT("gas_agent_id"); @@ -398,6 +408,14 @@ public class HighChildOrderSqlProvider { sql.SET("gas_price_preferences = #{record.gasPricePreferences,jdbcType=DECIMAL}"); } + if (record.getGasStaffId() != null) { + sql.SET("gas_staff_id = #{record.gasStaffId,jdbcType=BIGINT}"); + } + + if (record.getGasStaffName() != null) { + sql.SET("gas_staff_name = #{record.gasStaffName,jdbcType=VARCHAR}"); + } + if (record.getGasSalesmanId() != null) { sql.SET("gas_salesman_id = #{record.gasSalesmanId,jdbcType=BIGINT}"); } @@ -486,6 +504,8 @@ public class HighChildOrderSqlProvider { sql.SET("gas_oil_subsidy = #{record.gasOilSubsidy,jdbcType=DECIMAL}"); sql.SET("gas_liters_preferences = #{record.gasLitersPreferences,jdbcType=DECIMAL}"); sql.SET("gas_price_preferences = #{record.gasPricePreferences,jdbcType=DECIMAL}"); + sql.SET("gas_staff_id = #{record.gasStaffId,jdbcType=BIGINT}"); + sql.SET("gas_staff_name = #{record.gasStaffName,jdbcType=VARCHAR}"); sql.SET("gas_salesman_id = #{record.gasSalesmanId,jdbcType=BIGINT}"); sql.SET("gas_salesman_name = #{record.gasSalesmanName,jdbcType=VARCHAR}"); sql.SET("gas_agent_id = #{record.gasAgentId,jdbcType=BIGINT}"); @@ -632,6 +652,14 @@ public class HighChildOrderSqlProvider { sql.SET("gas_price_preferences = #{gasPricePreferences,jdbcType=DECIMAL}"); } + if (record.getGasStaffId() != null) { + sql.SET("gas_staff_id = #{gasStaffId,jdbcType=BIGINT}"); + } + + if (record.getGasStaffName() != null) { + sql.SET("gas_staff_name = #{gasStaffName,jdbcType=VARCHAR}"); + } + if (record.getGasSalesmanId() != null) { sql.SET("gas_salesman_id = #{gasSalesmanId,jdbcType=BIGINT}"); } diff --git a/hai-service/src/main/java/com/hai/dao/HighGasStaffMapper.java b/hai-service/src/main/java/com/hai/dao/HighGasStaffMapper.java index ef3c8780..eda69347 100644 --- a/hai-service/src/main/java/com/hai/dao/HighGasStaffMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighGasStaffMapper.java @@ -42,15 +42,15 @@ public interface HighGasStaffMapper extends HighGasStaffMapperExt { "insert into high_gas_staff (merchant_store_id, avatar, ", "`name`, telephone, ", "position_type, position_name, ", - "`status`, create_time, ", - "update_time, ext_1, ", - "ext_2, ext_3)", + "qr_code_img_url, `status`, ", + "create_time, update_time, ", + "ext_1, ext_2, ext_3)", "values (#{merchantStoreId,jdbcType=BIGINT}, #{avatar,jdbcType=VARCHAR}, ", "#{name,jdbcType=VARCHAR}, #{telephone,jdbcType=VARCHAR}, ", "#{positionType,jdbcType=INTEGER}, #{positionName,jdbcType=VARCHAR}, ", - "#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", - "#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", - "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + "#{qrCodeImgUrl,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", + "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(HighGasStaff record); @@ -68,6 +68,7 @@ public interface HighGasStaffMapper extends HighGasStaffMapperExt { @Result(column="telephone", property="telephone", jdbcType=JdbcType.VARCHAR), @Result(column="position_type", property="positionType", jdbcType=JdbcType.INTEGER), @Result(column="position_name", property="positionName", jdbcType=JdbcType.VARCHAR), + @Result(column="qr_code_img_url", property="qrCodeImgUrl", jdbcType=JdbcType.VARCHAR), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), @@ -80,7 +81,7 @@ public interface HighGasStaffMapper extends HighGasStaffMapperExt { @Select({ "select", "id, merchant_store_id, avatar, `name`, telephone, position_type, position_name, ", - "`status`, create_time, update_time, ext_1, ext_2, ext_3", + "qr_code_img_url, `status`, create_time, update_time, ext_1, ext_2, ext_3", "from high_gas_staff", "where id = #{id,jdbcType=BIGINT}" }) @@ -92,6 +93,7 @@ public interface HighGasStaffMapper extends HighGasStaffMapperExt { @Result(column="telephone", property="telephone", jdbcType=JdbcType.VARCHAR), @Result(column="position_type", property="positionType", jdbcType=JdbcType.INTEGER), @Result(column="position_name", property="positionName", jdbcType=JdbcType.VARCHAR), + @Result(column="qr_code_img_url", property="qrCodeImgUrl", jdbcType=JdbcType.VARCHAR), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), @@ -118,6 +120,7 @@ public interface HighGasStaffMapper extends HighGasStaffMapperExt { "telephone = #{telephone,jdbcType=VARCHAR},", "position_type = #{positionType,jdbcType=INTEGER},", "position_name = #{positionName,jdbcType=VARCHAR},", + "qr_code_img_url = #{qrCodeImgUrl,jdbcType=VARCHAR},", "`status` = #{status,jdbcType=INTEGER},", "create_time = #{createTime,jdbcType=TIMESTAMP},", "update_time = #{updateTime,jdbcType=TIMESTAMP},", diff --git a/hai-service/src/main/java/com/hai/dao/HighGasStaffSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighGasStaffSqlProvider.java index 620cccd1..d0f2fec5 100644 --- a/hai-service/src/main/java/com/hai/dao/HighGasStaffSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighGasStaffSqlProvider.java @@ -52,6 +52,10 @@ public class HighGasStaffSqlProvider { sql.VALUES("position_name", "#{positionName,jdbcType=VARCHAR}"); } + if (record.getQrCodeImgUrl() != null) { + sql.VALUES("qr_code_img_url", "#{qrCodeImgUrl,jdbcType=VARCHAR}"); + } + if (record.getStatus() != null) { sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); } @@ -92,6 +96,7 @@ public class HighGasStaffSqlProvider { sql.SELECT("telephone"); sql.SELECT("position_type"); sql.SELECT("position_name"); + sql.SELECT("qr_code_img_url"); sql.SELECT("`status`"); sql.SELECT("create_time"); sql.SELECT("update_time"); @@ -143,6 +148,10 @@ public class HighGasStaffSqlProvider { sql.SET("position_name = #{record.positionName,jdbcType=VARCHAR}"); } + if (record.getQrCodeImgUrl() != null) { + sql.SET("qr_code_img_url = #{record.qrCodeImgUrl,jdbcType=VARCHAR}"); + } + if (record.getStatus() != null) { sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); } @@ -182,6 +191,7 @@ public class HighGasStaffSqlProvider { sql.SET("telephone = #{record.telephone,jdbcType=VARCHAR}"); sql.SET("position_type = #{record.positionType,jdbcType=INTEGER}"); sql.SET("position_name = #{record.positionName,jdbcType=VARCHAR}"); + sql.SET("qr_code_img_url = #{record.qrCodeImgUrl,jdbcType=VARCHAR}"); sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); @@ -222,6 +232,10 @@ public class HighGasStaffSqlProvider { sql.SET("position_name = #{positionName,jdbcType=VARCHAR}"); } + if (record.getQrCodeImgUrl() != null) { + sql.SET("qr_code_img_url = #{qrCodeImgUrl,jdbcType=VARCHAR}"); + } + if (record.getStatus() != null) { sql.SET("`status` = #{status,jdbcType=INTEGER}"); } diff --git a/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java index 1b3c8122..f2c88454 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java @@ -1081,6 +1081,14 @@ public interface HighOrderMapperExt { " and to_days(pay_time) = to_days(now())"}) Map selectGasTheDayOrderCount(@Param("storeId") Long storeId, @Param("status") String status); + @Select({" select" + + " case when SUM(b.total_price) is null then 0 else SUM(b.total_price) end price," + + " count(1) count" + + " from high_child_order a,high_order b " + + " where a.order_id = b.id and goods_type = 3 and gas_staff_id = #{gasStaffId} and b.order_status in (${status}) " + + " and to_days(pay_time) = to_days(now())"}) + Map selectGasStaffTheDayOrderCount(@Param("gasStaffId") Long gasStaffId, @Param("status") String status); + @Select({" select" + " case when SUM(b.total_price) is null then 0 else SUM(b.total_price) end price," + " count(1) count" + @@ -1088,6 +1096,13 @@ public interface HighOrderMapperExt { " where a.order_id = b.id and goods_type = 3 and goods_id = #{storeId} and b.order_status in (${status}) "}) Map selectGasHistoryOrderCount(@Param("storeId") Long storeId, @Param("status") String status); + @Select({" select" + + " case when SUM(b.total_price) is null then 0 else SUM(b.total_price) end price," + + " count(1) count" + + " from high_child_order a,high_order b " + + " where a.order_id = b.id and goods_type = 3 and gas_staff_id = #{gasStaffId} and b.order_status in (${status}) "}) + Map selectGasStaffHistoryOrderCount(@Param("gasStaffId") Long gasStaffId, @Param("status") String status); + @Select({ "