提交代码

dev
胡锐 5 months ago
parent 71a6abe081
commit fa93ea3404
  1. 15
      bweb/src/main/java/com/bweb/controller/BsDeviceController.java
  2. 79
      bweb/src/main/java/com/bweb/controller/BsGasClassGroupTaskController.java
  3. 17
      service/src/main/java/com/hfkj/dao/BsGasOilPriceMapperExt.java
  4. 12
      service/src/main/java/com/hfkj/service/impl/BsDeviceServiceImpl.java
  5. 7
      service/src/main/java/com/hfkj/service/order/OrderCreateService.java

@ -178,12 +178,19 @@ public class BsDeviceController {
SecUserSessionObject sessionModel = userCenter.getSessionModel(SecUserSessionObject.class);
if (sessionModel == null) {
log.error("HighDeviceController -> getDeviceList() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到");
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, "");
}
Map<String, Object> param = new HashMap<>();
param.put("merNo", merNo);
if (sessionModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type1.getCode())) {
param.put("merNo", merNo);
} else if (sessionModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) {
param.put("merNo", sessionModel.getMerchant().getMerNo());
} else if (sessionModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode())) {
param.put("merNo", sessionModel.getMerchant().getMerNo());
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, "");
}
param.put("merName", merName);
param.put("deviceName", deviceName);
PageHelper.startPage(pageNum, pageSize);

@ -72,18 +72,10 @@ public class BsGasClassGroupTaskController {
if (body == null || body.getLong("gasClassGroupId") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
Long gasId = null;
if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) {
gasId = userInfoModel.getAccount().getObjectId();
} else if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode())) {
// 查询油站工作人员
BsGasStaff gasStaff = gasStaffService.getStaffDetailById(userInfoModel.getAccount().getObjectId());
if (gasStaff == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
gasId = gasStaff.getMerId();
if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())
|| userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode())) {
gasId = userInfoModel.getMerchant().getId();
}
gasClassGroupTaskService.startGroupTask(gasId, body.getLong("gasClassGroupId"));
@ -102,22 +94,10 @@ public class BsGasClassGroupTaskController {
public ResponseData endGroupTask() {
try {
SecUserSessionObject userInfoModel = userCenter.getSessionModel(SecUserSessionObject.class);
if (userInfoModel == null ||
(!userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())
&& !userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode()))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS);
}
Long gasId = null;
if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) {
gasId = userInfoModel.getAccount().getObjectId();
} else if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode())) {
// 查询油站工作人员
BsGasStaff gasStaff = gasStaffService.getStaffDetailById(userInfoModel.getAccount().getObjectId());
if (gasStaff == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
gasId = gasStaff.getMerId();
if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())
|| userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode())) {
gasId = userInfoModel.getMerchant().getId();
}
gasClassGroupTaskService.endGroupTask(gasId);
@ -138,24 +118,11 @@ public class BsGasClassGroupTaskController {
if (body == null || body.getLong("gasClassGroupId") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
SecUserSessionObject userInfoModel = userCenter.getSessionModel(SecUserSessionObject.class);
if (userInfoModel == null ||
(!userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())
&& !userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode()))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS);
}
Long gasId = null;
if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) {
gasId = userInfoModel.getAccount().getObjectId();
} else if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode())) {
// 查询油站工作人员
BsGasStaff gasStaff = gasStaffService.getStaffDetailById(userInfoModel.getAccount().getObjectId());
if (gasStaff == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
gasId = gasStaff.getMerId();
if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())
|| userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode())) {
gasId = userInfoModel.getMerchant().getId();
}
gasClassGroupTaskService.swapGroupTask(gasId, body.getLong("gasClassGroupId"));
@ -178,18 +145,12 @@ public class BsGasClassGroupTaskController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS);
}
Map<String,Object> param = new HashMap<>();
if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) {
gasId = userInfoModel.getAccount().getObjectId();
} else if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode())) {
// 查询油站工作人员
BsGasStaff gasStaff = gasStaffService.getStaffDetailById(userInfoModel.getAccount().getObjectId());
if (gasStaff == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
gasId = gasStaff.getMerId();
if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())
|| userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode())) {
gasId = userInfoModel.getMerchant().getId();
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, "");
}
GasClassGroupTaskDataCount dataCount;
param.put("merId", gasId);
@ -253,15 +214,9 @@ public class BsGasClassGroupTaskController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, "");
}
if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) {
param.put("merchantStoreId", userInfoModel.getAccount().getObjectId());
} else if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode())) {
// 查询油站工作人员
BsGasStaff gasStaff = gasStaffService.getStaffDetailById(userInfoModel.getAccount().getObjectId());
if (gasStaff == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
param.put("merchantStoreId", gasStaff.getMerId());
if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())
|| userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode())) {
param.put("merId", userInfoModel.getMerchant().getId());
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, "");
}

