Commit 69702d87 authored by 李秀明's avatar 李秀明

Merge remote-tracking branch 'origin/develop_dl' into develop_dl

parents 5823adfc de447d40
......@@ -494,6 +494,62 @@ public class FireFightingSystemController extends AbstractBaseController {
}
@GetMapping(value = "/getEquipTypeAmountCarJxiop")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "九大类下装备,通过code截取", notes = "九大类下装备信息列表")
public IPage<EquipTypeImgAmountVO> getEquipTypeAmountCarJxiopGet(EquipTypeAmountPageDTO equipTypeAmountPage) {
String[] result = hierarchy.split(",");
Map<Integer, Integer> map = new HashMap<>();
for (int i = 0; i < result.length; i++) {
map.put(i, Integer.valueOf(result[i]));
}
log.info("orgCode当前值为start::" + equipTypeAmountPage.getBizOrgCode());
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
if (ObjectUtils.isEmpty(equipTypeAmountPage.getBizOrgCode())) {
if (!ObjectUtils.isEmpty(reginParams.getCompany().getOrgCode())) {
equipTypeAmountPage.setBizOrgCode(reginParams.getCompany().getOrgCode());
} else {
equipTypeAmountPage.setBizOrgCode("-1");
}
} else {
if (!ObjectUtils.isEmpty(reginParams.getCompany().getOrgCode()) && (equipTypeAmountPage.getBizOrgCode().startsWith(reginParams.getCompany().getOrgCode()))) {
} else {
equipTypeAmountPage.setBizOrgCode(reginParams.getCompany().getOrgCode());
}
}
log.info("orgCode当前值为::" + equipTypeAmountPage.getBizOrgCode());
if (StringUtil.isNotEmpty(equipTypeAmountPage.getEquipmentClassificationCode())) {
QueryWrapper<EquipmentCategory> equipmentCategoryQueryWrapper = new QueryWrapper<>();
equipmentCategoryQueryWrapper.eq("code", equipTypeAmountPage.getEquipmentClassificationCode());
equipmentCategoryQueryWrapper.eq("industry_code", equipTypeAmountPage.getIndustryCode());
EquipmentCategory equipmentCategory = equipmentCategoryService.getOne(equipmentCategoryQueryWrapper);
if (equipmentCategory == null) {
throw new RuntimeException("装备定义code有误");
}
int inhierarchy = 1;
for (int i = 0; i < result.length + 1; i++) {
//进来先判断是否默认就是空,如果为空第一层
if (equipmentCategory.getParentId() == null) {
//判断是否是最下面的子节点
if (i >= 4) {
inhierarchy = 8;
} else {
inhierarchy = map.get(i);
}
break;
} else {
//查找到循环几次为空
equipmentCategory = equipmentCategoryService.getById(equipmentCategory.getParentId());
}
}
return fireFightingSystemService.getColaCategoryAmountCarListJxiop(inhierarchy, equipTypeAmountPage.getEquipmentClassificationCode().substring(0, inhierarchy), equipTypeAmountPage);
} else {
return fireFightingSystemService.getColaCategoryAmountCarListJxiop(0, null, equipTypeAmountPage);
}
}
@PostMapping(value = "/getEquipTypeAmountCarJxiop")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "九大类下装备,通过code截取-江西电建", notes = "九大类下装备信息列表-江西电建")
......
......@@ -187,7 +187,7 @@ public interface ICarService extends IService<Car> {
IPage getQRCode(Long id);
List<Car> location();
List<Car> location(String orgCode);
// 获取车辆总数
Map<String,Integer> getCountOfCar();
......
......@@ -1442,8 +1442,8 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements ICarS
}
@Override
public List<Car> location() {
List<Car> list = this.list();
public List<Car> location(String orgCode) {
List<Car> list = this.list(new LambdaQueryWrapper<Car>().like(Car::getBizOrgCode, orgCode));
return list;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment