Commit c20ebad3 authored by xinglei's avatar xinglei

修改bug

parent bea1dac1
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.fas.business.controller; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.fas.business.controller;
import java.util.Date; import java.util.Date;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -69,8 +70,9 @@ public class FireCarController extends BaseController { ...@@ -69,8 +70,9 @@ public class FireCarController extends BaseController {
//@Authorization(ingore = true) //@Authorization(ingore = true)
@ApiOperation(httpMethod = "POST", value = "上传消防车图片", notes = "上传消防车图片") @ApiOperation(httpMethod = "POST", value = "上传消防车图片", notes = "上传消防车图片")
@RequestMapping(value = "/uploadCarImg", produces = "application/json;charset=UTF-8", method = RequestMethod.POST) @RequestMapping(value = "/uploadCarImg", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse uploadCarImg(@ApiParam(value = "消防车图片", required = false) @RequestParam(value = "file" ,required = false) MultipartFile[] file,FireCar fireCar) { public CommonResponse uploadCarImg(@ApiParam(value = "消防车图片", required = false) @RequestParam(value = "file" ,required = false) MultipartFile[] file,FireCar fireCar, BindingResult bindingResult) {
System.out.print(fireCar);
ReginParams reginParams =getSelectedOrgInfo(); ReginParams reginParams =getSelectedOrgInfo();
String compCode=getOrgCode(reginParams); String compCode=getOrgCode(reginParams);
fireCar.setOrgCode(compCode); fireCar.setOrgCode(compCode);
...@@ -78,5 +80,4 @@ public class FireCarController extends BaseController { ...@@ -78,5 +80,4 @@ public class FireCarController extends BaseController {
fireCarService.saveFireCarAndPhoto(fireCar,file); fireCarService.saveFireCarAndPhoto(fireCar,file);
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} }
} }
...@@ -55,7 +55,12 @@ public class FireStationController extends BaseController { ...@@ -55,7 +55,12 @@ public class FireStationController extends BaseController {
fireStationFireEquipment.setCreateBy("0"); fireStationFireEquipment.setCreateBy("0");
fireStationFireEquipment.setCreateDate(new Date()); fireStationFireEquipment.setCreateDate(new Date());
} }
return CommonResponseUtil.success(iFireStationService.saveStationFireEquipment(fireStationFireEquipments)); try {
List<FireStationFireEquipment> fireStationFireEquipments1 = iFireStationService.saveStationFireEquipment(fireStationFireEquipments);
return CommonResponseUtil.success(fireStationFireEquipments1);
} catch (Exception e){
return CommonResponseUtil.failure(e.getMessage());
}
} }
@ApiOperation(httpMethod = "DELETE", value = "解除绑定消防设备", notes = "解除绑定消防设备") @ApiOperation(httpMethod = "DELETE", value = "解除绑定消防设备", notes = "解除绑定消防设备")
......
...@@ -105,7 +105,7 @@ public class FireCarServiceImpl implements IFireCarService { ...@@ -105,7 +105,7 @@ public class FireCarServiceImpl implements IFireCarService {
List<DepartmentModel> depts =remoteSecurityService.listDepartmentByDeptIds(toke, product, appKey, Joiner.on(",").join(deptIds)); List<DepartmentModel> depts =remoteSecurityService.listDepartmentByDeptIds(toke, product, appKey, Joiner.on(",").join(deptIds));
Map<Long, String> deptMap = depts.stream().collect(Collectors.toMap(DepartmentModel::getSequenceNbr,DepartmentModel::getDepartmentName)); Map<Long, String> deptMap = depts.stream().collect(Collectors.toMap(DepartmentModel::getSequenceNbr,DepartmentModel::getDepartmentName));
content.forEach(e -> { content.forEach(e -> {
e.put("departmentName",deptMap.get(e.get("dept_id"))); e.put("departmentName",deptMap.get(Long.valueOf(e.get("dept_id").toString())));
}); });
} }
} }
......
...@@ -588,9 +588,10 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -588,9 +588,10 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Override @Override
public Page<Map<String, Object>> listFmeaPointInputitem(String toke,String product,String appKey,Long fmeaId, Integer pageNumber, Integer pageSize) { public Page<Map<String, Object>> listFmeaPointInputitem(String toke,String product,String appKey,Long fmeaId, Integer pageNumber, Integer pageSize) {
List<Map<String, Object>> content = Lists.newArrayList(); List<Map<String, Object>> content = Lists.newArrayList();
CommonPageable pageable = new CommonPageable(pageNumber, pageSize);
long total = fmeaPointInputitemMapper.countByFmeaId(fmeaId); long total = fmeaPointInputitemMapper.countByFmeaId(fmeaId);
if (total == 0L) { if (total == 0L) {
return new PageImpl<>(content, null, total); return new PageImpl<>(content, pageable, total);
} }
content = fmeaPointInputitemMapper.listByFmeaId(fmeaId, pageNumber, pageSize); content = fmeaPointInputitemMapper.listByFmeaId(fmeaId, pageNumber, pageSize);
if(!CollectionUtils.isEmpty(content)){ if(!CollectionUtils.isEmpty(content)){
...@@ -621,14 +622,14 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -621,14 +622,14 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
e.put("tel",userMap.get(String.valueOf(e.get("deptId")+"tel"))); e.put("tel",userMap.get(String.valueOf(e.get("deptId")+"tel")));
}); });
} }
return new PageImpl<>(content, null, total); return new PageImpl<>(content, pageable, total);
} }
@Override @Override
public Page<Map<String, Object>> listFeamEquipmentPoint(Long fmeaId, Integer pageNumber, Integer pageSize) { public Page<Map<String, Object>> listFeamEquipmentPoint(Long fmeaId, Integer pageNumber, Integer pageSize) {
long total = fmeaEquipmentPointMapper.countByFmeaId(fmeaId); long total = fmeaEquipmentPointMapper.countByFmeaId(fmeaId);
List<Map<String, Object>> content = fmeaEquipmentPointMapper.listByFmeaId(fmeaId, pageNumber, pageSize); List<Map<String, Object>> content = fmeaEquipmentPointMapper.listByFmeaId(fmeaId, pageNumber, pageSize);
return new PageImpl<>(content, null, total); return new PageImpl<>(content, new CommonPageable(pageNumber, pageSize), total);
} }
......
...@@ -98,7 +98,7 @@ public class WaterResourceServiceImpl implements IWaterResourceService { ...@@ -98,7 +98,7 @@ public class WaterResourceServiceImpl implements IWaterResourceService {
for(WaterResourceEquipment waterResourceEquipment:waterResourceEquipments){ for(WaterResourceEquipment waterResourceEquipment:waterResourceEquipments){
WaterResourceEquipment saveWaterResourceEquipment = iWaterResourceEquipmentDao.findByWaterResourceIdAndFireEquipmentId(waterResourceEquipment.getWaterResourceId(),waterResourceEquipment.getFireEquipmentId()); WaterResourceEquipment saveWaterResourceEquipment = iWaterResourceEquipmentDao.findByWaterResourceIdAndFireEquipmentId(waterResourceEquipment.getWaterResourceId(),waterResourceEquipment.getFireEquipmentId());
if(StringUtil.isNotEmpty(saveWaterResourceEquipment)){ if(StringUtil.isNotEmpty(saveWaterResourceEquipment)){
deleteList.add(waterResourceEquipment); deleteList.add(saveWaterResourceEquipment);
} }
} }
iWaterResourceEquipmentDao.deleteAll(deleteList); iWaterResourceEquipmentDao.deleteAll(deleteList);
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
left join f_risk_source frs on frs.id = f.risk_source_id left join f_risk_source frs on frs.id = f.risk_source_id
WHERE WHERE
fs.fire_station_id = ${fireStationId} fs.fire_station_id = ${fireStationId}
and f.id is not null
LIMIT ${start}, ${length}; LIMIT ${start}, ${length};
</select> </select>
......
...@@ -100,6 +100,7 @@ ...@@ -100,6 +100,7 @@
left join f_risk_source frs on frs.id = f.risk_source_id left join f_risk_source frs on frs.id = f.risk_source_id
WHERE WHERE
fs.water_resource_id = ${waterResourceId} fs.water_resource_id = ${waterResourceId}
and f.id is not null
LIMIT ${start}, ${length}; LIMIT ${start}, ${length};
</select> </select>
......
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