|
@@ -16,6 +16,7 @@ import com.hfln.portal.common.dto.data.dic.DicDTO;
|
|
|
import com.hfln.portal.common.dto.data.menu.MenuListDTO;
|
|
|
import com.hfln.portal.common.dto.data.menu.MenuTreeDTO;
|
|
|
import com.hfln.portal.common.dto.data.role.RoleListDTO;
|
|
|
+import com.hfln.portal.common.dto.data.param.ParameterDTO;
|
|
|
import com.hfln.portal.common.dto.data.rolemenu.MenuSimpleTreeDTO;
|
|
|
import com.hfln.portal.common.dto.data.rolemenu.RoleMenuTreeDTO;
|
|
|
import com.hfln.portal.common.request.device.DeviceListQueryReq;
|
|
@@ -105,6 +106,54 @@ public class WebGatewayImpl implements WebGateway {
|
|
|
@Autowired
|
|
|
private OssClient ossClient;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TblParameterService tblParameterService;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void upsertParameter(ParameterUpsertParam param) {
|
|
|
+ // 如果有ID则更新,否则新增
|
|
|
+ if (param.getParamId() != null) {
|
|
|
+ TblParameter exist = tblParameterService.getById(param.getParamId());
|
|
|
+ if (exist == null) {
|
|
|
+ throw new BizException(ErrorEnum.DATA_NOT_EXISTS.getErrorCode(), ErrorEnum.DATA_NOT_EXISTS.getErrorMessage());
|
|
|
+ }
|
|
|
+ exist.setParamCode(param.getParamCode());
|
|
|
+ exist.setParamName(param.getParamName());
|
|
|
+ exist.setParamValue(param.getParamValue());
|
|
|
+ exist.setParamDesc(param.getParamDesc());
|
|
|
+ exist.setRemark(param.getRemark());
|
|
|
+ tblParameterService.updateById(exist);
|
|
|
+ } else {
|
|
|
+ TblParameter entity = new TblParameter();
|
|
|
+ entity.setParamCode(param.getParamCode());
|
|
|
+ entity.setParamName(param.getParamName());
|
|
|
+ entity.setParamValue(param.getParamValue());
|
|
|
+ entity.setParamDesc(param.getParamDesc());
|
|
|
+ entity.setRemark(param.getRemark());
|
|
|
+ entity.setIsDeleted(BasePO.DeleteFlag.NOT_DELETED);
|
|
|
+ tblParameterService.save(entity);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void deleteParameter(Long paramId) {
|
|
|
+ TblParameter exist = tblParameterService.getById(paramId);
|
|
|
+ if (exist == null) {
|
|
|
+ throw new BizException(ErrorEnum.DATA_NOT_EXISTS.getErrorCode(), ErrorEnum.DATA_NOT_EXISTS.getErrorMessage());
|
|
|
+ }
|
|
|
+ exist.setIsDeleted(BasePO.DeleteFlag.DELETED);
|
|
|
+ tblParameterService.removeById(exist);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<ParameterDTO> queryParameter(ParameterQueryParam param) {
|
|
|
+ List<TblParameter> list = tblParameterService.lambdaQuery()
|
|
|
+ .eq(StringUtils.hasText(param.getParamCode()), TblParameter::getParamCode, param.getParamCode())
|
|
|
+ .eq(TblParameter::getIsDeleted, BasePO.DeleteFlag.NOT_DELETED)
|
|
|
+ .list();
|
|
|
+ return CopyUtils.copyList(list, ParameterDTO.class);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public UploadRes uploadDev(MultipartFile file) throws IOException {
|
|
|
|