jinlin
2024-03-07 d8782e732928cebcf0a6ae09527d06391b22f55b
修改
2个文件已修改
63 ■■■■■ 已修改文件
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/ParamDataExpectController.java 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/basicInfo/ParamDataExpect.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/ParamDataExpectController.java
@@ -30,12 +30,12 @@
/**
 * param_data_expect
 *
 * @author zt generator
 * @author zt generator
 * @since 1.0.0 2024-03-04
 */
@RestController
@RequestMapping("/basicInfo/ParamDataExpect/")
@Api(tags="param_data_expect")
@Api(tags = "param_data_expect")
public class ParamDataExpectController {
    @Autowired
    private ParamDataExpectService paramDataExpectService;
@@ -43,56 +43,47 @@
    @GetMapping("page")
    @ApiOperation("分页")
    @ApiImplicitParams({
        @ApiImplicitParam(name = Constant.Q.PAGE, value = Constant.QV.PAGE, required = true, dataType = Constant.QT.INT),
        @ApiImplicitParam(name = Constant.Q.LIMIT, value = Constant.QV.LIMIT, required = true, dataType = Constant.QT.INT),
        @ApiImplicitParam(name = Constant.Q.ORDER_FIELD, value = Constant.QV.ORDER_FIELD, dataType = Constant.QT.STRING),
        @ApiImplicitParam(name = Constant.Q.ORDER, value = Constant.QV.ORDER, dataType = Constant.QT.STRING),
        @ApiImplicitParam(name = "name", value = "名称", dataType = Constant.QT.STRING, format = "NAME^LK"),
        @ApiImplicitParam(name = "nodeType", value = "类型", dataType = Constant.QT.STRING),
        @ApiImplicitParam(name = "srcId", value = "上级ID", dataType = Constant.QT.STRING)})
    public PageResult<ParamDataExpect> page(@ApiIgnore @QueryParam QueryFilter queryFilter){
            @ApiImplicitParam(name = Constant.Q.PAGE, value = Constant.QV.PAGE, required = true, dataType = Constant.QT.INT),
            @ApiImplicitParam(name = Constant.Q.LIMIT, value = Constant.QV.LIMIT, required = true, dataType = Constant.QT.INT),
            @ApiImplicitParam(name = Constant.Q.ORDER_FIELD, value = Constant.QV.ORDER_FIELD, dataType = Constant.QT.STRING),
            @ApiImplicitParam(name = Constant.Q.ORDER, value = Constant.QV.ORDER, dataType = Constant.QT.STRING),
            @ApiImplicitParam(name = "name", value = "名称", dataType = Constant.QT.STRING, format = "NAME^LK"),
            @ApiImplicitParam(name = "nodeType", value = "类型", dataType = Constant.QT.STRING),
            @ApiImplicitParam(name = "srcId", value = "上级ID", dataType = Constant.QT.STRING)})
    public PageResult<ParamDataExpect> page(@ApiIgnore @QueryParam QueryFilter queryFilter) {
        return PageResult.ok(paramDataExpectService.page(queryFilter));
    }
    @PostMapping("get")
    public Result getSelect(@RequestBody List<ParamDataExpect> list){
        for(ParamDataExpect ParamDataExpect:list){
    public Result getSelect(@RequestBody List<ParamDataExpect> list) {
        for (ParamDataExpect ParamDataExpect : list) {
            ParamDataExpect.setProductId(ParamDataExpect.getId());
            ParamDataExpect.setId(null);
            this.insert(ParamDataExpect);
            paramDataExpectService.insert(ParamDataExpect);
        }
        return Result.ok();
    }
    @GetMapping("{id}")
    @ApiOperation("信息")
    public Result<ParamDataExpect> get(@PathVariable("id") Long id){
    public Result<ParamDataExpect> get(@PathVariable("id") Long id) {
        ParamDataExpect data = paramDataExpectService.get(id);
        return Result.ok(data);
    }
    @PostMapping
    @ApiOperation("新增")
    @LogOperation("新增")
    public Result insert(@RequestBody ParamDataExpect paramDataExpect){
    @PostMapping("save")
    public Result save(@RequestBody ParamDataExpect paramDataExpect) {
        //效验数据
        ValidatorUtils.validateEntity(paramDataExpect, AddGroup.class, DefaultGroup.class);
        paramDataExpectService.insert(paramDataExpect);
        return Result.ok();
    }
    @PutMapping
    @ApiOperation("修改")
    @LogOperation("修改")
    public Result update(@RequestBody ParamDataExpect paramDataExpect){
        //效验数据
        for (ParamDataExpect expect:paramDataExpect.getDataThreeList()){
            ValidatorUtils.validateEntity(expect, UpdateGroup.class, DefaultGroup.class);
            paramDataExpectService.update(expect);
        for (ParamDataExpect expect : paramDataExpect.getDataThreeList()) {
            if (expect.getId()!=null){
                ValidatorUtils.validateEntity(expect, UpdateGroup.class, DefaultGroup.class);
                paramDataExpectService.update(expect);
            }else{
                ValidatorUtils.validateEntity(expect, AddGroup.class, DefaultGroup.class);
                paramDataExpectService.insert(expect);
            }
        }
        return Result.ok();
    }
@@ -100,7 +91,7 @@
    @DeleteMapping
    @ApiOperation("删除")
    @LogOperation("删除")
    public Result delete(@RequestBody Long[] ids){
    public Result delete(@RequestBody Long[] ids) {
        //效验数据
        AssertUtils.isArrayEmpty(ids, "id");
        paramDataExpectService.delete(ids);
web/src/views/modules/basicInfo/ParamDataExpect.vue
@@ -200,7 +200,7 @@
              <!--  <zt-table-column-dict v-if="dataForm.nodeType==='2'" :key="27" prop="reliabDistribType" label="可靠性分布类型"
                                      width="160"/>-->
              <el-table-column prop="reliabDistribType" label="可靠性分布类型" :key="27" width="160">
              <el-table-column v-if="dataForm.nodeType==='2'" prop="reliabDistribType" label="可靠性分布类型" :key="27" width="160">
                <template v-slot="{ row }">
                  <el-select v-if="row.isEdit" v-model="row.reliabDistribType"
                             placeholder="当前状态">
@@ -314,7 +314,7 @@
      async handleSaveRows() {
        this.dataForm.dataThreeList = this.$refs.tableObj.dataList
        console.log(this.dataForm, 'this.dataForm this.dataForm')
        let res = await this.$http.post('/basicInfo/ParamDataExpect/', this.dataForm)
        let res = await this.$http.post('/basicInfo/ParamDataExpect/save', this.dataForm)
        if (res.success) {
          console.log(res.data)
          await this.$tip.success()