|
@@ -0,0 +1,109 @@
|
|
|
|
+package com.zhongzheng.controller.base;
|
|
|
|
+
|
|
|
|
+import com.zhongzheng.common.annotation.Log;
|
|
|
|
+import com.zhongzheng.common.core.controller.BaseController;
|
|
|
|
+import com.zhongzheng.common.core.domain.AjaxResult;
|
|
|
|
+import com.zhongzheng.common.core.page.TableDataInfo;
|
|
|
|
+import com.zhongzheng.common.enums.BusinessType;
|
|
|
|
+import com.zhongzheng.modules.base.bo.ProfileTpAddBo;
|
|
|
|
+import com.zhongzheng.modules.base.bo.ProfileTpEditBo;
|
|
|
|
+import com.zhongzheng.modules.base.bo.ProfileTpQueryBo;
|
|
|
|
+import com.zhongzheng.modules.base.service.IProfileTpService;
|
|
|
|
+import com.zhongzheng.modules.base.vo.ProfileTpVo;
|
|
|
|
+import io.swagger.annotations.Api;
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
+
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * 资料模板Controller
|
|
|
|
+ *
|
|
|
|
+ * @author hjl
|
|
|
|
+ * @date 2021-11-19
|
|
|
|
+ */
|
|
|
|
+@Api(value = "资料模板控制器", tags = {"资料模板管理"})
|
|
|
|
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
|
|
|
+@RestController
|
|
|
|
+@RequestMapping("/base/profile/tp")
|
|
|
|
+public class ProfileTpController extends BaseController {
|
|
|
|
+
|
|
|
|
+ private final IProfileTpService iProfileTpService;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询资料模板列表
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation("查询资料模板列表")
|
|
|
|
+ @GetMapping("/list")
|
|
|
|
+ public TableDataInfo<ProfileTpVo> list(ProfileTpQueryBo bo) {
|
|
|
|
+ startPage();
|
|
|
|
+ List<ProfileTpVo> list = iProfileTpService.selectList(bo);
|
|
|
|
+ return getDataTable(list);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取所有使用商品ID
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation("获取所有使用商品ID")
|
|
|
|
+ @GetMapping("/goods_list")
|
|
|
|
+ public AjaxResult<List<String>> goods_list(ProfileTpQueryBo bo) {
|
|
|
|
+ List<String> list = iProfileTpService.selectAllUseGoods(bo);
|
|
|
|
+ return AjaxResult.success(list);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 导出资料模板列表
|
|
|
|
+ */
|
|
|
|
+ /* @ApiOperation("导出资料模板列表")
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('system:tp:export')")
|
|
|
|
+ @Log(title = "资料模板", businessType = BusinessType.EXPORT)
|
|
|
|
+ @GetMapping("/export")
|
|
|
|
+ public AjaxResult<ProfileTpVo> export(ProfileTpQueryBo bo) {
|
|
|
|
+ List<ProfileTpVo> list = iProfileTpService.queryList(bo);
|
|
|
|
+ ExcelUtil<ProfileTpVo> util = new ExcelUtil<ProfileTpVo>(ProfileTpVo.class);
|
|
|
|
+ return util.exportExcel(list, "资料模板");
|
|
|
|
+ }*/
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取资料模板详细信息
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation("获取资料模板详细信息")
|
|
|
|
+ @GetMapping("/{goodsId}")
|
|
|
|
+ public AjaxResult<ProfileTpVo> queryByGoodsId(@PathVariable("goodsId" ) Long goodsId) {
|
|
|
|
+ return AjaxResult.success(iProfileTpService.queryByGoodsId(goodsId));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 新增资料模板
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation("新增资料模板")
|
|
|
|
+ @Log(title = "资料模板", businessType = BusinessType.INSERT)
|
|
|
|
+ @PostMapping()
|
|
|
|
+ public AjaxResult<Void> add(@RequestBody ProfileTpAddBo bo) {
|
|
|
|
+ return toAjax(iProfileTpService.insertByAddBo(bo) ? 1 : 0);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 修改资料模板
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation("修改资料模板")
|
|
|
|
+ @Log(title = "资料模板", businessType = BusinessType.UPDATE)
|
|
|
|
+ @PostMapping("/edit")
|
|
|
|
+ public AjaxResult<Void> edit(@RequestBody ProfileTpEditBo bo) {
|
|
|
|
+ return toAjax(iProfileTpService.updateByEditBo(bo) ? 1 : 0);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 删除资料模板
|
|
|
|
+ */
|
|
|
|
+ /* @ApiOperation("删除资料模板")
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('system:tp:remove')")
|
|
|
|
+ @Log(title = "资料模板" , businessType = BusinessType.DELETE)
|
|
|
|
+ @DeleteMapping("/{profileTpIds}")
|
|
|
|
+ public AjaxResult<Void> remove(@PathVariable Long[] profileTpIds) {
|
|
|
|
+ return toAjax(iProfileTpService.deleteWithValidByIds(Arrays.asList(profileTpIds), true) ? 1 : 0);
|
|
|
|
+ }*/
|
|
|
|
+}
|