提交代码

dev-discount
胡锐 2 years ago
parent 2190e880bd
commit be899b4336
  1. 64
      hai-bweb/src/main/java/com/bweb/controller/HighGasController.java
  2. 3
      hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java
  3. 2
      hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java
  4. 7
      hai-service/src/main/java/com/hai/service/HighMerchantStoreService.java
  5. 7
      hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java

@ -173,11 +173,33 @@ public class HighGasController {
Map<String, Object> param = new HashMap<>();; Map<String, Object> param = new HashMap<>();;
// 用户来源 0:超级管理员 1:公司 2:商户 3:门店 4. 代理商 5.充值后台工商 6.团油代理商 7.团油业务员 8. 加油站员工 // 用户来源 0:超级管理员 1:公司 2:商户 3:门店 4. 代理商 5.充值后台工商 6.团油代理商 7.团油业务员 8. 加油站员工
if (userInfoModel.getSecUser().getObjectType().equals(2)) { if (userInfoModel.getSecUser().getObjectType().equals(2)) {
param.put("storeId", storeId); if (storeId != null) {
param.put("storeId", storeId);
} else {
String storeIdStr = "";
List<HighMerchantStore> storeList = merchantStoreService.getStoreListByMer(userInfoModel.getMerchant().getId());
for (HighMerchantStore store : storeList) {
if (StringUtils.isBlank(storeIdStr)) {
storeIdStr += store.getId().toString();
} else {
storeIdStr += "," + store.getId().toString();
}
}
if (StringUtils.isNotBlank(storeIdStr)) {
param.put("storeId", storeIdStr);
} else {
param.put("storeId", 0);
}
}
} else if (userInfoModel.getSecUser().getObjectType().equals(3)) { } else if (userInfoModel.getSecUser().getObjectType().equals(3)) {
param.put("storeId", userInfoModel.getMerchantStore().getId()); param.put("storeId", userInfoModel.getMerchantStore().getId());
} else if (userInfoModel.getSecUser().getObjectType().equals(8)) { } else if (userInfoModel.getSecUser().getObjectType().equals(8)) {
param.put("storeId", userInfoModel.getMerchantStore().getId()); param.put("storeId", userInfoModel.getMerchantStore().getId());
} else { } else {
log.error("HighGasController -> disabledOil() error!",""); log.error("HighGasController -> disabledOil() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
@ -237,17 +259,51 @@ public class HighGasController {
@ResponseBody @ResponseBody
@ApiOperation(value = "导出油站订单") @ApiOperation(value = "导出油站订单")
public ResponseData exportGasOrder(@RequestParam(name = "orderNo", required = false) String orderNo, public ResponseData exportGasOrder(@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "storeId", required = false) Long storeId,
@RequestParam(name = "status", required = false) Integer status, @RequestParam(name = "status", required = false) Integer status,
@RequestParam(name = "createTimeS", required = false) Long createTimeS, @RequestParam(name = "createTimeS", required = false) Long createTimeS,
@RequestParam(name = "createTimeE", required = false) Long createTimeE) { @RequestParam(name = "createTimeE", required = false) Long createTimeE) {
try { try {
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class);
if (userInfoModel == null || userInfoModel.getMerchantStore() == null) { if (userInfoModel == null) {
log.error("HighGasController -> disabledOil() error!",""); log.error("HighGasController -> disabledOil() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
} }
Map<String, Object> param = new HashMap<>();; Map<String, Object> param = new HashMap<>();
param.put("storeId", userInfoModel.getMerchantStore().getId()); // 用户来源 0:超级管理员 1:公司 2:商户 3:门店 4. 代理商 5.充值后台工商 6.团油代理商 7.团油业务员 8. 加油站员工
if (userInfoModel.getSecUser().getObjectType().equals(2)) {
if (storeId != null) {
param.put("storeId", storeId);
} else {
String storeIdStr = "";
List<HighMerchantStore> storeList = merchantStoreService.getStoreListByMer(userInfoModel.getMerchant().getId());
for (HighMerchantStore store : storeList) {
if (StringUtils.isBlank(storeIdStr)) {
storeIdStr += store.getId().toString();
} else {
storeIdStr += "," + store.getId().toString();
}
}
if (StringUtils.isNotBlank(storeIdStr)) {
param.put("storeId", storeIdStr);
} else {
param.put("storeId", 0);
}
}
} else if (userInfoModel.getSecUser().getObjectType().equals(3)) {
param.put("storeId", userInfoModel.getMerchantStore().getId());
} else if (userInfoModel.getSecUser().getObjectType().equals(8)) {
param.put("storeId", userInfoModel.getMerchantStore().getId());
} else {
log.error("HighGasController -> disabledOil() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
param.put("orderNo", orderNo); param.put("orderNo", orderNo);
param.put("createTimeS", createTimeS); param.put("createTimeS", createTimeS);
param.put("createTimeE", createTimeE); param.put("createTimeE", createTimeE);

@ -346,6 +346,9 @@ public class HighOrderController {
} else if (userInfoModel.getSecUser().getObjectType() == 2) { } else if (userInfoModel.getSecUser().getObjectType() == 2) {
map.put("merchantId", userInfoModel.getMerchant().getId()); map.put("merchantId", userInfoModel.getMerchant().getId());
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
} }
map.put("orderNo", orderNo); map.put("orderNo", orderNo);

@ -1121,7 +1121,7 @@ public interface HighOrderMapperExt {
" from high_child_order a,high_order b " + " from high_child_order a,high_order b " +
" where a.order_id = b.id " + " where a.order_id = b.id " +
" and goods_type = 3 " + " and goods_type = 3 " +
"<if test='param.storeId != null'> and goods_id = #{param.storeId} </if>" + "<if test='param.storeId != null'> and goods_id in (${param.storeId}) </if>" +
"<if test='param.status != null'> and b.order_status in (${param.status})</if>" + "<if test='param.status != null'> and b.order_status in (${param.status})</if>" +
"<if test='param.createTimeS != null'> <![CDATA[ and b.create_time >= #{param.createTimeS} ]]> </if>", "<if test='param.createTimeS != null'> <![CDATA[ and b.create_time >= #{param.createTimeS} ]]> </if>",
"<if test='param.createTimeE != null'> <![CDATA[ and b.create_time <= #{param.createTimeE} ]]> </if>", "<if test='param.createTimeE != null'> <![CDATA[ and b.create_time <= #{param.createTimeE} ]]> </if>",

@ -70,6 +70,13 @@ public interface HighMerchantStoreService {
*/ */
HighMerchantStore getDetailById(Long id); HighMerchantStore getDetailById(Long id);
/**
* 查询门店列表
* @param merId
* @return
*/
List<HighMerchantStore> getStoreListByMer(Long merId);
/** /**
* @Author 胡锐 * @Author 胡锐
* @Description 查询门店列表 * @Description 查询门店列表

@ -170,6 +170,13 @@ public class HighMerchantStoreServiceImpl implements HighMerchantStoreService {
return highMerchantStoreMapper.selectByPrimaryKey(id); return highMerchantStoreMapper.selectByPrimaryKey(id);
} }
@Override
public List<HighMerchantStore> getStoreListByMer(Long merId) {
HighMerchantStoreExample example = new HighMerchantStoreExample();
example.createCriteria().andMerchantIdEqualTo(merId);
return highMerchantStoreMapper.selectByExample(example);
}
@Override @Override
public List<HighMerchantStore> getMerchantStoreList(Map<String, Object> map) { public List<HighMerchantStore> getMerchantStoreList(Map<String, Object> map) {
HighMerchantStoreExample example = new HighMerchantStoreExample(); HighMerchantStoreExample example = new HighMerchantStoreExample();

Loading…
Cancel
Save