优化内容

master
胡锐 2 weeks ago
parent 4136a2ac88
commit 70df18c2d0
  1. 4
      bweb/src/main/java/com/bweb/controller/BsAgentController.java
  2. 36
      bweb/src/main/java/com/bweb/controller/BsAgentPriceController.java
  3. 2
      bweb/src/main/java/com/bweb/controller/BsDeviceController.java
  4. 6
      bweb/src/main/java/com/bweb/controller/BsMerchantAccountController.java
  5. 3
      bweb/src/main/java/com/bweb/controller/BsMerchantController.java
  6. 64
      bweb/src/main/java/com/bweb/controller/TestController.java
  7. 42
      service/src/main/java/com/hfkj/dao/BsAgentPriceMapperExt.java
  8. 8
      service/src/main/java/com/hfkj/service/agent/BsAgentPriceService.java
  9. 6
      service/src/main/java/com/hfkj/service/agent/impl/BsAgentPriceServiceImpl.java
  10. 4
      service/src/main/java/com/hfkj/service/agent/impl/BsAgentServiceImpl.java
  11. 4
      service/src/main/java/com/hfkj/service/impl/BsDeviceServiceImpl.java
  12. 12
      service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantAccountRecordServiceImpl.java

@ -138,12 +138,14 @@ public class BsAgentController {
@RequestMapping(value = "/queryAgentList", method = RequestMethod.GET) @RequestMapping(value = "/queryAgentList", method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "查询代理商列表") @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 = "agentName", required = false) String agentName,
@RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) { @RequestParam(name = "pageSize", required = true) Integer pageSize) {
try { try {
Map<String, Object> param = new HashMap<>(); Map<String, Object> param = new HashMap<>();
param.put("type", type);
param.put("agentNo", agentNo); param.put("agentNo", agentNo);
param.put("agentName", agentName); param.put("agentName", agentName);

@ -2,6 +2,8 @@ package com.bweb.controller;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; 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.ErrorCode;
import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode; 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<String,Object> 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);
}
}
} }

