|
@@ -97,9 +97,9 @@ public class TargetManagementService {
|
|
|
TargetManagement target = new TargetManagement();
|
|
|
target.setId(dto.getId());
|
|
|
target.setPid(dto.getPid());
|
|
|
- List<ZbZdBaseInfo> zdBaseInfos = zbZdDao.selectZbZdBaseInfo(target);
|
|
|
+ ZbZdBaseInfo zdBaseInfo = zbZdDao.selectZbZdBaseInfoById(target);
|
|
|
int num = 0;
|
|
|
- if(zdBaseInfos != null && zdBaseInfos.size() > 0){
|
|
|
+ if(zdBaseInfo != null){
|
|
|
num = zbZdDao.updateZbZdBaseInfo(dto);
|
|
|
} else {
|
|
|
num = zbZdDao.saveZbZdBaseInfo(dto);
|
|
@@ -281,5 +281,26 @@ public class TargetManagementService {
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ /**
|
|
|
+ * @description: 根据id和父id删除指标字典
|
|
|
+ * @author: hsh
|
|
|
+ * @date: 2023/6/21 11:05
|
|
|
+ * @param: [dto]
|
|
|
+ * @return: ResultVo<Map<String,Object>>
|
|
|
+ **/
|
|
|
+ public ResultVo<Map<String, Object>> deleteTargetDictById(TargetManagement dto) {
|
|
|
+ if(StringUtil.isBlank(dto.getId())){
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "id不存在,请检查!");
|
|
|
+ }
|
|
|
+ if(StringUtil.isBlank(dto.getPid())){
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "父id不存在,请检查!");
|
|
|
+ }
|
|
|
+ Map<String, Object> resultMap = new HashMap<>();
|
|
|
+ int num = zbZdDao.deleteTargetDictById(dto.getId(), dto.getPid());
|
|
|
+ if(num == 0){
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "删除指标字典失败!");
|
|
|
+ }
|
|
|
+ resultMap.put("cg", "删除指标字典成功!");
|
|
|
+ return ResultVoUtil.success(resultMap);
|
|
|
+ }
|
|
|
}
|