Browse Source

新增装运单打印控制层

lingpeng.li 3 ngày trước cách đây
mục cha
commit
ec82a95cb2

+ 161 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/controller/StorageBillPrintController.java

@@ -0,0 +1,161 @@
+package org.jeecg.modules.billet.storageBill.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.modules.billet.storageBill.entity.StorageBillPrint;
+import org.jeecg.modules.billet.storageBill.service.IStorageBillPrintService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Arrays;
+
+/**
+ * @Description: 装运单打印表
+ * @Author: jeecg-boot
+ * @Date: 2025-06-17
+ * @Version: V1.0
+ */
+@Api(tags = "装运单打印表")
+@RestController
+@RequestMapping("/storageBillPrint/storageBillPrint")
+@Slf4j
+public class StorageBillPrintController extends JeecgController<StorageBillPrint, IStorageBillPrintService> {
+    @Autowired
+    private IStorageBillPrintService storageBillPrintService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param storageBillPrint
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    //@AutoLog(value = "装运单打印表-分页列表查询")
+    @ApiOperation(value = "装运单打印表-分页列表查询", notes = "装运单打印表-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<StorageBillPrint>> queryPageList(StorageBillPrint storageBillPrint,
+                                                         @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                         @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                         HttpServletRequest req) {
+        QueryWrapper<StorageBillPrint> queryWrapper = QueryGenerator.initQueryWrapper(storageBillPrint, req.getParameterMap());
+        Page<StorageBillPrint> page = new Page<StorageBillPrint>(pageNo, pageSize);
+        IPage<StorageBillPrint> pageList = storageBillPrintService.page(page, queryWrapper);
+        return Result.OK(pageList);
+    }
+
+    /**
+     * 添加
+     *
+     * @param storageBillPrint
+     * @return
+     */
+    @AutoLog(value = "装运单打印表-添加")
+    @ApiOperation(value = "装运单打印表-添加", notes = "装运单打印表-添加")
+    @RequiresPermissions("storageBillPrint:storage_bill_print:add")
+    @PostMapping(value = "/add")
+    public Result<String> add(@RequestBody StorageBillPrint storageBillPrint) {
+        storageBillPrintService.save(storageBillPrint);
+        return Result.OK("添加成功!");
+    }
+
+    /**
+     * 编辑
+     *
+     * @param storageBillPrint
+     * @return
+     */
+    @AutoLog(value = "装运单打印表-编辑")
+    @ApiOperation(value = "装运单打印表-编辑", notes = "装运单打印表-编辑")
+    @RequiresPermissions("storageBillPrint:storage_bill_print:edit")
+    @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
+    public Result<String> edit(@RequestBody StorageBillPrint storageBillPrint) {
+        storageBillPrintService.updateById(storageBillPrint);
+        return Result.OK("编辑成功!");
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "装运单打印表-通过id删除")
+    @ApiOperation(value = "装运单打印表-通过id删除", notes = "装运单打印表-通过id删除")
+    @RequiresPermissions("storageBillPrint:storage_bill_print:delete")
+    @DeleteMapping(value = "/delete")
+    public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
+        storageBillPrintService.removeById(id);
+        return Result.OK("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "装运单打印表-批量删除")
+    @ApiOperation(value = "装运单打印表-批量删除", notes = "装运单打印表-批量删除")
+    @RequiresPermissions("storageBillPrint:storage_bill_print:deleteBatch")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        this.storageBillPrintService.removeByIds(Arrays.asList(ids.split(",")));
+        return Result.OK("批量删除成功!");
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    //@AutoLog(value = "装运单打印表-通过id查询")
+    @ApiOperation(value = "装运单打印表-通过id查询", notes = "装运单打印表-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<StorageBillPrint> queryById(@RequestParam(name = "id", required = true) String id) {
+        StorageBillPrint storageBillPrint = storageBillPrintService.getById(id);
+        if (storageBillPrint == null) {
+            return Result.error("未找到对应数据");
+        }
+        return Result.OK(storageBillPrint);
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param storageBillPrint
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, StorageBillPrint storageBillPrint) {
+        return super.exportXls(request, storageBillPrint, StorageBillPrint.class, "装运单打印表");
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequiresPermissions("storageBillPrint:storage_bill_print:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, StorageBillPrint.class);
+    }
+
+}

+ 6 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/dto/StorageBillPrintAddDTO.java

@@ -87,5 +87,11 @@ public class StorageBillPrintAddDTO {
     @Excel(name = "班次信息", width = 15)
     @ApiModelProperty(value = "班次信息")
     private String classes;
+    /**
+     * 冷坯/热坯
+     */
+    @Excel(name = "冷坯/热坯", width = 15)
+    @ApiModelProperty(value = "冷坯/热坯")
+    private String btype;
 
 }

+ 6 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/entity/StorageBillPrint.java

@@ -139,4 +139,10 @@ public class StorageBillPrint implements Serializable {
     @Excel(name = "班次信息", width = 15)
     @ApiModelProperty(value = "班次信息")
     private String classes;
+    /**
+     * 冷坯/热坯
+     */
+    @Excel(name = "冷坯/热坯", width = 15)
+    @ApiModelProperty(value = "冷坯/热坯")
+    private String btype;
 }

+ 6 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/vo/StorageBillPrintVO.java

@@ -87,5 +87,11 @@ public class StorageBillPrintVO {
     @Excel(name = "班次信息", width = 15)
     @ApiModelProperty(value = "班次信息")
     private String classes;
+    /**
+     * 冷坯/热坯
+     */
+    @Excel(name = "冷坯/热坯", width = 15)
+    @ApiModelProperty(value = "冷坯/热坯")
+    private String btype;
 
 }