From 70df18c2d0c97e147dbb8d4b751fcc186708341e Mon Sep 17 00:00:00 2001 From: hu177768073 <177768073@qq.com> Date: Tue, 12 Nov 2024 10:33:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bweb/controller/BsAgentController.java | 4 +- .../controller/BsAgentPriceController.java | 36 +++++++++++ .../bweb/controller/BsDeviceController.java | 2 + .../BsMerchantAccountController.java | 6 ++ .../bweb/controller/BsMerchantController.java | 3 +- .../com/bweb/controller/TestController.java | 64 ++++++++++++++++++- .../com/hfkj/dao/BsAgentPriceMapperExt.java | 42 +++++++++++- .../service/agent/BsAgentPriceService.java | 8 +++ .../agent/impl/BsAgentPriceServiceImpl.java | 6 ++ .../agent/impl/BsAgentServiceImpl.java | 4 ++ .../service/impl/BsDeviceServiceImpl.java | 4 ++ .../BsMerchantAccountRecordServiceImpl.java | 12 ++++ 12 files changed, 185 insertions(+), 6 deletions(-) diff --git a/bweb/src/main/java/com/bweb/controller/BsAgentController.java b/bweb/src/main/java/com/bweb/controller/BsAgentController.java index fdc8ced..5413178 100644 --- a/bweb/src/main/java/com/bweb/controller/BsAgentController.java +++ b/bweb/src/main/java/com/bweb/controller/BsAgentController.java @@ -138,12 +138,14 @@ public class BsAgentController { @RequestMapping(value = "/queryAgentList", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询代理商列表") - public ResponseData queryAgentList(@RequestParam(name = "agentNo", required = false) String agentNo, + public ResponseData queryAgentList(@RequestParam(name = "type", required = false) Integer type, + @RequestParam(name = "agentNo", required = false) String agentNo, @RequestParam(name = "agentName", required = false) String agentName, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize) { try { Map param = new HashMap<>(); + param.put("type", type); param.put("agentNo", agentNo); param.put("agentName", agentName); diff --git a/bweb/src/main/java/com/bweb/controller/BsAgentPriceController.java b/bweb/src/main/java/com/bweb/controller/BsAgentPriceController.java index ca96648..248f085 100644 --- a/bweb/src/main/java/com/bweb/controller/BsAgentPriceController.java +++ b/bweb/src/main/java/com/bweb/controller/BsAgentPriceController.java @@ -2,6 +2,8 @@ package com.bweb.controller; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +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; @@ -304,4 +306,38 @@ public class BsAgentPriceController { } } + + + @RequestMapping(value = "/getPriceList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "获取价格列表") + public ResponseData getPriceList(@RequestParam(name = "agentId", required = true) Long agentId, + @RequestParam(name = "agentStaffId", required = true) Long agentStaffId, + @RequestParam(name = "provinceCode", required = false) String provinceCode, + @RequestParam(name = "merNo", required = false) String merNo, + @RequestParam(name = "merName", required = false) String merName, + @RequestParam(name = "oilNo", required = false) String oilNo, + @RequestParam(name = "sourceType", required = false) Integer sourceType, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize + + ) { + try { + Map param = new HashMap<>(); + param.put("agentId", agentId); + param.put("agentStaffId", agentStaffId); + param.put("provinceCode", provinceCode); + param.put("merNo", merNo); + param.put("merName", merName); + param.put("sourceType", sourceType); + param.put("oilNo", oilNo); + + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(agentPriceService.getAgentPriceList(param))); + + } catch (Exception e) { + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/bweb/src/main/java/com/bweb/controller/BsDeviceController.java b/bweb/src/main/java/com/bweb/controller/BsDeviceController.java index e574648..2ff6666 100644 --- a/bweb/src/main/java/com/bweb/controller/BsDeviceController.java +++ b/bweb/src/main/java/com/bweb/controller/BsDeviceController.java @@ -189,6 +189,7 @@ public class BsDeviceController { public ResponseData getDeviceList(@RequestParam(name = "merNo", required = false) String merNo, @RequestParam(name = "merName", required = false) String merName, @RequestParam(name = "deviceName", required = false) String deviceName, + @RequestParam(name = "deviceSn", required = false) String deviceSn, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize) { try { @@ -208,6 +209,7 @@ public class BsDeviceController { throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, ""); } param.put("merName", merName); + param.put("deviceSn", deviceSn); param.put("deviceName", deviceName); PageHelper.startPage(pageNum, pageSize); diff --git a/bweb/src/main/java/com/bweb/controller/BsMerchantAccountController.java b/bweb/src/main/java/com/bweb/controller/BsMerchantAccountController.java index 276f1cd..17b31c4 100644 --- a/bweb/src/main/java/com/bweb/controller/BsMerchantAccountController.java +++ b/bweb/src/main/java/com/bweb/controller/BsMerchantAccountController.java @@ -140,6 +140,9 @@ public class BsMerchantAccountController { @ResponseBody @ApiOperation(value = "记录列表") public ResponseData getRecordList(@RequestParam(value = "merNo", required = true) String merNo, + @RequestParam(value = "type", required = false) Integer type, + @RequestParam(value = "sourceType", required = false) Integer sourceType, + @RequestParam(value = "sourceOrderNo", required = false) String sourceOrderNo, @RequestParam(value = "pageNum", required = true) Integer pageNum, @RequestParam(value = "pageSize", required = true) Integer pageSize) { try { @@ -150,6 +153,9 @@ public class BsMerchantAccountController { } Map param = new HashMap<>(); param.put("merNo", merNo); + param.put("type", type); + param.put("sourceType", sourceType); + param.put("sourceOrderNo", sourceOrderNo); PageHelper.startPage(pageNum,pageSize); /* if (merchant.getChainBrandId() != null && merchant.getChainBrandSettleType().equals(MerchantChainBrandSettleTypeEnum.type1.getNumber())) { // 连锁额度账户 diff --git a/bweb/src/main/java/com/bweb/controller/BsMerchantController.java b/bweb/src/main/java/com/bweb/controller/BsMerchantController.java index 4747fd8..7783d81 100644 --- a/bweb/src/main/java/com/bweb/controller/BsMerchantController.java +++ b/bweb/src/main/java/com/bweb/controller/BsMerchantController.java @@ -65,7 +65,6 @@ public class BsMerchantController { || StringUtils.isBlank(body.getAddress()) || StringUtils.isBlank(body.getLongitude()) || StringUtils.isBlank(body.getLatitude()) - || StringUtils.isBlank(body.getMerLabel()) ) { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } @@ -123,7 +122,6 @@ public class BsMerchantController { merchant.setChainBrandSettleType(data.getNumber()); } - merchant.setSourceType(MerchantSourceTypeEnum.type1.getNumber()); merchant.setProvinceCode(provinceRegion.getRegionId()); merchant.setProvinceName(provinceRegion.getRegionName()); merchant.setCityCode(cityRegion.getRegionId()); @@ -141,6 +139,7 @@ public class BsMerchantController { merchant.setMerLabel(body.getMerLabel()); if (merchant.getMerNo() == null) { + merchant.setSourceType(MerchantSourceTypeEnum.type1.getNumber()); merchantService.createMerchant(merchant); } else { merchantService.updateMerchant(merchant); diff --git a/bweb/src/main/java/com/bweb/controller/TestController.java b/bweb/src/main/java/com/bweb/controller/TestController.java index 970788e..9443f0c 100644 --- a/bweb/src/main/java/com/bweb/controller/TestController.java +++ b/bweb/src/main/java/com/bweb/controller/TestController.java @@ -1,6 +1,7 @@ package com.bweb.controller; import com.alibaba.fastjson.JSONObject; +import com.fasterxml.jackson.databind.ObjectMapper; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.hfkj.channel.gas.shell.CqShellPetroleumRequestService; @@ -12,13 +13,16 @@ import com.hfkj.common.utils.HttpsUtils; import com.hfkj.common.utils.MD5Util; import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.config.MqttProviderConfig; +import com.hfkj.dao.SecRegionMapper; import com.hfkj.device.sanmisen.PrinterTemplate; import com.hfkj.entity.BsGasClassGroupTask; import com.hfkj.entity.BsGasOrder; +import com.hfkj.entity.SecRegion; import com.hfkj.entity.SecUser; import com.hfkj.model.GasClassGroupTaskDataCount; import com.hfkj.model.ResponseData; import com.hfkj.service.BsDeviceService; +import com.hfkj.service.CommonService; import com.hfkj.service.gas.BsGasClassGroupTaskService; import com.hfkj.service.gas.BsGasOrderService; import com.hfkj.service.sec.SecUserLoginLogService; @@ -34,8 +38,8 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; -import java.util.HashMap; -import java.util.Map; +import java.io.File; +import java.util.*; @Controller @RequestMapping(value="/test") @@ -52,6 +56,62 @@ public class TestController { private BsDeviceService deviceService; @Resource private BsGasOrderService gasOrderService; + @Resource + private CommonService commonService; + + @RequestMapping(value="test",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "test") + public ResponseData test() { + try { + + List> list = new ArrayList<>(); + // 省 + List cities = commonService.getCities(); + for (SecRegion province : cities) { + Map provinceMap = new LinkedHashMap<>(); + provinceMap.put("value", province.getRegionId()); + provinceMap.put("label", province.getRegionName()); + + // 市 + List regions = commonService.getRegionsByParentId(province.getRegionId()); + if (!regions.isEmpty()) { + List> cityList = new ArrayList<>(); + + for (SecRegion city : regions) { + Map cityMap = new LinkedHashMap<>(); + cityMap.put("value", city.getRegionId()); + cityMap.put("label", city.getRegionName()); + + // 区/县 + List areas = commonService.getRegionsByParentId(city.getRegionId()); + if (!areas.isEmpty()) { + List> areasList = new ArrayList<>(); + + for (SecRegion area : areas) { + Map areaMap = new LinkedHashMap<>(); + areaMap.put("value", area.getRegionId()); + areaMap.put("label", area.getRegionName()); + areaMap.put("isLeaf", true); + areasList.add(areaMap); + } + cityMap.put("children", areasList); + } + cityList.add(cityMap); + } + provinceMap.put("children", cityList); + } + list.add(provinceMap); + } + + new ObjectMapper().writeValue(new File("D:\\output.json"), list); + return ResponseMsgUtil.success(""); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } @RequestMapping(value="testDevice",method = RequestMethod.GET) @ResponseBody diff --git a/service/src/main/java/com/hfkj/dao/BsAgentPriceMapperExt.java b/service/src/main/java/com/hfkj/dao/BsAgentPriceMapperExt.java index 5723808..d023a10 100644 --- a/service/src/main/java/com/hfkj/dao/BsAgentPriceMapperExt.java +++ b/service/src/main/java/com/hfkj/dao/BsAgentPriceMapperExt.java @@ -1,7 +1,47 @@ package com.hfkj.dao; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; +import java.util.Map; + /** * mapper扩展类 */ public interface BsAgentPriceMapperExt { -} \ No newline at end of file + + @Select("") + List> queryAgentPriceList(@Param("param") Map param); + +} diff --git a/service/src/main/java/com/hfkj/service/agent/BsAgentPriceService.java b/service/src/main/java/com/hfkj/service/agent/BsAgentPriceService.java index 27abdcf..a16cda1 100644 --- a/service/src/main/java/com/hfkj/service/agent/BsAgentPriceService.java +++ b/service/src/main/java/com/hfkj/service/agent/BsAgentPriceService.java @@ -4,6 +4,7 @@ import com.hfkj.entity.BsAgentPrice; import com.hfkj.sysenum.agent.AgentPriceTypeEnum; import java.util.List; +import java.util.Map; /** * @className: BsAgentPriceService @@ -43,4 +44,11 @@ public interface BsAgentPriceService { */ List getPriceList(AgentPriceTypeEnum type,String merNo); + /** + * 查询代理价格 + * @param param + * @return + */ + List> getAgentPriceList(Map param); + } 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 index f2fb12f..2e09f2e 100644 --- a/service/src/main/java/com/hfkj/service/agent/impl/BsAgentPriceServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/agent/impl/BsAgentPriceServiceImpl.java @@ -10,6 +10,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.Date; import java.util.List; +import java.util.Map; /** * @className: BsAgentPriceServiceImpl @@ -62,5 +63,10 @@ public class BsAgentPriceServiceImpl implements BsAgentPriceService { example.createCriteria().andTypeEqualTo(type.getCode()).andMerNoEqualTo(merNo); return agentPriceMapper.selectByExample(example); } + + @Override + public List> getAgentPriceList(Map param) { + return agentPriceMapper.queryAgentPriceList(param); + } } diff --git a/service/src/main/java/com/hfkj/service/agent/impl/BsAgentServiceImpl.java b/service/src/main/java/com/hfkj/service/agent/impl/BsAgentServiceImpl.java index 6a7dbe7..eedbc39 100644 --- a/service/src/main/java/com/hfkj/service/agent/impl/BsAgentServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/agent/impl/BsAgentServiceImpl.java @@ -133,6 +133,10 @@ public class BsAgentServiceImpl implements BsAgentService { BsAgentExample example = new BsAgentExample(); BsAgentExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0); + if (MapUtils.getInteger(param, "type") != null) { + criteria.andTypeEqualTo(MapUtils.getInteger(param, "type")); + } + if (StringUtils.isNotBlank(MapUtils.getString(param, "agentNo"))) { criteria.andAgentNoLike("%" + MapUtils.getString(param, "agentNo") + "%"); } diff --git a/service/src/main/java/com/hfkj/service/impl/BsDeviceServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsDeviceServiceImpl.java index 4806a64..abd31a8 100644 --- a/service/src/main/java/com/hfkj/service/impl/BsDeviceServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/impl/BsDeviceServiceImpl.java @@ -73,6 +73,10 @@ public class BsDeviceServiceImpl implements BsDeviceService { criteria.andMerNameLike("%"+MapUtils.getString(param, "merName")+"%"); } + if (StringUtils.isNotBlank(MapUtils.getString(param, "deviceSn"))) { + criteria.andDeviceSnLike("%" + MapUtils.getString(param, "deviceSn") + "%"); + } + if (StringUtils.isNotBlank(MapUtils.getString(param, "deviceName"))) { criteria.andDeviceNameLike("%" + MapUtils.getString(param, "deviceName") + "%"); } diff --git a/service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantAccountRecordServiceImpl.java b/service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantAccountRecordServiceImpl.java index 1d03311..f9ab2f9 100644 --- a/service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantAccountRecordServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantAccountRecordServiceImpl.java @@ -77,6 +77,18 @@ public class BsMerchantAccountRecordServiceImpl implements BsMerchantAccountReco criteria.andMerNoEqualTo(MapUtils.getString(param, "merNo")); } + if (MapUtils.getInteger(param, "type") != null) { + criteria.andTypeEqualTo(MapUtils.getInteger(param, "type")); + } + + if (MapUtils.getInteger(param, "sourceType") != null) { + criteria.andSourceTypeEqualTo(MapUtils.getInteger(param, "sourceType")); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "sourceOrderNo"))) { + criteria.andSourceOrderNoLike("%"+MapUtils.getString(param, "sourceOrderNo")+"%"); + } + example.setOrderByClause("create_time desc,id desc"); return merchantAccountRecordMapper.selectByExample(example); }