|
@@ -1,19 +1,23 @@
|
|
|
package com.gqy.web.controller.document;
|
|
|
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
|
+import com.gqy.common.core.domain.AjaxResult;
|
|
|
import com.gqy.common.core.domain.AjaxResultCQY;
|
|
|
import com.gqy.common.core.page.TableDataInfo;
|
|
|
+import com.gqy.common.utils.StringUtils;
|
|
|
import com.gqy.common.utils.bean.BeanUtils;
|
|
|
import com.gqy.document.domain.DcParams;
|
|
|
+import com.gqy.document.domain.DcTemplate;
|
|
|
+import com.gqy.document.domain.vo.PageResult;
|
|
|
import com.gqy.document.service.IDcParamsService;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
import springfox.documentation.schema.Maps;
|
|
|
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
@@ -31,12 +35,61 @@ public class ParamsController {
|
|
|
* 查询参数列表
|
|
|
*/
|
|
|
@PostMapping("/search")
|
|
|
- public AjaxResultCQY search(@RequestBody Maps params)
|
|
|
+ public AjaxResultCQY search(@RequestBody Map<String, Object> params)
|
|
|
{
|
|
|
- DcParams paramsReq = BeanUtils.mapToBean((Map<String, Object>) params, DcParams.class);
|
|
|
+ DcParams dcParamsReq = BeanUtils.mapToBean((Map<String, Object>) params, DcParams.class);
|
|
|
|
|
|
-// return paramsService.search(params);
|
|
|
- return null;
|
|
|
+ String page = params.get("page").toString();
|
|
|
+ String pageSizeStr = params.get("pageSize").toString();
|
|
|
+ Integer pageNum = StringUtils.isNotEmpty(page) ? Integer.valueOf(page) : 1;
|
|
|
+ Integer pageSize = StringUtils.isNotEmpty(pageSizeStr) ? Integer.valueOf(pageSizeStr) : 10;
|
|
|
+ PageHelper.startPage(pageNum, pageSize);
|
|
|
+
|
|
|
+ List<DcParams> listDcParams = iDcParamsService.search(dcParamsReq);
|
|
|
+
|
|
|
+ // 3. 获取分页信息
|
|
|
+ PageInfo<DcParams> pageInfo = new PageInfo<>(listDcParams);
|
|
|
+
|
|
|
+ // 4. 封装并返回结果
|
|
|
+ PageResult PageResult= new PageResult(
|
|
|
+ pageInfo.getPageNum(),
|
|
|
+ pageInfo.getPageSize(),
|
|
|
+ pageInfo.getPages(),
|
|
|
+ pageInfo.getTotal(),
|
|
|
+ pageInfo.getList());
|
|
|
+
|
|
|
+ return AjaxResultCQY.success("查询成功", PageResult);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增参数配置
|
|
|
+ */
|
|
|
+ @PostMapping("/create")
|
|
|
+// @PreAuthorize("@ss.hasPermi('system:params:add')")
|
|
|
+ public AjaxResultCQY create(@RequestBody DcParams params)
|
|
|
+ {
|
|
|
+ return iDcParamsService.create(params);
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("/info")
|
|
|
+// @PreAuthorize("@ss.hasPermi('system:params:query')")
|
|
|
+ public AjaxResultCQY info(@RequestBody Map id)
|
|
|
+ {
|
|
|
+ String idStr = id.get("id").toString();
|
|
|
+ return iDcParamsService.info(new Long(idStr));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改参数配置
|
|
|
+ */
|
|
|
+ @PostMapping("/update")
|
|
|
+// @PreAuthorize("@ss.hasPermi('system:params:edit')")
|
|
|
+ public AjaxResultCQY update(@RequestBody DcParams params)
|
|
|
+ {
|
|
|
+ return iDcParamsService.update(params);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|