diff --git a/bweb/src/main/java/com/bweb/config/AuthConfig.java b/bweb/src/main/java/com/bweb/config/AuthConfig.java index d25848d..cf14921 100644 --- a/bweb/src/main/java/com/bweb/config/AuthConfig.java +++ b/bweb/src/main/java/com/bweb/config/AuthConfig.java @@ -90,6 +90,8 @@ public class AuthConfig implements WebMvcConfigurer { .excludePathPatterns("/common/*") .excludePathPatterns("/secUser/login") .excludePathPatterns("/secUser/loginOut") + .excludePathPatterns("/agentMer/*") + .excludePathPatterns("/merchantPayConfig/editConfig") ; } diff --git a/bweb/src/main/java/com/bweb/controller/BsAgentMerController.java b/bweb/src/main/java/com/bweb/controller/BsAgentMerController.java index 3161a5e..055c511 100644 --- a/bweb/src/main/java/com/bweb/controller/BsAgentMerController.java +++ b/bweb/src/main/java/com/bweb/controller/BsAgentMerController.java @@ -176,10 +176,10 @@ public class BsAgentMerController { try { SecUserSessionObject userSession = userCenter.getSessionModel(SecUserSessionObject.class); Map param = new HashMap<>(); - param.put("provinceCode", provinceCode); + param.put("provinceCode", StringUtils.isNotBlank(provinceCode)?provinceCode:null); param.put("merSourceType", merSourceType); - param.put("merNo", merNo); - param.put("merName", merName); + param.put("merNo", StringUtils.isNotBlank(merNo)?merNo:null); + param.put("merName", StringUtils.isNotBlank(merName)?merName:null); if (userSession.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type1.getCode())) { param.put("agentId", agentId); diff --git a/bweb/src/main/java/com/bweb/controller/BsAgentPriceController.java b/bweb/src/main/java/com/bweb/controller/BsAgentPriceController.java new file mode 100644 index 0000000..18c7776 --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/BsAgentPriceController.java @@ -0,0 +1,284 @@ +package com.bweb.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.security.UserCenter; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.entity.BsAgentMer; +import com.hfkj.entity.BsAgentPrice; +import com.hfkj.entity.BsGasOilPrice; +import com.hfkj.entity.BsMerchant; +import com.hfkj.model.ResponseData; +import com.hfkj.model.SecUserSessionObject; +import com.hfkj.service.BsMerchantService; +import com.hfkj.service.agent.BsAgentMerService; +import com.hfkj.service.agent.BsAgentPriceService; +import com.hfkj.service.gas.BsGasOilPriceService; +import com.hfkj.sysenum.SecUserObjectTypeEnum; +import com.hfkj.sysenum.agent.AgentPriceTypeEnum; +import com.hfkj.sysenum.gas.GasOilNoEnum; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; +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.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @className: BsAgentPriceController + * @author: HuRui + * @date: 2024/6/19 + **/ +@Controller +@RequestMapping(value = "/agentPrice") +@Api(value = "代理商商户") +public class BsAgentPriceController { + + private static Logger log = LoggerFactory.getLogger(BsAgentPriceController.class); + + @Resource + private BsAgentPriceService agentPriceService; + @Resource + private BsAgentMerService agentMerService; + @Resource + private BsMerchantService merchantService; + @Resource + private BsGasOilPriceService gasOilPriceService; + @Resource + private UserCenter userCenter; + + @RequestMapping(value = "/editPrice", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "编辑价格") + public ResponseData editPrice(@RequestBody JSONArray bodyArray) { + try { + SecUserSessionObject userSession = userCenter.getSessionModel(SecUserSessionObject.class); + if (!userSession.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type1.getCode()) + && !userSession.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type4.getCode()) + && !userSession.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type5.getCode())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, ""); + } + + if (bodyArray == null || bodyArray.isEmpty()) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + Integer accountObjectType = userSession.getAccount().getObjectType(); + Integer type = null; + for (Object obj : bodyArray) { + JSONObject body = (JSONObject)JSONObject.toJSON(obj); + if (StringUtils.isBlank(body.getString("merNo")) + || StringUtils.isBlank(body.getString("oilNo")) + || body.getBigDecimal("priceRate") == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + // 查询商户 + BsMerchant merchant = merchantService.getMerchant(body.getString("merNo")); + if (merchant == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); + } + + BsAgentPrice agentPrice = null; + BsAgentMer agentMer = null; + if (accountObjectType.equals(SecUserObjectTypeEnum.type1.getCode())) { + type = AgentPriceTypeEnum.type1.getCode(); + agentPrice = agentPriceService.getDetail(AgentPriceTypeEnum.type1,body.getString("merNo"), body.getString("oilNo")); + + } else if (accountObjectType.equals(SecUserObjectTypeEnum.type4.getCode())) { + type = AgentPriceTypeEnum.type2.getCode(); + agentPrice = agentPriceService.getDetail(AgentPriceTypeEnum.type2,body.getString("merNo"), body.getString("oilNo")); + agentMer = agentMerService.getDetailByAgent(userSession.getAccount().getObjectId(), body.getString("merNo")); + + } else if (accountObjectType.equals(SecUserObjectTypeEnum.type5.getCode())) { + type = AgentPriceTypeEnum.type3.getCode(); + agentPrice = agentPriceService.getDetail(AgentPriceTypeEnum.type3,body.getString("merNo"), body.getString("oilNo")); + agentMer = agentMerService.getDetailByAgentStaff(userSession.getAccount().getObjectId(), body.getString("merNo")); + + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的角色"); + } + + // 查询油号 + GasOilNoEnum oilNo = GasOilNoEnum.getNameByType(body.getInteger("oilNo")); + if (oilNo == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的油号"); + } + + + // 查询油站 + if (agentPrice == null) { + agentPrice = new BsAgentPrice(); + agentPrice.setType(type); + agentPrice.setMerId(merchant.getId()); + agentPrice.setMerNo(merchant.getMerNo()); + agentPrice.setMerName(merchant.getMerName()); + agentPrice.setOilNo(oilNo.getCode().toString()); + agentPrice.setOilNoName(oilNo.getName()); + agentPrice.setAgentMerId(agentMer!=null?agentMer.getId():null); + agentPrice.setPriceRate(body.getBigDecimal("priceRate")); + } else { + agentPrice.setPriceRate(body.getBigDecimal("priceRate")); + } + agentPriceService.editData(agentPrice); + } + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("BsAgentPriceController --> editPrice() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/batchConfigPrice", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "批量配置价格") + public ResponseData batchConfigPrice(@RequestBody JSONObject body) { + try { + SecUserSessionObject userSession = userCenter.getSessionModel(SecUserSessionObject.class); + if (!userSession.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type1.getCode()) + && !userSession.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type4.getCode()) + && !userSession.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type5.getCode())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, ""); + } + + if (body.getJSONArray("merNoList") == null + || body.getInteger("oilNo") == null + || body.getBigDecimal("priceRate") == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + Integer accountObjectType = userSession.getAccount().getObjectType(); + Integer type = null; + for (Object obj : body.getJSONArray("merNoList")) { + JSONObject mer = (JSONObject) obj; + if (StringUtils.isBlank(mer.getString("merNo"))) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + // 查询商户 + BsMerchant merchant = merchantService.getMerchant(mer.getString("merNo")); + if (merchant == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); + } + + BsAgentPrice agentPrice = null; + BsAgentMer agentMer = null; + if (accountObjectType.equals(SecUserObjectTypeEnum.type1.getCode())) { + type = AgentPriceTypeEnum.type1.getCode(); + agentPrice = agentPriceService.getDetail(AgentPriceTypeEnum.type1,mer.getString("merNo"), body.getString("oilNo")); + + } else if (accountObjectType.equals(SecUserObjectTypeEnum.type4.getCode())) { + type = AgentPriceTypeEnum.type2.getCode(); + agentPrice = agentPriceService.getDetail(AgentPriceTypeEnum.type2,mer.getString("merNo"), body.getString("oilNo")); + agentMer = agentMerService.getDetailByAgent(userSession.getAccount().getObjectId(), body.getString("merNo")); + + } else if (accountObjectType.equals(SecUserObjectTypeEnum.type5.getCode())) { + type = AgentPriceTypeEnum.type3.getCode(); + agentPrice = agentPriceService.getDetail(AgentPriceTypeEnum.type3,mer.getString("merNo"), body.getString("oilNo")); + agentMer = agentMerService.getDetailByAgentStaff(userSession.getAccount().getObjectId(), body.getString("merNo")); + + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的角色"); + } + + // 查询油号 + GasOilNoEnum oilNo = GasOilNoEnum.getNameByType(body.getInteger("oilNo")); + if (oilNo == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的油号"); + } + + // 查询油站 + if (agentPrice == null) { + agentPrice = new BsAgentPrice(); + agentPrice.setType(type); + agentPrice.setMerId(merchant.getId()); + agentPrice.setMerNo(merchant.getMerNo()); + agentPrice.setMerName(merchant.getMerName()); + agentPrice.setOilNo(oilNo.getCode().toString()); + agentPrice.setOilNoName(oilNo.getName()); + agentPrice.setAgentMerId(agentMer!=null?agentMer.getId():null); + agentPrice.setPriceRate(body.getBigDecimal("priceRate")); + } else { + agentPrice.setPriceRate(body.getBigDecimal("priceRate")); + } + agentPriceService.editData(agentPrice); + } + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("BsAgentPriceController --> editPrice() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/getOilNoPrice", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "油站价格") + public ResponseData getOilNoPrice( @RequestParam(name = "merNo", required = true) String merNo) { + try { + SecUserSessionObject userSession = userCenter.getSessionModel(SecUserSessionObject.class); + if (!userSession.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type1.getCode()) + && !userSession.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type4.getCode()) + && !userSession.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type5.getCode())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, ""); + } + + Integer accountObjectType = userSession.getAccount().getObjectType(); + AgentPriceTypeEnum type = null; + if (accountObjectType.equals(SecUserObjectTypeEnum.type1.getCode())) { + type = AgentPriceTypeEnum.type1; + } else if (accountObjectType.equals(SecUserObjectTypeEnum.type4.getCode())) { + type = AgentPriceTypeEnum.type2; + } else if (accountObjectType.equals(SecUserObjectTypeEnum.type5.getCode())) { + type = AgentPriceTypeEnum.type3; + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的角色"); + } + + // 查询商户 + BsMerchant merchant = merchantService.getMerchant(merNo); + if (merchant == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); + } + + List> oilPriceMapList = new ArrayList<>(); + Map oilPriceMap; + + // 查询商户油品 + List oilPriceList = gasOilPriceService.getGasOilPriceList(merchant.getId()); + for (BsGasOilPrice price : oilPriceList) { + oilPriceMap = new HashMap<>(); + oilPriceMap.put("merId", merchant.getId()); + oilPriceMap.put("merNo", merchant.getMerNo()); + oilPriceMap.put("merName", merchant.getMerName()); + oilPriceMap.put("oilNo", price.getOilNo()); + oilPriceMap.put("oilNoName", price.getOilNoName()); + oilPriceMap.put("status", price.getStatus()); + // 价格 + BsAgentPrice priceRate = agentPriceService.getDetail(type, merchant.getMerNo(), price.getOilNo()); + if (priceRate == null) { + oilPriceMap.put("priceRate", 100L); + } else { + oilPriceMap.put("priceRate", priceRate.getPriceRate()); + } + oilPriceMapList.add(oilPriceMap); + } + return ResponseMsgUtil.success(oilPriceMapList); + + } catch (Exception e) { + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/bweb/src/main/java/com/bweb/controller/BsGasOrderController.java b/bweb/src/main/java/com/bweb/controller/BsGasOrderController.java index 96055a9..e28490f 100644 --- a/bweb/src/main/java/com/bweb/controller/BsGasOrderController.java +++ b/bweb/src/main/java/com/bweb/controller/BsGasOrderController.java @@ -57,6 +57,10 @@ public class BsGasOrderController { @RequestParam(name = "payTimeE", required = false) Long payTimeE, @RequestParam(name = "refundTimeS", required = false) Long refundTimeS, @RequestParam(name = "refundTimeE", required = false) Long refundTimeE, + @RequestParam(name = "gasClassGroupId", required = false) Long gasClassGroupId, + @RequestParam(name = "gasClassGroupTaskId", required = false) Long gasClassGroupTaskId, + @RequestParam(name = "agentId", required = false) Long agentId, + @RequestParam(name = "agentStaffId", required = false) Long agentStaffId, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize) { try { @@ -70,14 +74,23 @@ public class BsGasOrderController { param.put("payTimeE", payTimeE); param.put("refundTimeS", refundTimeS); param.put("refundTimeE", refundTimeE); + param.put("gasClassGroupId", gasClassGroupId); + param.put("gasClassGroupTaskId", gasClassGroupTaskId); if (sessionObject.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type1.getCode())) { param.put("merId", merId); param.put("merName", merName); + param.put("agentId", agentId); + param.put("agentStaffId", agentStaffId); } else if (sessionObject.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) { param.put("merId", sessionObject.getMerchant().getId()); } else if (sessionObject.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode())) { param.put("gasStaffId", sessionObject.getAccount().getObjectId()); + } else if (sessionObject.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type4.getCode())) { + param.put("agentId", sessionObject.getAccount().getObjectId()); + param.put("agentStaffId", agentStaffId); + } else if (sessionObject.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type5.getCode())) { + param.put("agentStaffId", sessionObject.getAccount().getObjectId()); } else { throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, ""); } diff --git a/bweb/src/main/java/com/bweb/controller/BsMerchantPayConfigController.java b/bweb/src/main/java/com/bweb/controller/BsMerchantPayConfigController.java index dbe580d..503d7e5 100644 --- a/bweb/src/main/java/com/bweb/controller/BsMerchantPayConfigController.java +++ b/bweb/src/main/java/com/bweb/controller/BsMerchantPayConfigController.java @@ -71,11 +71,14 @@ public class BsMerchantPayConfigController { for (Object obj : ledgerAccountArray) { JSONObject ledgerAccount = (JSONObject) obj; if (StringUtils.isBlank(ledgerAccount.getString("receiverMerNo")) + || StringUtils.isBlank(ledgerAccount.getString("receiverMerName")) || ledgerAccount.getBigDecimal("receiverRatio") == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } } config.setLedgerAccountData(body.getLedgerAccountData()); + } else { + config.setLedgerAccountData(null); } config.setMerId(merchant.getId()); config.setMerNo(merchant.getMerNo()); diff --git a/cweb/src/main/java/com/cweb/controller/BsGasController.java b/cweb/src/main/java/com/cweb/controller/BsGasController.java index fc1b342..a53ae30 100644 --- a/cweb/src/main/java/com/cweb/controller/BsGasController.java +++ b/cweb/src/main/java/com/cweb/controller/BsGasController.java @@ -2,9 +2,18 @@ package com.cweb.controller; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.entity.BsAgentPrice; +import com.hfkj.entity.BsGasOilPrice; +import com.hfkj.model.GasListModel; +import com.hfkj.model.GasModel; import com.hfkj.model.ResponseData; +import com.hfkj.service.agent.BsAgentPriceService; import com.hfkj.service.gas.BsGasService; +import com.hfkj.sysenum.agent.AgentPriceTypeEnum; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -23,18 +32,19 @@ public class BsGasController { @Resource private BsGasService gasService; - + @Resource + private BsAgentPriceService agentPriceService; @RequestMapping(value="/oilPriceCompute",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "油价计算") - public ResponseData oilPriceCompute(@RequestParam(name = "isTyAgent", required = false) Boolean isTyAgent, + public ResponseData oilPriceCompute(@RequestParam(name = "agentMerId", required = false) Long agentMerId, @RequestParam(name = "refuelPrice", required = true) BigDecimal refuelPrice, @RequestParam(name = "merNo", required = true) String merNo, @RequestParam(name = "oilNo", required = true) String oilNo) { try { - return ResponseMsgUtil.success(gasService.refuelPriceCompute(refuelPrice,merNo,oilNo,isTyAgent)); + return ResponseMsgUtil.success(gasService.refuelPriceCompute(refuelPrice,merNo,oilNo,agentMerId)); } catch (Exception e) { return ResponseMsgUtil.exception(e); @@ -44,7 +54,7 @@ public class BsGasController { @RequestMapping(value="/queryGasList",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询加油站列表") - public ResponseData queryGasList(@RequestParam(name = "isTyAgent", required = false) Boolean isTyAgent, + public ResponseData queryGasList(@RequestParam(name = "agentMerId", required = false) Long agentMerId, @RequestParam(name = "gasName", required = false) String gasName, @RequestParam(name = "distanceLimit", required = false) Integer distanceLimit, @RequestParam(name = "oilNo", required = true) String oilNo, @@ -56,7 +66,26 @@ public class BsGasController { try { PageHelper.startPage(pageNum,pageSize); - return ResponseMsgUtil.success(new PageInfo<>(gasService.getGasList(longitude,latitude,oilNo,gasName,distanceLimit))); + PageInfo pageInfo = new PageInfo<>(gasService.getGasList(longitude, latitude, oilNo, gasName, distanceLimit)); + + for (GasListModel gas : pageInfo.getList()) { + BigDecimal discount = new BigDecimal("100"); + if (agentMerId != null) { + // 查询代理价格 + BsAgentPrice agentPrice = agentPriceService.getDetail(agentMerId, gas.getOilNo()); + if (agentPrice != null) { + discount = agentPrice.getPriceRate(); + } + } else { + // 查询平台价格 + BsAgentPrice agentPrice = agentPriceService.getDetail(AgentPriceTypeEnum.type1, gas.getMerNo(), gas.getOilNo()); + if (agentPrice != null) { + discount = agentPrice.getPriceRate(); + } + } + gas.setPriceVip(gas.getPriceGun().multiply(discount.divide(new BigDecimal("100"))).setScale(2, BigDecimal.ROUND_HALF_UP)); + } + return ResponseMsgUtil.success(pageInfo); } catch (Exception e) { return ResponseMsgUtil.exception(e); @@ -67,10 +96,33 @@ public class BsGasController { @ResponseBody @ApiOperation(value = "查询加油站详情") public ResponseData queryGasDetail(@RequestParam(name = "merNo", required = true) String merNo, - @RequestParam(name = "isTyAgent", required = false) Boolean isTyAgent) { + @RequestParam(name = "agentMerId", required = false) Long agentMerId) { try { + // 查询油站详情 + GasModel gasDetail = gasService.getGasDetail(merNo); + if (gasDetail == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的油站"); + } + + for (BsGasOilPrice oilPrice : gasDetail.getGasOilPrice()) { + BigDecimal discount = new BigDecimal("100"); + if (agentMerId != null) { + // 查询代理价格 + BsAgentPrice agentPrice = agentPriceService.getDetail(agentMerId, oilPrice.getOilNo()); + if (agentPrice != null) { + discount = agentPrice.getPriceRate(); + } + } else { + // 查询平台价格 + BsAgentPrice agentPrice = agentPriceService.getDetail(AgentPriceTypeEnum.type1, merNo, oilPrice.getOilNo()); + if (agentPrice != null) { + discount = agentPrice.getPriceRate(); + } + } + oilPrice.setPriceVip(oilPrice.getPriceGun().multiply(discount.divide(new BigDecimal("100"))).setScale(2, BigDecimal.ROUND_HALF_UP)); + } - return ResponseMsgUtil.success(gasService.getGasDetail(merNo)); + return ResponseMsgUtil.success(gasDetail); } catch (Exception e) { return ResponseMsgUtil.exception(e); diff --git a/service/src/main/java/com/hfkj/dao/BsAgentMerMapperExt.java b/service/src/main/java/com/hfkj/dao/BsAgentMerMapperExt.java index 78fa13b..ed81b57 100644 --- a/service/src/main/java/com/hfkj/dao/BsAgentMerMapperExt.java +++ b/service/src/main/java/com/hfkj/dao/BsAgentMerMapperExt.java @@ -19,17 +19,17 @@ public interface BsAgentMerMapperExt { "insert into bs_agent_mer (agent_id, agent_name, ", "agent_staff_id, agent_staff_name, ", "mer_id, mer_no, mer_name, ", - "qr_code_img_url, `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 " + "", "#{item.agentId,jdbcType=BIGINT}, #{item.agentName,jdbcType=VARCHAR}, ", "#{item.agentStaffId,jdbcType=BIGINT}, #{item.agentStaffName,jdbcType=VARCHAR}, ", "#{item.merId,jdbcType=BIGINT}, #{item.merNo,jdbcType=VARCHAR}, #{item.merName,jdbcType=VARCHAR}, ", - "#{qrCodeImgUrl,jdbcType=VARCHAR},#{item.status,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP}, ", - "#{item.updateTime,jdbcType=TIMESTAMP}, #{item.ext1,jdbcType=VARCHAR}, ", - "#{item.ext2,jdbcType=VARCHAR}, #{item.ext3,jdbcType=VARCHAR}", + "#{item.qrCodeImgUrl,jdbcType=VARCHAR}, #{item.status,jdbcType=INTEGER}, ", + "#{item.createTime,jdbcType=TIMESTAMP}, #{item.updateTime,jdbcType=TIMESTAMP}, ", + "#{item.ext1,jdbcType=VARCHAR}, #{item.ext2,jdbcType=VARCHAR}, #{item.ext3,jdbcType=VARCHAR}", "", "" }) @@ -44,6 +44,7 @@ public interface BsAgentMerMapperExt { " a.merName," + " a.merAddress," + " a.agentName," + + " a.qrCodeImgUrl," + " a.createTime," + " GROUP_CONCAT(a.agentStaffName) agentStaff" + " FROM " + @@ -59,21 +60,22 @@ public interface BsAgentMerMapperExt { " b.agent_name agentName," + " b.agent_staff_id agentStaffId," + " b.agent_staff_name agentStaffName," + + " b.qr_code_img_url qrCodeImgUrl," + " b.create_time createTime" + " FROM" + " bs_merchant a" + - " LEFT JOIN bs_agent_mer b on b.mer_id = a.id" + + " LEFT JOIN bs_agent_mer b on b.mer_id = a.id and b.`status` ]]> 0" + " and b.agent_id = #{param.agentId} " + - " and b.agent_staff_id = #{param.agentStaffId} " + - " ) a where 1 = 1" + + " where 1 = 1" + + " and b.agent_staff_id is null and b.mer_id in (select mer_id from bs_agent_mer where agent_staff_id = #{param.agentStaffId} and `status` ]]> 0) " + + " and b.agent_staff_id is null and b.mer_id not in (select mer_id from bs_agent_mer where agent_staff_id = #{param.agentStaffId} and `status` ]]> 0) " + + ") a where 1 = 1" + " and a.provinceCode = #{param.provinceCode} " + " and a.merSourceType = #{param.merSourceType} " + " and a.merNo like concat('%',#{param.merNo},'%') " + " and a.merName like concat('%',#{param.merName},'%') " + " and a.agentId is not null " + " and a.agentId is null " + - " and a.agentStaffId is null " + - " and a.agentStaffId is null " + " GROUP BY a.merId " + " "}) List getAllotList(@Param("param") Map param); diff --git a/service/src/main/java/com/hfkj/dao/BsAgentPriceMapper.java b/service/src/main/java/com/hfkj/dao/BsAgentPriceMapper.java index fef67e1..aa96623 100644 --- a/service/src/main/java/com/hfkj/dao/BsAgentPriceMapper.java +++ b/service/src/main/java/com/hfkj/dao/BsAgentPriceMapper.java @@ -40,17 +40,19 @@ public interface BsAgentPriceMapper extends BsAgentPriceMapperExt { @Insert({ "insert into bs_agent_price (`type`, mer_id, ", - "mer_name, agent_mer_id, ", - "oil_no_name, oil_no, ", - "price_rate, `status`, ", - "create_time, update_time, ", - "ext_1, ext_2, ext_3)", + "mer_no, mer_name, ", + "agent_mer_id, oil_no_name, ", + "oil_no, price_rate, ", + "`status`, create_time, ", + "update_time, ext_1, ", + "ext_2, ext_3)", "values (#{type,jdbcType=INTEGER}, #{merId,jdbcType=BIGINT}, ", - "#{merName,jdbcType=VARCHAR}, #{agentMerId,jdbcType=BIGINT}, ", - "#{oilNoName,jdbcType=VARCHAR}, #{oilNo,jdbcType=VARCHAR}, ", - "#{priceRate,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER}, ", - "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", - "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + "#{merNo,jdbcType=VARCHAR}, #{merName,jdbcType=VARCHAR}, ", + "#{agentMerId,jdbcType=BIGINT}, #{oilNoName,jdbcType=VARCHAR}, ", + "#{oilNo,jdbcType=VARCHAR}, #{priceRate,jdbcType=DECIMAL}, ", + "#{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(BsAgentPrice record); @@ -64,6 +66,7 @@ public interface BsAgentPriceMapper extends BsAgentPriceMapperExt { @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), @Result(column="agent_mer_id", property="agentMerId", jdbcType=JdbcType.BIGINT), @Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR), @@ -80,7 +83,7 @@ public interface BsAgentPriceMapper extends BsAgentPriceMapperExt { @Select({ "select", - "id, `type`, mer_id, mer_name, agent_mer_id, oil_no_name, oil_no, price_rate, ", + "id, `type`, mer_id, mer_no, mer_name, agent_mer_id, oil_no_name, oil_no, price_rate, ", "`status`, create_time, update_time, ext_1, ext_2, ext_3", "from bs_agent_price", "where id = #{id,jdbcType=BIGINT}" @@ -89,6 +92,7 @@ public interface BsAgentPriceMapper extends BsAgentPriceMapperExt { @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), @Result(column="agent_mer_id", property="agentMerId", jdbcType=JdbcType.BIGINT), @Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR), @@ -116,6 +120,7 @@ public interface BsAgentPriceMapper extends BsAgentPriceMapperExt { "update bs_agent_price", "set `type` = #{type,jdbcType=INTEGER},", "mer_id = #{merId,jdbcType=BIGINT},", + "mer_no = #{merNo,jdbcType=VARCHAR},", "mer_name = #{merName,jdbcType=VARCHAR},", "agent_mer_id = #{agentMerId,jdbcType=BIGINT},", "oil_no_name = #{oilNoName,jdbcType=VARCHAR},", diff --git a/service/src/main/java/com/hfkj/dao/BsAgentPriceSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsAgentPriceSqlProvider.java index 9fd563f..5b3adfb 100644 --- a/service/src/main/java/com/hfkj/dao/BsAgentPriceSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/BsAgentPriceSqlProvider.java @@ -36,6 +36,10 @@ public class BsAgentPriceSqlProvider { sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}"); } + if (record.getMerNo() != null) { + sql.VALUES("mer_no", "#{merNo,jdbcType=VARCHAR}"); + } + if (record.getMerName() != null) { sql.VALUES("mer_name", "#{merName,jdbcType=VARCHAR}"); } @@ -92,6 +96,7 @@ public class BsAgentPriceSqlProvider { } sql.SELECT("`type`"); sql.SELECT("mer_id"); + sql.SELECT("mer_no"); sql.SELECT("mer_name"); sql.SELECT("agent_mer_id"); sql.SELECT("oil_no_name"); @@ -132,6 +137,10 @@ public class BsAgentPriceSqlProvider { sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); } + if (record.getMerNo() != null) { + sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); + } + if (record.getMerName() != null) { sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); } @@ -187,6 +196,7 @@ public class BsAgentPriceSqlProvider { sql.SET("id = #{record.id,jdbcType=BIGINT}"); sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); sql.SET("agent_mer_id = #{record.agentMerId,jdbcType=BIGINT}"); sql.SET("oil_no_name = #{record.oilNoName,jdbcType=VARCHAR}"); @@ -216,6 +226,10 @@ public class BsAgentPriceSqlProvider { sql.SET("mer_id = #{merId,jdbcType=BIGINT}"); } + if (record.getMerNo() != null) { + sql.SET("mer_no = #{merNo,jdbcType=VARCHAR}"); + } + if (record.getMerName() != null) { sql.SET("mer_name = #{merName,jdbcType=VARCHAR}"); } diff --git a/service/src/main/java/com/hfkj/dao/BsGasOrderMapper.java b/service/src/main/java/com/hfkj/dao/BsGasOrderMapper.java index e52ace6..631aed3 100644 --- a/service/src/main/java/com/hfkj/dao/BsGasOrderMapper.java +++ b/service/src/main/java/com/hfkj/dao/BsGasOrderMapper.java @@ -41,8 +41,9 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt { @Insert({ "insert into bs_gas_order (order_no, order_child_no, ", "channel_type, channel_order_no, ", - "user_id, user_phone, ", "agent_id, agent_name, ", + "agent_staff_id, agent_staff_name, ", + "user_id, user_phone, ", "mer_id, mer_no, mer_name, ", "mer_address, total_deduction_price, ", "deduction_coupon_price, deduction_oil_price, ", @@ -64,8 +65,9 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt { "ext_4, ext_5, ext_6)", "values (#{orderNo,jdbcType=VARCHAR}, #{orderChildNo,jdbcType=VARCHAR}, ", "#{channelType,jdbcType=INTEGER}, #{channelOrderNo,jdbcType=VARCHAR}, ", + "#{agentId,jdbcType=BIGINT}, #{agentName,jdbcType=VARCHAR}, ", + "#{agentStaffId,jdbcType=BIGINT}, #{agentStaffName,jdbcType=VARCHAR}, ", "#{userId,jdbcType=BIGINT}, #{userPhone,jdbcType=VARCHAR}, ", - "#{agentId,jdbcType=INTEGER}, #{agentName,jdbcType=VARCHAR}, ", "#{merId,jdbcType=BIGINT}, #{merNo,jdbcType=VARCHAR}, #{merName,jdbcType=VARCHAR}, ", "#{merAddress,jdbcType=VARCHAR}, #{totalDeductionPrice,jdbcType=DECIMAL}, ", "#{deductionCouponPrice,jdbcType=DECIMAL}, #{deductionOilPrice,jdbcType=DECIMAL}, ", @@ -100,10 +102,12 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt { @Result(column="order_child_no", property="orderChildNo", jdbcType=JdbcType.VARCHAR), @Result(column="channel_type", property="channelType", jdbcType=JdbcType.INTEGER), @Result(column="channel_order_no", property="channelOrderNo", jdbcType=JdbcType.VARCHAR), + @Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT), + @Result(column="agent_name", property="agentName", jdbcType=JdbcType.VARCHAR), + @Result(column="agent_staff_id", property="agentStaffId", jdbcType=JdbcType.BIGINT), + @Result(column="agent_staff_name", property="agentStaffName", jdbcType=JdbcType.VARCHAR), @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), @Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR), - @Result(column="agent_id", property="agentId", jdbcType=JdbcType.INTEGER), - @Result(column="agent_name", property="agentName", jdbcType=JdbcType.VARCHAR), @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), @@ -150,15 +154,15 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt { @Select({ "select", - "id, order_no, order_child_no, channel_type, channel_order_no, user_id, user_phone, ", - "agent_id, agent_name, mer_id, mer_no, mer_name, mer_address, total_deduction_price, ", - "deduction_coupon_price, deduction_oil_price, pay_integral, payable_price, actual_pay_price, ", - "gas_refuel_price, gas_oil_no, gas_gun_no, gas_oil_type, gas_price_official, ", - "gas_price_gun, gas_price_vip, gas_price_platform, 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, ", - "pay_type, `status`, create_time, cancel_time, pay_time, refund_time, refund_remarks, ", - "ext_1, ext_2, ext_3, ext_4, ext_5, ext_6", + "id, order_no, order_child_no, channel_type, channel_order_no, agent_id, agent_name, ", + "agent_staff_id, agent_staff_name, user_id, user_phone, mer_id, mer_no, mer_name, ", + "mer_address, total_deduction_price, deduction_coupon_price, deduction_oil_price, ", + "pay_integral, payable_price, actual_pay_price, gas_refuel_price, gas_oil_no, ", + "gas_gun_no, gas_oil_type, gas_price_official, gas_price_gun, gas_price_vip, ", + "gas_price_platform, 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, pay_type, `status`, create_time, cancel_time, ", + "pay_time, refund_time, refund_remarks, ext_1, ext_2, ext_3, ext_4, ext_5, ext_6", "from bs_gas_order", "where id = #{id,jdbcType=BIGINT}" }) @@ -168,10 +172,12 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt { @Result(column="order_child_no", property="orderChildNo", jdbcType=JdbcType.VARCHAR), @Result(column="channel_type", property="channelType", jdbcType=JdbcType.INTEGER), @Result(column="channel_order_no", property="channelOrderNo", jdbcType=JdbcType.VARCHAR), + @Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT), + @Result(column="agent_name", property="agentName", jdbcType=JdbcType.VARCHAR), + @Result(column="agent_staff_id", property="agentStaffId", jdbcType=JdbcType.BIGINT), + @Result(column="agent_staff_name", property="agentStaffName", jdbcType=JdbcType.VARCHAR), @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), @Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR), - @Result(column="agent_id", property="agentId", jdbcType=JdbcType.INTEGER), - @Result(column="agent_name", property="agentName", jdbcType=JdbcType.VARCHAR), @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), @@ -231,10 +237,12 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt { "order_child_no = #{orderChildNo,jdbcType=VARCHAR},", "channel_type = #{channelType,jdbcType=INTEGER},", "channel_order_no = #{channelOrderNo,jdbcType=VARCHAR},", + "agent_id = #{agentId,jdbcType=BIGINT},", + "agent_name = #{agentName,jdbcType=VARCHAR},", + "agent_staff_id = #{agentStaffId,jdbcType=BIGINT},", + "agent_staff_name = #{agentStaffName,jdbcType=VARCHAR},", "user_id = #{userId,jdbcType=BIGINT},", "user_phone = #{userPhone,jdbcType=VARCHAR},", - "agent_id = #{agentId,jdbcType=INTEGER},", - "agent_name = #{agentName,jdbcType=VARCHAR},", "mer_id = #{merId,jdbcType=BIGINT},", "mer_no = #{merNo,jdbcType=VARCHAR},", "mer_name = #{merName,jdbcType=VARCHAR},", diff --git a/service/src/main/java/com/hfkj/dao/BsGasOrderSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsGasOrderSqlProvider.java index 53ce878..41b6d19 100644 --- a/service/src/main/java/com/hfkj/dao/BsGasOrderSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/BsGasOrderSqlProvider.java @@ -44,20 +44,28 @@ public class BsGasOrderSqlProvider { sql.VALUES("channel_order_no", "#{channelOrderNo,jdbcType=VARCHAR}"); } - if (record.getUserId() != null) { - sql.VALUES("user_id", "#{userId,jdbcType=BIGINT}"); + if (record.getAgentId() != null) { + sql.VALUES("agent_id", "#{agentId,jdbcType=BIGINT}"); } - if (record.getUserPhone() != null) { - sql.VALUES("user_phone", "#{userPhone,jdbcType=VARCHAR}"); + if (record.getAgentName() != null) { + sql.VALUES("agent_name", "#{agentName,jdbcType=VARCHAR}"); } - if (record.getAgentId() != null) { - sql.VALUES("agent_id", "#{agentId,jdbcType=INTEGER}"); + if (record.getAgentStaffId() != null) { + sql.VALUES("agent_staff_id", "#{agentStaffId,jdbcType=BIGINT}"); } - if (record.getAgentName() != null) { - sql.VALUES("agent_name", "#{agentName,jdbcType=VARCHAR}"); + if (record.getAgentStaffName() != null) { + sql.VALUES("agent_staff_name", "#{agentStaffName,jdbcType=VARCHAR}"); + } + + if (record.getUserId() != null) { + sql.VALUES("user_id", "#{userId,jdbcType=BIGINT}"); + } + + if (record.getUserPhone() != null) { + sql.VALUES("user_phone", "#{userPhone,jdbcType=VARCHAR}"); } if (record.getMerId() != null) { @@ -238,10 +246,12 @@ public class BsGasOrderSqlProvider { sql.SELECT("order_child_no"); sql.SELECT("channel_type"); sql.SELECT("channel_order_no"); - sql.SELECT("user_id"); - sql.SELECT("user_phone"); sql.SELECT("agent_id"); sql.SELECT("agent_name"); + sql.SELECT("agent_staff_id"); + sql.SELECT("agent_staff_name"); + sql.SELECT("user_id"); + sql.SELECT("user_phone"); sql.SELECT("mer_id"); sql.SELECT("mer_no"); sql.SELECT("mer_name"); @@ -320,20 +330,28 @@ public class BsGasOrderSqlProvider { sql.SET("channel_order_no = #{record.channelOrderNo,jdbcType=VARCHAR}"); } - if (record.getUserId() != null) { - sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); + if (record.getAgentId() != null) { + sql.SET("agent_id = #{record.agentId,jdbcType=BIGINT}"); } - if (record.getUserPhone() != null) { - sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}"); + if (record.getAgentName() != null) { + sql.SET("agent_name = #{record.agentName,jdbcType=VARCHAR}"); } - if (record.getAgentId() != null) { - sql.SET("agent_id = #{record.agentId,jdbcType=INTEGER}"); + if (record.getAgentStaffId() != null) { + sql.SET("agent_staff_id = #{record.agentStaffId,jdbcType=BIGINT}"); } - if (record.getAgentName() != null) { - sql.SET("agent_name = #{record.agentName,jdbcType=VARCHAR}"); + if (record.getAgentStaffName() != null) { + sql.SET("agent_staff_name = #{record.agentStaffName,jdbcType=VARCHAR}"); + } + + if (record.getUserId() != null) { + sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); + } + + if (record.getUserPhone() != null) { + sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}"); } if (record.getMerId() != null) { @@ -513,10 +531,12 @@ public class BsGasOrderSqlProvider { sql.SET("order_child_no = #{record.orderChildNo,jdbcType=VARCHAR}"); sql.SET("channel_type = #{record.channelType,jdbcType=INTEGER}"); sql.SET("channel_order_no = #{record.channelOrderNo,jdbcType=VARCHAR}"); + sql.SET("agent_id = #{record.agentId,jdbcType=BIGINT}"); + sql.SET("agent_name = #{record.agentName,jdbcType=VARCHAR}"); + sql.SET("agent_staff_id = #{record.agentStaffId,jdbcType=BIGINT}"); + sql.SET("agent_staff_name = #{record.agentStaffName,jdbcType=VARCHAR}"); sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}"); - sql.SET("agent_id = #{record.agentId,jdbcType=INTEGER}"); - sql.SET("agent_name = #{record.agentName,jdbcType=VARCHAR}"); sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); @@ -584,20 +604,28 @@ public class BsGasOrderSqlProvider { sql.SET("channel_order_no = #{channelOrderNo,jdbcType=VARCHAR}"); } - if (record.getUserId() != null) { - sql.SET("user_id = #{userId,jdbcType=BIGINT}"); + if (record.getAgentId() != null) { + sql.SET("agent_id = #{agentId,jdbcType=BIGINT}"); } - if (record.getUserPhone() != null) { - sql.SET("user_phone = #{userPhone,jdbcType=VARCHAR}"); + if (record.getAgentName() != null) { + sql.SET("agent_name = #{agentName,jdbcType=VARCHAR}"); } - if (record.getAgentId() != null) { - sql.SET("agent_id = #{agentId,jdbcType=INTEGER}"); + if (record.getAgentStaffId() != null) { + sql.SET("agent_staff_id = #{agentStaffId,jdbcType=BIGINT}"); } - if (record.getAgentName() != null) { - sql.SET("agent_name = #{agentName,jdbcType=VARCHAR}"); + if (record.getAgentStaffName() != null) { + sql.SET("agent_staff_name = #{agentStaffName,jdbcType=VARCHAR}"); + } + + if (record.getUserId() != null) { + sql.SET("user_id = #{userId,jdbcType=BIGINT}"); + } + + if (record.getUserPhone() != null) { + sql.SET("user_phone = #{userPhone,jdbcType=VARCHAR}"); } if (record.getMerId() != null) { diff --git a/service/src/main/java/com/hfkj/entity/BsAgentPrice.java b/service/src/main/java/com/hfkj/entity/BsAgentPrice.java index a24589e..d28482f 100644 --- a/service/src/main/java/com/hfkj/entity/BsAgentPrice.java +++ b/service/src/main/java/com/hfkj/entity/BsAgentPrice.java @@ -17,7 +17,7 @@ public class BsAgentPrice implements Serializable { private Long id; /** - * 类型 1:平台 2:代理商 + * 类型 1:平台 2:代理商 3:业务员 */ private Integer type; @@ -26,6 +26,11 @@ public class BsAgentPrice implements Serializable { */ private Long merId; + /** + * 加油站商户号 + */ + private String merNo; + /** * 加油站名称 */ @@ -98,6 +103,14 @@ public class BsAgentPrice implements Serializable { this.merId = merId; } + public String getMerNo() { + return merNo; + } + + public void setMerNo(String merNo) { + this.merNo = merNo; + } + public String getMerName() { return merName; } @@ -201,6 +214,7 @@ public class BsAgentPrice implements Serializable { return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) && (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId())) + && (this.getMerNo() == null ? other.getMerNo() == null : this.getMerNo().equals(other.getMerNo())) && (this.getMerName() == null ? other.getMerName() == null : this.getMerName().equals(other.getMerName())) && (this.getAgentMerId() == null ? other.getAgentMerId() == null : this.getAgentMerId().equals(other.getAgentMerId())) && (this.getOilNoName() == null ? other.getOilNoName() == null : this.getOilNoName().equals(other.getOilNoName())) @@ -221,6 +235,7 @@ public class BsAgentPrice implements Serializable { result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); result = prime * result + ((getMerId() == null) ? 0 : getMerId().hashCode()); + result = prime * result + ((getMerNo() == null) ? 0 : getMerNo().hashCode()); result = prime * result + ((getMerName() == null) ? 0 : getMerName().hashCode()); result = prime * result + ((getAgentMerId() == null) ? 0 : getAgentMerId().hashCode()); result = prime * result + ((getOilNoName() == null) ? 0 : getOilNoName().hashCode()); @@ -244,6 +259,7 @@ public class BsAgentPrice implements Serializable { sb.append(", id=").append(id); sb.append(", type=").append(type); sb.append(", merId=").append(merId); + sb.append(", merNo=").append(merNo); sb.append(", merName=").append(merName); sb.append(", agentMerId=").append(agentMerId); sb.append(", oilNoName=").append(oilNoName); diff --git a/service/src/main/java/com/hfkj/entity/BsAgentPriceExample.java b/service/src/main/java/com/hfkj/entity/BsAgentPriceExample.java index 0a6ae36..3bb5667 100644 --- a/service/src/main/java/com/hfkj/entity/BsAgentPriceExample.java +++ b/service/src/main/java/com/hfkj/entity/BsAgentPriceExample.java @@ -306,6 +306,76 @@ public class BsAgentPriceExample { return (Criteria) this; } + public Criteria andMerNoIsNull() { + addCriterion("mer_no is null"); + return (Criteria) this; + } + + public Criteria andMerNoIsNotNull() { + addCriterion("mer_no is not null"); + return (Criteria) this; + } + + public Criteria andMerNoEqualTo(String value) { + addCriterion("mer_no =", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotEqualTo(String value) { + addCriterion("mer_no <>", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoGreaterThan(String value) { + addCriterion("mer_no >", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoGreaterThanOrEqualTo(String value) { + addCriterion("mer_no >=", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLessThan(String value) { + addCriterion("mer_no <", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLessThanOrEqualTo(String value) { + addCriterion("mer_no <=", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLike(String value) { + addCriterion("mer_no like", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotLike(String value) { + addCriterion("mer_no not like", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoIn(List values) { + addCriterion("mer_no in", values, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotIn(List values) { + addCriterion("mer_no not in", values, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoBetween(String value1, String value2) { + addCriterion("mer_no between", value1, value2, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotBetween(String value1, String value2) { + addCriterion("mer_no not between", value1, value2, "merNo"); + return (Criteria) this; + } + public Criteria andMerNameIsNull() { addCriterion("mer_name is null"); return (Criteria) this; diff --git a/service/src/main/java/com/hfkj/entity/BsGasOrder.java b/service/src/main/java/com/hfkj/entity/BsGasOrder.java index 14d60df..f0c9da0 100644 --- a/service/src/main/java/com/hfkj/entity/BsGasOrder.java +++ b/service/src/main/java/com/hfkj/entity/BsGasOrder.java @@ -40,24 +40,34 @@ public class BsGasOrder implements Serializable { private String channelOrderNo; /** - * 用户id + * 代理商id */ - private Long userId; + private Long agentId; /** - * 用户手机号 + * 代理商名称 */ - private String userPhone; + private String agentName; /** - * 代理商id + * 业务员id */ - private Integer agentId; + private Long agentStaffId; /** - * 代理商名称 + * 业务员名称 */ - private String agentName; + private String agentStaffName; + + /** + * 用户id + */ + private Long userId; + + /** + * 用户手机号 + */ + private String userPhone; /** * 商户id @@ -80,7 +90,7 @@ public class BsGasOrder implements Serializable { private String merAddress; /** - * 交易总优惠金额(优惠券优惠金额+加油优惠金额+积分抵扣) + * 交易总优惠金额(优惠券优惠金额+加油优惠金额) */ private BigDecimal totalDeductionPrice; @@ -294,36 +304,52 @@ public class BsGasOrder implements Serializable { this.channelOrderNo = channelOrderNo; } - public Long getUserId() { - return userId; + public Long getAgentId() { + return agentId; } - public void setUserId(Long userId) { - this.userId = userId; + public void setAgentId(Long agentId) { + this.agentId = agentId; } - public String getUserPhone() { - return userPhone; + public String getAgentName() { + return agentName; } - public void setUserPhone(String userPhone) { - this.userPhone = userPhone; + public void setAgentName(String agentName) { + this.agentName = agentName; } - public Integer getAgentId() { - return agentId; + public Long getAgentStaffId() { + return agentStaffId; } - public void setAgentId(Integer agentId) { - this.agentId = agentId; + public void setAgentStaffId(Long agentStaffId) { + this.agentStaffId = agentStaffId; } - public String getAgentName() { - return agentName; + public String getAgentStaffName() { + return agentStaffName; } - public void setAgentName(String agentName) { - this.agentName = agentName; + public void setAgentStaffName(String agentStaffName) { + this.agentStaffName = agentStaffName; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getUserPhone() { + return userPhone; + } + + public void setUserPhone(String userPhone) { + this.userPhone = userPhone; } public Long getMerId() { @@ -671,10 +697,12 @@ public class BsGasOrder implements Serializable { && (this.getOrderChildNo() == null ? other.getOrderChildNo() == null : this.getOrderChildNo().equals(other.getOrderChildNo())) && (this.getChannelType() == null ? other.getChannelType() == null : this.getChannelType().equals(other.getChannelType())) && (this.getChannelOrderNo() == null ? other.getChannelOrderNo() == null : this.getChannelOrderNo().equals(other.getChannelOrderNo())) - && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId())) - && (this.getUserPhone() == null ? other.getUserPhone() == null : this.getUserPhone().equals(other.getUserPhone())) && (this.getAgentId() == null ? other.getAgentId() == null : this.getAgentId().equals(other.getAgentId())) && (this.getAgentName() == null ? other.getAgentName() == null : this.getAgentName().equals(other.getAgentName())) + && (this.getAgentStaffId() == null ? other.getAgentStaffId() == null : this.getAgentStaffId().equals(other.getAgentStaffId())) + && (this.getAgentStaffName() == null ? other.getAgentStaffName() == null : this.getAgentStaffName().equals(other.getAgentStaffName())) + && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId())) + && (this.getUserPhone() == null ? other.getUserPhone() == null : this.getUserPhone().equals(other.getUserPhone())) && (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId())) && (this.getMerNo() == null ? other.getMerNo() == null : this.getMerNo().equals(other.getMerNo())) && (this.getMerName() == null ? other.getMerName() == null : this.getMerName().equals(other.getMerName())) @@ -727,10 +755,12 @@ public class BsGasOrder implements Serializable { result = prime * result + ((getOrderChildNo() == null) ? 0 : getOrderChildNo().hashCode()); result = prime * result + ((getChannelType() == null) ? 0 : getChannelType().hashCode()); result = prime * result + ((getChannelOrderNo() == null) ? 0 : getChannelOrderNo().hashCode()); - result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode()); - result = prime * result + ((getUserPhone() == null) ? 0 : getUserPhone().hashCode()); result = prime * result + ((getAgentId() == null) ? 0 : getAgentId().hashCode()); result = prime * result + ((getAgentName() == null) ? 0 : getAgentName().hashCode()); + result = prime * result + ((getAgentStaffId() == null) ? 0 : getAgentStaffId().hashCode()); + result = prime * result + ((getAgentStaffName() == null) ? 0 : getAgentStaffName().hashCode()); + result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode()); + result = prime * result + ((getUserPhone() == null) ? 0 : getUserPhone().hashCode()); result = prime * result + ((getMerId() == null) ? 0 : getMerId().hashCode()); result = prime * result + ((getMerNo() == null) ? 0 : getMerNo().hashCode()); result = prime * result + ((getMerName() == null) ? 0 : getMerName().hashCode()); @@ -786,10 +816,12 @@ public class BsGasOrder implements Serializable { sb.append(", orderChildNo=").append(orderChildNo); sb.append(", channelType=").append(channelType); sb.append(", channelOrderNo=").append(channelOrderNo); - sb.append(", userId=").append(userId); - sb.append(", userPhone=").append(userPhone); sb.append(", agentId=").append(agentId); sb.append(", agentName=").append(agentName); + sb.append(", agentStaffId=").append(agentStaffId); + sb.append(", agentStaffName=").append(agentStaffName); + sb.append(", userId=").append(userId); + sb.append(", userPhone=").append(userPhone); sb.append(", merId=").append(merId); sb.append(", merNo=").append(merNo); sb.append(", merName=").append(merName); diff --git a/service/src/main/java/com/hfkj/entity/BsGasOrderExample.java b/service/src/main/java/com/hfkj/entity/BsGasOrderExample.java index 902ab72..82e54b9 100644 --- a/service/src/main/java/com/hfkj/entity/BsGasOrderExample.java +++ b/service/src/main/java/com/hfkj/entity/BsGasOrderExample.java @@ -456,263 +456,393 @@ public class BsGasOrderExample { return (Criteria) this; } - public Criteria andUserIdIsNull() { - addCriterion("user_id is null"); + public Criteria andAgentIdIsNull() { + addCriterion("agent_id is null"); return (Criteria) this; } - public Criteria andUserIdIsNotNull() { - addCriterion("user_id is not null"); + public Criteria andAgentIdIsNotNull() { + addCriterion("agent_id is not null"); return (Criteria) this; } - public Criteria andUserIdEqualTo(Long value) { - addCriterion("user_id =", value, "userId"); + public Criteria andAgentIdEqualTo(Long value) { + addCriterion("agent_id =", value, "agentId"); return (Criteria) this; } - public Criteria andUserIdNotEqualTo(Long value) { - addCriterion("user_id <>", value, "userId"); + public Criteria andAgentIdNotEqualTo(Long value) { + addCriterion("agent_id <>", value, "agentId"); return (Criteria) this; } - public Criteria andUserIdGreaterThan(Long value) { - addCriterion("user_id >", value, "userId"); + public Criteria andAgentIdGreaterThan(Long value) { + addCriterion("agent_id >", value, "agentId"); return (Criteria) this; } - public Criteria andUserIdGreaterThanOrEqualTo(Long value) { - addCriterion("user_id >=", value, "userId"); + public Criteria andAgentIdGreaterThanOrEqualTo(Long value) { + addCriterion("agent_id >=", value, "agentId"); return (Criteria) this; } - public Criteria andUserIdLessThan(Long value) { - addCriterion("user_id <", value, "userId"); + public Criteria andAgentIdLessThan(Long value) { + addCriterion("agent_id <", value, "agentId"); return (Criteria) this; } - public Criteria andUserIdLessThanOrEqualTo(Long value) { - addCriterion("user_id <=", value, "userId"); + public Criteria andAgentIdLessThanOrEqualTo(Long value) { + addCriterion("agent_id <=", value, "agentId"); return (Criteria) this; } - public Criteria andUserIdIn(List values) { - addCriterion("user_id in", values, "userId"); + public Criteria andAgentIdIn(List values) { + addCriterion("agent_id in", values, "agentId"); return (Criteria) this; } - public Criteria andUserIdNotIn(List values) { - addCriterion("user_id not in", values, "userId"); + public Criteria andAgentIdNotIn(List values) { + addCriterion("agent_id not in", values, "agentId"); return (Criteria) this; } - public Criteria andUserIdBetween(Long value1, Long value2) { - addCriterion("user_id between", value1, value2, "userId"); + public Criteria andAgentIdBetween(Long value1, Long value2) { + addCriterion("agent_id between", value1, value2, "agentId"); return (Criteria) this; } - public Criteria andUserIdNotBetween(Long value1, Long value2) { - addCriterion("user_id not between", value1, value2, "userId"); + public Criteria andAgentIdNotBetween(Long value1, Long value2) { + addCriterion("agent_id not between", value1, value2, "agentId"); return (Criteria) this; } - public Criteria andUserPhoneIsNull() { - addCriterion("user_phone is null"); + public Criteria andAgentNameIsNull() { + addCriterion("agent_name is null"); return (Criteria) this; } - public Criteria andUserPhoneIsNotNull() { - addCriterion("user_phone is not null"); + public Criteria andAgentNameIsNotNull() { + addCriterion("agent_name is not null"); return (Criteria) this; } - public Criteria andUserPhoneEqualTo(String value) { - addCriterion("user_phone =", value, "userPhone"); + public Criteria andAgentNameEqualTo(String value) { + addCriterion("agent_name =", value, "agentName"); return (Criteria) this; } - public Criteria andUserPhoneNotEqualTo(String value) { - addCriterion("user_phone <>", value, "userPhone"); + public Criteria andAgentNameNotEqualTo(String value) { + addCriterion("agent_name <>", value, "agentName"); return (Criteria) this; } - public Criteria andUserPhoneGreaterThan(String value) { - addCriterion("user_phone >", value, "userPhone"); + public Criteria andAgentNameGreaterThan(String value) { + addCriterion("agent_name >", value, "agentName"); return (Criteria) this; } - public Criteria andUserPhoneGreaterThanOrEqualTo(String value) { - addCriterion("user_phone >=", value, "userPhone"); + public Criteria andAgentNameGreaterThanOrEqualTo(String value) { + addCriterion("agent_name >=", value, "agentName"); return (Criteria) this; } - public Criteria andUserPhoneLessThan(String value) { - addCriterion("user_phone <", value, "userPhone"); + public Criteria andAgentNameLessThan(String value) { + addCriterion("agent_name <", value, "agentName"); return (Criteria) this; } - public Criteria andUserPhoneLessThanOrEqualTo(String value) { - addCriterion("user_phone <=", value, "userPhone"); + public Criteria andAgentNameLessThanOrEqualTo(String value) { + addCriterion("agent_name <=", value, "agentName"); return (Criteria) this; } - public Criteria andUserPhoneLike(String value) { - addCriterion("user_phone like", value, "userPhone"); + public Criteria andAgentNameLike(String value) { + addCriterion("agent_name like", value, "agentName"); return (Criteria) this; } - public Criteria andUserPhoneNotLike(String value) { - addCriterion("user_phone not like", value, "userPhone"); + public Criteria andAgentNameNotLike(String value) { + addCriterion("agent_name not like", value, "agentName"); return (Criteria) this; } - public Criteria andUserPhoneIn(List values) { - addCriterion("user_phone in", values, "userPhone"); + public Criteria andAgentNameIn(List values) { + addCriterion("agent_name in", values, "agentName"); return (Criteria) this; } - public Criteria andUserPhoneNotIn(List values) { - addCriterion("user_phone not in", values, "userPhone"); + public Criteria andAgentNameNotIn(List values) { + addCriterion("agent_name not in", values, "agentName"); return (Criteria) this; } - public Criteria andUserPhoneBetween(String value1, String value2) { - addCriterion("user_phone between", value1, value2, "userPhone"); + public Criteria andAgentNameBetween(String value1, String value2) { + addCriterion("agent_name between", value1, value2, "agentName"); return (Criteria) this; } - public Criteria andUserPhoneNotBetween(String value1, String value2) { - addCriterion("user_phone not between", value1, value2, "userPhone"); + public Criteria andAgentNameNotBetween(String value1, String value2) { + addCriterion("agent_name not between", value1, value2, "agentName"); return (Criteria) this; } - public Criteria andAgentIdIsNull() { - addCriterion("agent_id is null"); + public Criteria andAgentStaffIdIsNull() { + addCriterion("agent_staff_id is null"); return (Criteria) this; } - public Criteria andAgentIdIsNotNull() { - addCriterion("agent_id is not null"); + public Criteria andAgentStaffIdIsNotNull() { + addCriterion("agent_staff_id is not null"); return (Criteria) this; } - public Criteria andAgentIdEqualTo(Integer value) { - addCriterion("agent_id =", value, "agentId"); + public Criteria andAgentStaffIdEqualTo(Long value) { + addCriterion("agent_staff_id =", value, "agentStaffId"); return (Criteria) this; } - public Criteria andAgentIdNotEqualTo(Integer value) { - addCriterion("agent_id <>", value, "agentId"); + public Criteria andAgentStaffIdNotEqualTo(Long value) { + addCriterion("agent_staff_id <>", value, "agentStaffId"); return (Criteria) this; } - public Criteria andAgentIdGreaterThan(Integer value) { - addCriterion("agent_id >", value, "agentId"); + public Criteria andAgentStaffIdGreaterThan(Long value) { + addCriterion("agent_staff_id >", value, "agentStaffId"); return (Criteria) this; } - public Criteria andAgentIdGreaterThanOrEqualTo(Integer value) { - addCriterion("agent_id >=", value, "agentId"); + public Criteria andAgentStaffIdGreaterThanOrEqualTo(Long value) { + addCriterion("agent_staff_id >=", value, "agentStaffId"); return (Criteria) this; } - public Criteria andAgentIdLessThan(Integer value) { - addCriterion("agent_id <", value, "agentId"); + public Criteria andAgentStaffIdLessThan(Long value) { + addCriterion("agent_staff_id <", value, "agentStaffId"); return (Criteria) this; } - public Criteria andAgentIdLessThanOrEqualTo(Integer value) { - addCriterion("agent_id <=", value, "agentId"); + public Criteria andAgentStaffIdLessThanOrEqualTo(Long value) { + addCriterion("agent_staff_id <=", value, "agentStaffId"); return (Criteria) this; } - public Criteria andAgentIdIn(List values) { - addCriterion("agent_id in", values, "agentId"); + public Criteria andAgentStaffIdIn(List values) { + addCriterion("agent_staff_id in", values, "agentStaffId"); return (Criteria) this; } - public Criteria andAgentIdNotIn(List values) { - addCriterion("agent_id not in", values, "agentId"); + public Criteria andAgentStaffIdNotIn(List values) { + addCriterion("agent_staff_id not in", values, "agentStaffId"); return (Criteria) this; } - public Criteria andAgentIdBetween(Integer value1, Integer value2) { - addCriterion("agent_id between", value1, value2, "agentId"); + public Criteria andAgentStaffIdBetween(Long value1, Long value2) { + addCriterion("agent_staff_id between", value1, value2, "agentStaffId"); return (Criteria) this; } - public Criteria andAgentIdNotBetween(Integer value1, Integer value2) { - addCriterion("agent_id not between", value1, value2, "agentId"); + public Criteria andAgentStaffIdNotBetween(Long value1, Long value2) { + addCriterion("agent_staff_id not between", value1, value2, "agentStaffId"); return (Criteria) this; } - public Criteria andAgentNameIsNull() { - addCriterion("agent_name is null"); + public Criteria andAgentStaffNameIsNull() { + addCriterion("agent_staff_name is null"); return (Criteria) this; } - public Criteria andAgentNameIsNotNull() { - addCriterion("agent_name is not null"); + public Criteria andAgentStaffNameIsNotNull() { + addCriterion("agent_staff_name is not null"); return (Criteria) this; } - public Criteria andAgentNameEqualTo(String value) { - addCriterion("agent_name =", value, "agentName"); + public Criteria andAgentStaffNameEqualTo(String value) { + addCriterion("agent_staff_name =", value, "agentStaffName"); return (Criteria) this; } - public Criteria andAgentNameNotEqualTo(String value) { - addCriterion("agent_name <>", value, "agentName"); + public Criteria andAgentStaffNameNotEqualTo(String value) { + addCriterion("agent_staff_name <>", value, "agentStaffName"); return (Criteria) this; } - public Criteria andAgentNameGreaterThan(String value) { - addCriterion("agent_name >", value, "agentName"); + public Criteria andAgentStaffNameGreaterThan(String value) { + addCriterion("agent_staff_name >", value, "agentStaffName"); return (Criteria) this; } - public Criteria andAgentNameGreaterThanOrEqualTo(String value) { - addCriterion("agent_name >=", value, "agentName"); + public Criteria andAgentStaffNameGreaterThanOrEqualTo(String value) { + addCriterion("agent_staff_name >=", value, "agentStaffName"); return (Criteria) this; } - public Criteria andAgentNameLessThan(String value) { - addCriterion("agent_name <", value, "agentName"); + public Criteria andAgentStaffNameLessThan(String value) { + addCriterion("agent_staff_name <", value, "agentStaffName"); return (Criteria) this; } - public Criteria andAgentNameLessThanOrEqualTo(String value) { - addCriterion("agent_name <=", value, "agentName"); + public Criteria andAgentStaffNameLessThanOrEqualTo(String value) { + addCriterion("agent_staff_name <=", value, "agentStaffName"); return (Criteria) this; } - public Criteria andAgentNameLike(String value) { - addCriterion("agent_name like", value, "agentName"); + public Criteria andAgentStaffNameLike(String value) { + addCriterion("agent_staff_name like", value, "agentStaffName"); return (Criteria) this; } - public Criteria andAgentNameNotLike(String value) { - addCriterion("agent_name not like", value, "agentName"); + public Criteria andAgentStaffNameNotLike(String value) { + addCriterion("agent_staff_name not like", value, "agentStaffName"); return (Criteria) this; } - public Criteria andAgentNameIn(List values) { - addCriterion("agent_name in", values, "agentName"); + public Criteria andAgentStaffNameIn(List values) { + addCriterion("agent_staff_name in", values, "agentStaffName"); return (Criteria) this; } - public Criteria andAgentNameNotIn(List values) { - addCriterion("agent_name not in", values, "agentName"); + public Criteria andAgentStaffNameNotIn(List values) { + addCriterion("agent_staff_name not in", values, "agentStaffName"); return (Criteria) this; } - public Criteria andAgentNameBetween(String value1, String value2) { - addCriterion("agent_name between", value1, value2, "agentName"); + public Criteria andAgentStaffNameBetween(String value1, String value2) { + addCriterion("agent_staff_name between", value1, value2, "agentStaffName"); return (Criteria) this; } - public Criteria andAgentNameNotBetween(String value1, String value2) { - addCriterion("agent_name not between", value1, value2, "agentName"); + public Criteria andAgentStaffNameNotBetween(String value1, String value2) { + addCriterion("agent_staff_name not between", value1, value2, "agentStaffName"); + return (Criteria) this; + } + + public Criteria andUserIdIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUserIdIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUserIdEqualTo(Long value) { + addCriterion("user_id =", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotEqualTo(Long value) { + addCriterion("user_id <>", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThan(Long value) { + addCriterion("user_id >", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("user_id >=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThan(Long value) { + addCriterion("user_id <", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThanOrEqualTo(Long value) { + addCriterion("user_id <=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdIn(List values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List values) { + addCriterion("user_id not in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdBetween(Long value1, Long value2) { + addCriterion("user_id between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotBetween(Long value1, Long value2) { + addCriterion("user_id not between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUserPhoneIsNull() { + addCriterion("user_phone is null"); + return (Criteria) this; + } + + public Criteria andUserPhoneIsNotNull() { + addCriterion("user_phone is not null"); + return (Criteria) this; + } + + public Criteria andUserPhoneEqualTo(String value) { + addCriterion("user_phone =", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneNotEqualTo(String value) { + addCriterion("user_phone <>", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneGreaterThan(String value) { + addCriterion("user_phone >", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneGreaterThanOrEqualTo(String value) { + addCriterion("user_phone >=", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneLessThan(String value) { + addCriterion("user_phone <", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneLessThanOrEqualTo(String value) { + addCriterion("user_phone <=", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneLike(String value) { + addCriterion("user_phone like", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneNotLike(String value) { + addCriterion("user_phone not like", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneIn(List values) { + addCriterion("user_phone in", values, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneNotIn(List values) { + addCriterion("user_phone not in", values, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneBetween(String value1, String value2) { + addCriterion("user_phone between", value1, value2, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneNotBetween(String value1, String value2) { + addCriterion("user_phone not between", value1, value2, "userPhone"); return (Criteria) this; } diff --git a/service/src/main/java/com/hfkj/model/AgentMerAllot.java b/service/src/main/java/com/hfkj/model/AgentMerAllot.java index 72cc7bc..7aa4eb7 100644 --- a/service/src/main/java/com/hfkj/model/AgentMerAllot.java +++ b/service/src/main/java/com/hfkj/model/AgentMerAllot.java @@ -20,5 +20,6 @@ public class AgentMerAllot { private String agentName; private Date createTime; private String agentStaff; + private String qrCodeImgUrl; } diff --git a/service/src/main/java/com/hfkj/model/order/OrderChildModel.java b/service/src/main/java/com/hfkj/model/order/OrderChildModel.java index 8682a41..95a3003 100644 --- a/service/src/main/java/com/hfkj/model/order/OrderChildModel.java +++ b/service/src/main/java/com/hfkj/model/order/OrderChildModel.java @@ -18,7 +18,7 @@ public class OrderChildModel extends BsOrderChild { /** * 油站加油员 */ - private String gasStaffCode; + private Long gasStaffId; /** * 油站油号 */ @@ -27,4 +27,8 @@ public class OrderChildModel extends BsOrderChild { * 油站抢号 */ private String gasGunNo; + /** + * 油站代理 + */ + private Long agentMerId; } diff --git a/service/src/main/java/com/hfkj/service/agent/BsAgentMerService.java b/service/src/main/java/com/hfkj/service/agent/BsAgentMerService.java index 57e101e..8ba722d 100644 --- a/service/src/main/java/com/hfkj/service/agent/BsAgentMerService.java +++ b/service/src/main/java/com/hfkj/service/agent/BsAgentMerService.java @@ -53,6 +53,21 @@ public interface BsAgentMerService { */ List getList(Map param); + /** + * 查询详情 + * @param agentId + * @param merNo + * @return + */ + BsAgentMer getDetailByAgent(Long agentId,String merNo); + + /** + * 查询详情 + * @param agentStaffId + * @param merNo + * @return + */ + BsAgentMer getDetailByAgentStaff(Long agentStaffId,String merNo); /** * 分配工作人员 * @param staffId diff --git a/service/src/main/java/com/hfkj/service/agent/BsAgentPriceService.java b/service/src/main/java/com/hfkj/service/agent/BsAgentPriceService.java new file mode 100644 index 0000000..27abdcf --- /dev/null +++ b/service/src/main/java/com/hfkj/service/agent/BsAgentPriceService.java @@ -0,0 +1,46 @@ +package com.hfkj.service.agent; + +import com.hfkj.entity.BsAgentPrice; +import com.hfkj.sysenum.agent.AgentPriceTypeEnum; + +import java.util.List; + +/** + * @className: BsAgentPriceService + * @author: HuRui + * @date: 2024/6/19 + **/ +public interface BsAgentPriceService { + + /** + * 编辑数据 + * @param data + */ + void editData(BsAgentPrice data); + + /** + * 查询详情 + * @param type + * @param merNo + * @param oilNo + * @return + */ + BsAgentPrice getDetail(AgentPriceTypeEnum type,String merNo,String oilNo); + + /** + * 查询详情 + * @param agentMerId + * @param oilNo + * @return + */ + BsAgentPrice getDetail(Long agentMerId,String oilNo); + + /** + * 查询列表 + * @param type + * @param merNo + * @return + */ + List getPriceList(AgentPriceTypeEnum type,String merNo); + +} diff --git a/service/src/main/java/com/hfkj/service/agent/impl/BsAgentMerServiceImpl.java b/service/src/main/java/com/hfkj/service/agent/impl/BsAgentMerServiceImpl.java index 1d6a682..f39182c 100644 --- a/service/src/main/java/com/hfkj/service/agent/impl/BsAgentMerServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/agent/impl/BsAgentMerServiceImpl.java @@ -51,7 +51,9 @@ public class BsAgentMerServiceImpl implements BsAgentMerService { @Override public void addData(List dataList) { - agentMerMapper.addPatch(dataList); + if (!dataList.isEmpty()) { + agentMerMapper.addPatch(dataList); + } } @Override @@ -135,6 +137,28 @@ public class BsAgentMerServiceImpl implements BsAgentMerService { return agentMerMapper.selectByExample(example); } + @Override + public BsAgentMer getDetailByAgent(Long agentId, String merNo) { + BsAgentMerExample example = new BsAgentMerExample(); + example.createCriteria().andAgentIdEqualTo(agentId).andMerNoEqualTo(merNo).andStatusNotEqualTo(0); + List list = agentMerMapper.selectByExample(example); + if (!list.isEmpty()) { + return list.get(0); + } + return null; + } + + @Override + public BsAgentMer getDetailByAgentStaff(Long agentStaffId, String merNo) { + BsAgentMerExample example = new BsAgentMerExample(); + example.createCriteria().andAgentStaffIdEqualTo(agentStaffId).andMerNoEqualTo(merNo).andStatusNotEqualTo(0); + List list = agentMerMapper.selectByExample(example); + if (!list.isEmpty()) { + return list.get(0); + } + return null; + } + @Override public void assignStaff(Long staffId, List merNoArray) { // 代理商工作人员 diff --git a/service/src/main/java/com/hfkj/service/agent/impl/BsAgentPriceServiceImpl.java b/service/src/main/java/com/hfkj/service/agent/impl/BsAgentPriceServiceImpl.java new file mode 100644 index 0000000..f2fb12f --- /dev/null +++ b/service/src/main/java/com/hfkj/service/agent/impl/BsAgentPriceServiceImpl.java @@ -0,0 +1,66 @@ +package com.hfkj.service.agent.impl; + +import com.hfkj.dao.BsAgentPriceMapper; +import com.hfkj.entity.BsAgentPrice; +import com.hfkj.entity.BsAgentPriceExample; +import com.hfkj.service.agent.BsAgentPriceService; +import com.hfkj.sysenum.agent.AgentPriceTypeEnum; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + * @className: BsAgentPriceServiceImpl + * @author: HuRui + * @date: 2024/6/19 + **/ +@Service("agentPriceService") +public class BsAgentPriceServiceImpl implements BsAgentPriceService { + @Resource + private BsAgentPriceMapper agentPriceMapper; + + + @Override + public void editData(BsAgentPrice data) { + data.setUpdateTime(new Date()); + if (data.getId() == null) { + data.setStatus(1); + data.setCreateTime(new Date()); + agentPriceMapper.insert(data); + } else { + agentPriceMapper.updateByPrimaryKey(data); + } + } + + @Override + public BsAgentPrice getDetail(AgentPriceTypeEnum type, String merNo, String oilNo) { + BsAgentPriceExample example = new BsAgentPriceExample(); + example.createCriteria().andTypeEqualTo(type.getCode()).andMerNoEqualTo(merNo).andOilNoEqualTo(oilNo); + List list = agentPriceMapper.selectByExample(example); + if (!list.isEmpty()) { + return list.get(0); + } + return null; + } + + @Override + public BsAgentPrice getDetail(Long agentMerId, String oilNo) { + BsAgentPriceExample example = new BsAgentPriceExample(); + example.createCriteria().andAgentMerIdEqualTo(agentMerId).andOilNoEqualTo(oilNo); + List list = agentPriceMapper.selectByExample(example); + if (!list.isEmpty()) { + return list.get(0); + } + return null; + } + + @Override + public List getPriceList(AgentPriceTypeEnum type, String merNo) { + BsAgentPriceExample example = new BsAgentPriceExample(); + example.createCriteria().andTypeEqualTo(type.getCode()).andMerNoEqualTo(merNo); + return agentPriceMapper.selectByExample(example); + } +} + diff --git a/service/src/main/java/com/hfkj/service/gas/BsGasService.java b/service/src/main/java/com/hfkj/service/gas/BsGasService.java index a8461db..151291d 100644 --- a/service/src/main/java/com/hfkj/service/gas/BsGasService.java +++ b/service/src/main/java/com/hfkj/service/gas/BsGasService.java @@ -32,11 +32,11 @@ public interface BsGasService { * @param refuelPrice * @param merNo * @param oilNo - * @param isTyAgent + * @param agentMerId 代理商商户id * @return * @throws Exception */ - GasPayPriceModel refuelPriceCompute(BigDecimal refuelPrice, String merNo, String oilNo, Boolean isTyAgent) ; + GasPayPriceModel refuelPriceCompute(BigDecimal refuelPrice, String merNo, String oilNo, Long agentMerId) ; /** * 查询油站信息 diff --git a/service/src/main/java/com/hfkj/service/gas/impl/BsGasOrderServiceImpl.java b/service/src/main/java/com/hfkj/service/gas/impl/BsGasOrderServiceImpl.java index 59d3aa7..d1da03a 100644 --- a/service/src/main/java/com/hfkj/service/gas/impl/BsGasOrderServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/gas/impl/BsGasOrderServiceImpl.java @@ -69,12 +69,12 @@ public class BsGasOrderServiceImpl implements BsGasOrderService { criteria.andMerIdEqualTo(MapUtils.getLong(param, "merId")); } - if (StringUtils.isNotBlank(MapUtils.getString(param, "merName"))) { - criteria.andMerNameLike("%"+MapUtils.getString(param, "merName")+"%"); + if (StringUtils.isNotBlank(MapUtils.getString(param, "merNo"))) { + criteria.andMerNoEqualTo(MapUtils.getString(param, "merNo")); } - if (MapUtils.getLong(param, "gasStaffId") != null) { - criteria.andGasStaffIdEqualTo(MapUtils.getLong(param, "gasStaffId")); + if (StringUtils.isNotBlank(MapUtils.getString(param, "merName"))) { + criteria.andMerNameLike("%"+MapUtils.getString(param, "merName")+"%"); } if (StringUtils.isNotBlank(MapUtils.getString(param, "orderNo"))) { @@ -85,6 +85,10 @@ public class BsGasOrderServiceImpl implements BsGasOrderService { criteria.andOrderChildNoLike("%"+MapUtils.getString(param, "orderChildNo")+"%"); } + if (StringUtils.isNotBlank(MapUtils.getString(param, "channelOrderNo"))) { + criteria.andChannelOrderNoLike("%"+MapUtils.getString(param, "channelOrderNo")+"%"); + } + if (MapUtils.getLong(param, "userId") != null) { criteria.andUserIdEqualTo(MapUtils.getLong(param, "userId")); } @@ -109,6 +113,30 @@ public class BsGasOrderServiceImpl implements BsGasOrderService { criteria.andPayTypeEqualTo(MapUtils.getInteger(param, "payType")); } + if (MapUtils.getLong(param, "gasClassGroupId") != null) { + criteria.andGasClassGroupIdEqualTo(MapUtils.getLong(param, "gasClassGroupId")); + } + + if (MapUtils.getLong(param, "gasClassGroupTaskId") != null) { + criteria.andGasClassGroupTaskIdEqualTo(MapUtils.getLong(param, "gasClassGroupTaskId")); + } + + if (MapUtils.getLong(param, "agentId") != null) { + criteria.andAgentIdEqualTo(MapUtils.getLong(param, "agentId")); + } + + if (MapUtils.getLong(param, "agentStaffId") != null) { + criteria.andAgentStaffIdEqualTo(MapUtils.getLong(param, "agentStaffId")); + } + + if (MapUtils.getLong(param, "gasStaffId") != null) { + criteria.andGasStaffIdEqualTo(MapUtils.getLong(param, "gasStaffId")); + } + + if (MapUtils.getLong(param, "gasClassGroupTaskId") != null) { + criteria.andGasClassGroupTaskIdEqualTo(MapUtils.getLong(param, "gasClassGroupTaskId")); + } + if (StringUtils.isNotBlank(MapUtils.getString(param, "status"))) { List status = Arrays.stream(MapUtils.getString(param, "status").split(",")) .flatMapToInt(num -> IntStream.of(Integer.parseInt(num))).boxed() diff --git a/service/src/main/java/com/hfkj/service/gas/impl/BsGasServiceImpl.java b/service/src/main/java/com/hfkj/service/gas/impl/BsGasServiceImpl.java index be96e42..7a26d9c 100644 --- a/service/src/main/java/com/hfkj/service/gas/impl/BsGasServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/gas/impl/BsGasServiceImpl.java @@ -5,16 +5,19 @@ import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.SysCode; import com.hfkj.common.utils.RedisUtil; import com.hfkj.dao.BsMerchantMapper; +import com.hfkj.entity.BsAgentPrice; import com.hfkj.entity.BsGasOilPrice; import com.hfkj.entity.BsMerchant; import com.hfkj.model.GasListModel; import com.hfkj.model.GasModel; import com.hfkj.model.GasOilPriceModel; import com.hfkj.model.GasPayPriceModel; +import com.hfkj.service.agent.BsAgentPriceService; import com.hfkj.service.gas.BsGasOilGunNoService; import com.hfkj.service.gas.BsGasOilPriceService; import com.hfkj.service.gas.BsGasService; import com.hfkj.service.BsMerchantService; +import com.hfkj.sysenum.agent.AgentPriceTypeEnum; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; @@ -39,6 +42,8 @@ public class BsGasServiceImpl implements BsGasService { @Resource private BsGasOilGunNoService gasOilGunNoService; @Resource + private BsAgentPriceService agentPriceService; + @Resource private RedisUtil redisUtil; private final static String CACHE_GAS_KEY = "GAS:"; @@ -53,7 +58,7 @@ public class BsGasServiceImpl implements BsGasService { } @Override - public GasPayPriceModel refuelPriceCompute(BigDecimal refuelPrice, String merNo, String oilNo, Boolean isTyAgent) { + public GasPayPriceModel refuelPriceCompute(BigDecimal refuelPrice, String merNo, String oilNo, Long agentMerId) { // 查询油站信息 BsMerchant merchant = merchantService.getMerchant(merNo); if (merchant == null) { @@ -62,8 +67,18 @@ public class BsGasServiceImpl implements BsGasService { // 优惠比例 BigDecimal discount = new BigDecimal("100"); - if (isTyAgent != null && isTyAgent.equals(true)) { - + if (agentMerId != null) { + // 查询代理价格 + BsAgentPrice agentPrice = agentPriceService.getDetail(agentMerId, oilNo); + if (agentPrice != null) { + discount = agentPrice.getPriceRate(); + } + } else { + // 查询平台价格 + BsAgentPrice agentPrice = agentPriceService.getDetail(AgentPriceTypeEnum.type1, merNo, oilNo); + if (agentPrice != null) { + discount = agentPrice.getPriceRate(); + } } discount = discount.divide(new BigDecimal("100")); diff --git a/service/src/main/java/com/hfkj/service/order/OrderCreateService.java b/service/src/main/java/com/hfkj/service/order/OrderCreateService.java index e08d299..3cf2679 100644 --- a/service/src/main/java/com/hfkj/service/order/OrderCreateService.java +++ b/service/src/main/java/com/hfkj/service/order/OrderCreateService.java @@ -68,7 +68,7 @@ public class OrderCreateService { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前油站暂停交易"); } // 计算价格 - GasPayPriceModel priceModel = gasService.refuelPriceCompute(orderChild.getProductPrice(), merchant.getMerNo(), orderChild.getGasOilNo(),false); + GasPayPriceModel priceModel = gasService.refuelPriceCompute(orderChild.getProductPrice(), merchant.getMerNo(), orderChild.getGasOilNo(), orderChild.getAgentMerId()); BsGasOrder gasOrder = new BsGasOrder(); gasOrder.setMerNo(merchant.getMerNo()); @@ -103,18 +103,9 @@ public class OrderCreateService { gasOrder.setGasPricePreferences(priceModel.getPricePreferences()); // 加油员 - if (StringUtils.isNotBlank(orderChild.getGasStaffCode())) { - String staffId; - try { - staffId = AESEncodeUtil.aesDecrypt(orderChild.getGasStaffCode()); - } catch (Exception e) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "收银员code解析失败"); - } - if (staffId == null) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知加油员"); - } + if (orderChild.getGasStaffId() != null) { // 查询员工 - BsGasStaff gasStaff = gasStaffService.getStaffDetailById(Long.parseLong(staffId)); + BsGasStaff gasStaff = gasStaffService.getStaffDetailById(orderChild.getGasStaffId()); if (gasStaff == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知加油员"); } diff --git a/service/src/main/java/com/hfkj/sysenum/agent/AgentPriceTypeEnum.java b/service/src/main/java/com/hfkj/sysenum/agent/AgentPriceTypeEnum.java new file mode 100644 index 0000000..9e7a02f --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/agent/AgentPriceTypeEnum.java @@ -0,0 +1,35 @@ +package com.hfkj.sysenum.agent; + +import lombok.Getter; + +/** + * @className: AgentPriceTypeEnum + * @author: HuRui + * @date: 2024/6/19 + **/ +@Getter +public enum AgentPriceTypeEnum { + + /** + * 平台 + */ + type1(1 , "平台"), + /** + * 代理商 + */ + type2(2 , "代理商"), + /** + * 业务员 + */ + type3(3 , "业务员"), + ; + + private Integer code; + + private String name; + + AgentPriceTypeEnum(int code , String name) { + this.code = code; + this.name = name; + } +} diff --git a/service/src/main/java/com/hfkj/sysenum/gas/GasOilNoEnum.java b/service/src/main/java/com/hfkj/sysenum/gas/GasOilNoEnum.java new file mode 100644 index 0000000..3bc8d30 --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/gas/GasOilNoEnum.java @@ -0,0 +1,55 @@ +package com.hfkj.sysenum.gas; + +import lombok.Getter; + +import java.util.Objects; + +/** + * 油号 + * @className: GasOilNoEnum + * @author: HuRui + * @date: 2024/6/19 + **/ +@Getter +public enum GasOilNoEnum { + /** + * 92号 + */ + OIL_NO_92(92, "92#", 1, "汽油"), + /** + * 95号 + */ + OIL_NO_95(95, "95#", 1, "汽油"), + /** + * 98号 + */ + OIL_NO_98(98, "98#", 1, "汽油"), + /** + * 0号 + */ + OIL_NO_0(0, "0#", 2, "柴油"), + ; + + private Integer code; + private String name; + private Integer type; + private String typeName; + + + GasOilNoEnum(Integer code, String name, Integer type, String typeName) { + this.code = code; + this.name = name; + this.type = type; + this.typeName = typeName; + } + + public static GasOilNoEnum getNameByType(Integer code) { + for (GasOilNoEnum ele : values()) { + if (Objects.equals(code, ele.getCode())) { + return ele; + } + } + return null; + } + +}