Commit d7fddee7 authored by Tkunkun's avatar Tkunkun

部件的更新和删除修改

parent 747a3dd1
...@@ -280,6 +280,7 @@ public class EquipmentCategoryController extends AbstractBaseController { ...@@ -280,6 +280,7 @@ public class EquipmentCategoryController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "数据树形结构返回", notes = "数据树形结构返回") @ApiOperation(httpMethod = "GET", value = "数据树形结构返回", notes = "数据树形结构返回")
public List<EquipmentCategory> tree(@PathVariable String type) { public List<EquipmentCategory> tree(@PathVariable String type) {
return iEquipmentCategoryService.tree(type); return iEquipmentCategoryService.tree(type);
} }
......
...@@ -91,6 +91,7 @@ public class EquipmentDetailController extends AbstractBaseController { ...@@ -91,6 +91,7 @@ public class EquipmentDetailController extends AbstractBaseController {
@Autowired @Autowired
private ISyncDataService syncDataService; private ISyncDataService syncDataService;
@Value("${systemctl.sync.switch}") @Value("${systemctl.sync.switch}")
private Boolean syncSwitch; private Boolean syncSwitch;
...@@ -253,8 +254,12 @@ public class EquipmentDetailController extends AbstractBaseController { ...@@ -253,8 +254,12 @@ public class EquipmentDetailController extends AbstractBaseController {
} }
//1.更新装备实例Detail数据 //1.更新装备实例Detail数据
EquipmentDetail equipmentDetail = equipmentDate.getEquipmentDetail(); EquipmentDetail equipmentDetail = equipmentDate.getEquipmentDetail();
EquipmentParams equipmentParams = equipmentDate.getEquipmentParams();
final EquipmentDetail dateEquipmentDetail = equipmentDate.getEquipmentDetail(); final EquipmentDetail dateEquipmentDetail = equipmentDate.getEquipmentDetail();
iEquipmentDetailService.updateOneById(equipmentDate.getEquipmentSpecific().getId(), dateEquipmentDetail); boolean b = iEquipmentDetailService.updateOneById(equipmentDate.getEquipmentSpecific().getId(), dateEquipmentDetail);
if(b){
equipmentParamsService.updateById(equipmentDate.getEquipmentParams());
}
//2.更新装备实例主表数据 //2.更新装备实例主表数据
Long detailId = dateEquipmentDetail.getId(); Long detailId = dateEquipmentDetail.getId();
equipmentDate.getEquipmentSpecific().setEquipmentDetailId(detailId); equipmentDate.getEquipmentSpecific().setEquipmentDetailId(detailId);
...@@ -392,7 +397,7 @@ public class EquipmentDetailController extends AbstractBaseController { ...@@ -392,7 +397,7 @@ public class EquipmentDetailController extends AbstractBaseController {
* @return * @return
*/ */
@RequestMapping(value = "/list/category/{category}", method = RequestMethod.GET) @RequestMapping(value = "/list/category/{category}", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET", value = "列表分类查询", notes = "列表分类查询") @ApiOperation(httpMethod = "GET", value = "列表分类查询", notes = "列表分类查询")
public IPage<EquipmentDetail> list(String pageNum, String pageSize, @PathVariable String category) { public IPage<EquipmentDetail> list(String pageNum, String pageSize, @PathVariable String category) {
Page<EquipmentDetail> pageBean; Page<EquipmentDetail> pageBean;
......
...@@ -289,9 +289,11 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -289,9 +289,11 @@ public class FireFightingSystemController extends AbstractBaseController {
} }
} }
return fireFightingSystemService.getColaCategoryAmountList(inhierarchy, equipTypeAmountPage.getEquipmentClassificationCode().substring(0, inhierarchy), equipTypeAmountPage); IPage<EquipTypeImgAmountVO> colaCategoryAmountList1 = fireFightingSystemService.getColaCategoryAmountList(inhierarchy, equipTypeAmountPage.getEquipmentClassificationCode().substring(0, inhierarchy), equipTypeAmountPage);
return colaCategoryAmountList1;
} else { } else {
return fireFightingSystemService.getColaCategoryAmountList(0, null, equipTypeAmountPage); IPage<EquipTypeImgAmountVO> colaCategoryAmountList = fireFightingSystemService.getColaCategoryAmountList(0, null, equipTypeAmountPage);
return colaCategoryAmountList;
} }
} }
......
...@@ -190,6 +190,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -190,6 +190,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Lazy @Lazy
IEquipmentSpecificAlarmService equipmentSpecificAlarmService; IEquipmentSpecificAlarmService equipmentSpecificAlarmService;
@Autowired
private IEquipmentParamsService equipmentParamsService;
@Value("${systemctl.sync.switch}") @Value("${systemctl.sync.switch}")
private Boolean syncSwitch; private Boolean syncSwitch;
...@@ -997,7 +1000,15 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -997,7 +1000,15 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
throw new RuntimeException("设备与" + sysErrorMeg + buildErrorMeg + "存在绑定关系,无法删除"); throw new RuntimeException("设备与" + sysErrorMeg + buildErrorMeg + "存在绑定关系,无法删除");
} }
if (this.baseMapper.selectCount(wrapper) == 0) { if (this.baseMapper.selectCount(wrapper) == 0) {
equipmentDetailService.removeById(equipmentSpecific.getEquipmentDetailId()); Long euqipId= equipmentSpecific.getEquipmentDetailId();
String eqcode = equipmentDetailService.getOneById(euqipId).getEqcode();
boolean b = equipmentDetailService.removeById(euqipId);
if(b){
Map<String, Object> map = new HashMap<>();
map.put("code",eqcode);
equipmentParamsService.removeByMap(map);
}
} }
if (res > 0) { if (res > 0) {
return true; return true;
......
...@@ -27,7 +27,7 @@ security.appKeyApp=studio_normalapp_3056965 ...@@ -27,7 +27,7 @@ security.appKeyApp=studio_normalapp_3056965
spring.redis.database=1 spring.redis.database=1
spring.redis.host=192.168.1.114 spring.redis.host=192.168.1.114
spring.redis.port=6379 spring.redis.port=6379
spring.redis.password=1234560 spring.redis.password=yeejoin@2020
spring.redis.lettuce.pool.max-active=200 spring.redis.lettuce.pool.max-active=200
spring.redis.lettuce.pool.max-wait=-1 spring.redis.lettuce.pool.max-wait=-1
spring.redis.lettuce.pool.max-idle=10 spring.redis.lettuce.pool.max-idle=10
......
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