Commit 9a21c718 authored by wdy's avatar wdy

编辑标准库

parent f1757658
...@@ -2,6 +2,7 @@ package com.ruoyi.service; ...@@ -2,6 +2,7 @@ package com.ruoyi.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.domain.Standard; import com.ruoyi.domain.Standard;
import com.ruoyi.web.request.StandardEditRequest;
import com.ruoyi.web.request.StandardListRequest; import com.ruoyi.web.request.StandardListRequest;
import java.util.List; import java.util.List;
...@@ -16,4 +17,6 @@ public interface StandardService extends IService<Standard> { ...@@ -16,4 +17,6 @@ public interface StandardService extends IService<Standard> {
//根据id查询 //根据id查询
Standard findListById(Long id); Standard findListById(Long id);
void editStandard(StandardEditRequest request);
} }
package com.ruoyi.service.impl; package com.ruoyi.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.domain.Standard; import com.ruoyi.domain.Standard;
import com.ruoyi.mapper.StandardMapper; import com.ruoyi.mapper.StandardMapper;
import com.ruoyi.service.StandardService; import com.ruoyi.service.StandardService;
import com.ruoyi.web.request.StandardEditRequest;
import com.ruoyi.web.request.StandardListRequest; import com.ruoyi.web.request.StandardListRequest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -16,6 +18,9 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i ...@@ -16,6 +18,9 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
@Autowired @Autowired
private StandardMapper standardMapper; private StandardMapper standardMapper;
@Autowired
private StandardService standardService;
/** /**
* 分页查询 * 分页查询
* @param * @param
...@@ -35,4 +40,12 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i ...@@ -35,4 +40,12 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
public Standard findListById(Long id) { public Standard findListById(Long id) {
return standardMapper.findListById(id); return standardMapper.findListById(id);
} }
@Override
public void editStandard(StandardEditRequest request) {
Standard standard = new Standard();
BeanUtils.copyBeanProp(standard, request);
standardService.updateById(standard);
}
} }
package com.ruoyi.web; package com.ruoyi.web;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.domain.Standard; import com.ruoyi.domain.Standard;
import com.ruoyi.service.StandardService; import com.ruoyi.service.StandardService;
import com.ruoyi.web.request.ReviewSceneChangeTaskFindPendingRequest; import com.ruoyi.web.request.ReviewSceneChangeTaskFindPendingRequest;
import com.ruoyi.web.request.StandardEditRequest;
import com.ruoyi.web.request.StandardListRequest; import com.ruoyi.web.request.StandardListRequest;
import com.ruoyi.web.request.TaskEditRequest;
import com.ruoyi.web.response.ReviewSceneChangeTaskResponse; import com.ruoyi.web.response.ReviewSceneChangeTaskResponse;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -39,4 +44,14 @@ public class StandardController extends BaseController { ...@@ -39,4 +44,14 @@ public class StandardController extends BaseController {
startPage(request); startPage(request);
return getDataTable(standardService.findList()); return getDataTable(standardService.findList());
} }
@ApiOperation("编辑标准库")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "编辑任务", businessType = BusinessType.UPDATE)
@RequestMapping(method = RequestMethod.POST, value = "/editStandard")
public R<String> editTask(@Validated @RequestBody StandardEditRequest request) {
standardService.editStandard(request);
return R.ok();
}
} }
package com.ruoyi.web.request;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.page.PageDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@ApiModel(value = "StandardEditRequest", description = "编辑标准")
@Data
public class StandardEditRequest {
@ApiModelProperty("主键")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id;
@ApiModelProperty("标准名称")
private String name;
@ApiModelProperty("标准号")
private String standardNo;
@ApiModelProperty("文件路径")
private String file;
@ApiModelProperty("标准分类")
private String standardType;
@ApiModelProperty("标准状态")
private String standardStatus;
@ApiModelProperty("发布日期")
private Date releaseDate;
@ApiModelProperty("实施日期")
private Date implementationDate;
}
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