@ -189,6 +189,7 @@ public class BsDeviceController {
public ResponseData getDeviceList(@RequestParam(name = "merNo", required = false) String merNo, public ResponseData getDeviceList(@RequestParam(name = "merNo", required = false) String merNo,
@RequestParam(name = "merName", required = false) String merName, @RequestParam(name = "merName", required = false) String merName,
@RequestParam(name = "deviceName", required = false) String deviceName, @RequestParam(name = "deviceName", required = false) String deviceName,
@RequestParam(name = "deviceSn", required = false) String deviceSn,
@RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) { @RequestParam(name = "pageSize", required = true) Integer pageSize) {
try { try {
@ -208,6 +209,7 @@ public class BsDeviceController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, "");
} }
param.put("merName", merName); param.put("merName", merName);
param.put("deviceSn", deviceSn);
param.put("deviceName", deviceName); param.put("deviceName", deviceName);
PageHelper.startPage(pageNum, pageSize); PageHelper.startPage(pageNum, pageSize);

@ -140,6 +140,9 @@ public class BsMerchantAccountController {
@ResponseBody @ResponseBody
@ApiOperation(value = "记录列表") @ApiOperation(value = "记录列表")
public ResponseData getRecordList(@RequestParam(value = "merNo", required = true) String merNo, 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 = "pageNum", required = true) Integer pageNum,
@RequestParam(value = "pageSize", required = true) Integer pageSize) { @RequestParam(value = "pageSize", required = true) Integer pageSize) {
try { try {
@ -150,6 +153,9 @@ public class BsMerchantAccountController {
} }
Map<String,Object> param = new HashMap<>(); Map<String,Object> param = new HashMap<>();
param.put("merNo", merNo); param.put("merNo", merNo);
param.put("type", type);
param.put("sourceType", sourceType);
param.put("sourceOrderNo", sourceOrderNo);
PageHelper.startPage(pageNum,pageSize); PageHelper.startPage(pageNum,pageSize);
/* if (merchant.getChainBrandId() != null && merchant.getChainBrandSettleType().equals(MerchantChainBrandSettleTypeEnum.type1.getNumber())) { /* if (merchant.getChainBrandId() != null && merchant.getChainBrandSettleType().equals(MerchantChainBrandSettleTypeEnum.type1.getNumber())) {
// 连锁额度账户 // 连锁额度账户

@ -65,7 +65,6 @@ public class BsMerchantController {
|| StringUtils.isBlank(body.getAddress()) || StringUtils.isBlank(body.getAddress())
|| StringUtils.isBlank(body.getLongitude()) || StringUtils.isBlank(body.getLongitude())
|| StringUtils.isBlank(body.getLatitude()) || StringUtils.isBlank(body.getLatitude())
|| StringUtils.isBlank(body.getMerLabel())
) { ) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
} }
@ -123,7 +122,6 @@ public class BsMerchantController {
merchant.setChainBrandSettleType(data.getNumber()); merchant.setChainBrandSettleType(data.getNumber());
} }
merchant.setSourceType(MerchantSourceTypeEnum.type1.getNumber());
merchant.setProvinceCode(provinceRegion.getRegionId()); merchant.setProvinceCode(provinceRegion.getRegionId());
merchant.setProvinceName(provinceRegion.getRegionName()); merchant.setProvinceName(provinceRegion.getRegionName());
merchant.setCityCode(cityRegion.getRegionId()); merchant.setCityCode(cityRegion.getRegionId());
@ -141,6 +139,7 @@ public class BsMerchantController {
merchant.setMerLabel(body.getMerLabel()); merchant.setMerLabel(body.getMerLabel());
if (merchant.getMerNo() == null) { if (merchant.getMerNo() == null) {
merchant.setSourceType(MerchantSourceTypeEnum.type1.getNumber());
merchantService.createMerchant(merchant); merchantService.createMerchant(merchant);
} else { } else {
merchantService.updateMerchant(merchant); merchantService.updateMerchant(merchant);

@ -1,6 +1,7 @@
package com.bweb.controller; package com.bweb.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.hfkj.channel.gas.shell.CqShellPetroleumRequestService; 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.MD5Util;
import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.config.MqttProviderConfig; import com.hfkj.config.MqttProviderConfig;
import com.hfkj.dao.SecRegionMapper;
import com.hfkj.device.sanmisen.PrinterTemplate; import com.hfkj.device.sanmisen.PrinterTemplate;
import com.hfkj.entity.BsGasClassGroupTask; import com.hfkj.entity.BsGasClassGroupTask;
import com.hfkj.entity.BsGasOrder; import com.hfkj.entity.BsGasOrder;
import com.hfkj.entity.SecRegion;
import com.hfkj.entity.SecUser; import com.hfkj.entity.SecUser;
import com.hfkj.model.GasClassGroupTaskDataCount; import com.hfkj.model.GasClassGroupTaskDataCount;
import com.hfkj.model.ResponseData; import com.hfkj.model.ResponseData;
import com.hfkj.service.BsDeviceService; import com.hfkj.service.BsDeviceService;
import com.hfkj.service.CommonService;
import com.hfkj.service.gas.BsGasClassGroupTaskService; import com.hfkj.service.gas.BsGasClassGroupTaskService;
import com.hfkj.service.gas.BsGasOrderService; import com.hfkj.service.gas.BsGasOrderService;
import com.hfkj.service.sec.SecUserLoginLogService; import com.hfkj.service.sec.SecUserLoginLogService;
@ -34,8 +38,8 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.HashMap; import java.io.File;
import java.util.Map; import java.util.*;
@Controller @Controller
@RequestMapping(value="/test") @RequestMapping(value="/test")
@ -52,6 +56,62 @@ public class TestController {
private BsDeviceService deviceService; private BsDeviceService deviceService;
@Resource @Resource
private BsGasOrderService gasOrderService; private BsGasOrderService gasOrderService;
@Resource
private CommonService commonService;
@RequestMapping(value="test",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "test")
public ResponseData test() {
try {
List<Map<String,Object>> list = new ArrayList<>();
// 省
List<SecRegion> cities = commonService.getCities();
for (SecRegion province : cities) {
Map<String,Object> provinceMap = new LinkedHashMap<>();
provinceMap.put("value", province.getRegionId());
provinceMap.put("label", province.getRegionName());
// 市
List<SecRegion> regions = commonService.getRegionsByParentId(province.getRegionId());
if (!regions.isEmpty()) {
List<Map<String,Object>> cityList = new ArrayList<>();
for (SecRegion city : regions) {
Map<String, Object> cityMap = new LinkedHashMap<>();
cityMap.put("value", city.getRegionId());
cityMap.put("label", city.getRegionName());
// 区/县
List<SecRegion> areas = commonService.getRegionsByParentId(city.getRegionId());
if (!areas.isEmpty()) {
List<Map<String,Object>> areasList = new ArrayList<>();
for (SecRegion area : areas) {
Map<String, Object> 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) @RequestMapping(value="testDevice",method = RequestMethod.GET)
@ResponseBody @ResponseBody

@ -1,7 +1,47 @@
package com.hfkj.dao; 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扩展类 * mapper扩展类
*/ */
public interface BsAgentPriceMapperExt { public interface BsAgentPriceMapperExt {
}
@Select("<script>" +
" select * from (select " +
" c.agent_name agentName," +
" c.agent_staff_name agentStaffName," +
" b.province_name provinceName," +
" b.source_type sourceType, " +
" b.mer_no merNo," +
" b.mer_name merName," +
" a.oil_no oilNo," +
" a.price_official priceOfficial," +
" a.price_gun priceGun," +
" a.price_vip priceVip," +
" ROUND(a.price_vip * (d.price_rate / 100),2) terminalPrice," +
" d.price_rate priceRate," +
" d.service_fee_rate serviceFeeRate" +
" from bs_gas_oil_price a" +
" LEFT JOIN bs_merchant b on b.id = a.mer_id" +
" LEFT JOIN bs_agent_mer c on c.mer_no = b.mer_no and c.`status` = 1" +
" LEFT JOIN bs_agent_price d on d.agent_mer_id = c.id" +
" where a.`status` = 1 and c.`status` = 1 and c.agent_staff_id is not null and d.`status` = 1" +
" <if test='param.agentId != null'> and c.agent_id = #{param.agentId} </if>" +
" <if test='param.agentStaffId != null'> and c.agent_staff_id = #{param.agentStaffId} </if>" +
" <if test='param.provinceCode != null'> and b.province_code = #{param.provinceCode} </if>" +
" <if test='param.merNo != null'> and b.mer_no like concat('%',#{param.merNo},'%') </if>" +
" <if test='param.merName != null'> and b.mer_name like concat('%',#{param.merName},'%') </if>" +
" <if test='param.sourceType != null'> and b.source_type = #{param.sourceType} </if>" +
" <if test='param.oilNo != null'> and a.oil_no = #{param.oilNo} </if>" +
" ORDER BY c.agent_staff_id,b.mer_no) a " +
" GROUP BY a.merNo,a.oilNo,a.merNo" +
" ORDER BY a.merNo,a.merNo" +
"</script>")
List<Map<String,Object>> queryAgentPriceList(@Param("param") Map<String,Object> param);
}

@ -4,6 +4,7 @@ import com.hfkj.entity.BsAgentPrice;
import com.hfkj.sysenum.agent.AgentPriceTypeEnum; import com.hfkj.sysenum.agent.AgentPriceTypeEnum;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @className: BsAgentPriceService * @className: BsAgentPriceService
@ -43,4 +44,11 @@ public interface BsAgentPriceService {
*/ */
List<BsAgentPrice> getPriceList(AgentPriceTypeEnum type,String merNo); List<BsAgentPrice> getPriceList(AgentPriceTypeEnum type,String merNo);
/**
* 查询代理价格
* @param param
* @return
*/
List<Map<String,Object>> getAgentPriceList(Map<String,Object> param);
} }

@ -10,6 +10,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @className: BsAgentPriceServiceImpl * @className: BsAgentPriceServiceImpl
@ -62,5 +63,10 @@ public class BsAgentPriceServiceImpl implements BsAgentPriceService {
example.createCriteria().andTypeEqualTo(type.getCode()).andMerNoEqualTo(merNo); example.createCriteria().andTypeEqualTo(type.getCode()).andMerNoEqualTo(merNo);
return agentPriceMapper.selectByExample(example); return agentPriceMapper.selectByExample(example);
} }
@Override
public List<Map<String, Object>> getAgentPriceList(Map<String, Object> param) {
return agentPriceMapper.queryAgentPriceList(param);
}
} }