@ -20,17 +20,20 @@ public interface BsGasOilPriceMapperExt {
" and a.province_code = #{regionId} " +
" and b.oil_no = #{oilNo} "})
@Results({
@Result(column="id", property="id", jdbcType= JdbcType.BIGINT, id=true),
@Result(column="merchant_store_id", property="merchantStoreId", jdbcType=JdbcType.BIGINT),
@Result(column="oil_no", property="oilNo", jdbcType=JdbcType.INTEGER),
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
@Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR),
@Result(column="oil_type", property="oilType", jdbcType=JdbcType.INTEGER),
@Result(column="oil_type_name", property="oilTypeName", jdbcType=JdbcType.VARCHAR),
@Result(column="oil_no", property="oilNo", jdbcType=JdbcType.VARCHAR),
@Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR),
@Result(column="preferential_margin", property="preferentialMargin", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_station_drop", property="gasStationDrop", jdbcType=JdbcType.DECIMAL),
@Result(column="price_vip", property="priceVip", jdbcType=JdbcType.DECIMAL),
@Result(column="price_gun", property="priceGun", jdbcType=JdbcType.DECIMAL),
@Result(column="price_official", property="priceOfficial", jdbcType=JdbcType.DECIMAL),
@Result(column="oil_type", property="oilType", jdbcType=JdbcType.INTEGER),
@Result(column="oil_type_name", property="oilTypeName", jdbcType=JdbcType.VARCHAR),
@Result(column="price_gun", property="priceGun", jdbcType=JdbcType.DECIMAL),
@Result(column="price_vip", property="priceVip", jdbcType=JdbcType.DECIMAL),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),

@ -60,16 +60,12 @@ public class BsDeviceServiceImpl implements BsDeviceService {
criteria.andTypeEqualTo(MapUtils.getInteger(param, "type"));
}
if (MapUtils.getLong(param, "companyId") != null) {
criteria.andCompanyIdEqualTo(MapUtils.getLong(param, "companyId"));
if (StringUtils.isNotBlank(MapUtils.getString(param, "merNo"))) {
criteria.andMerNoEqualTo(MapUtils.getString(param, "merNo"));
}
if (MapUtils.getLong(param, "agentId") != null) {
criteria.andAgentIdEqualTo(MapUtils.getLong(param, "agentId"));
}
if (MapUtils.getLong(param, "merId") != null) {
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, "deviceName"))) {

@ -46,6 +46,13 @@ public class OrderCreateService {
@Resource
private BsGasStaffService gasStaffService;
/**
* 加油业务
* @param order 订单
* @param orderDeduction 优惠
* @param orderChild 商品订单
* @return
*/
public OrderChildModel oilHandle(BsOrder order, BsOrderDeduction orderDeduction, OrderChildModel orderChild) {
// 查询油品类型
SecDictionary gasOilType = secDictionaryService.getDictionary("OIL_NO", orderChild.getGasOilNo());

Loading…
Cancel
Save