@ -133,6 +133,10 @@ public class BsAgentServiceImpl implements BsAgentService {
BsAgentExample example = new BsAgentExample(); BsAgentExample example = new BsAgentExample();
BsAgentExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0); 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"))) { if (StringUtils.isNotBlank(MapUtils.getString(param, "agentNo"))) {
criteria.andAgentNoLike("%" + MapUtils.getString(param, "agentNo") + "%"); criteria.andAgentNoLike("%" + MapUtils.getString(param, "agentNo") + "%");
} }

@ -73,6 +73,10 @@ public class BsDeviceServiceImpl implements BsDeviceService {
criteria.andMerNameLike("%"+MapUtils.getString(param, "merName")+"%"); 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"))) { if (StringUtils.isNotBlank(MapUtils.getString(param, "deviceName"))) {
criteria.andDeviceNameLike("%" + MapUtils.getString(param, "deviceName") + "%"); criteria.andDeviceNameLike("%" + MapUtils.getString(param, "deviceName") + "%");
} }

@ -77,6 +77,18 @@ public class BsMerchantAccountRecordServiceImpl implements BsMerchantAccountReco
criteria.andMerNoEqualTo(MapUtils.getString(param, "merNo")); 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"); example.setOrderByClause("create_time desc,id desc");
return merchantAccountRecordMapper.selectByExample(example); return merchantAccountRecordMapper.selectByExample(example);
} }

Loading…
Cancel
Save