diff --git a/measurement/src/main/java/com/ruoyi/operation/controller/OutInPoundController.java b/measurement/src/main/java/com/ruoyi/operation/controller/OutInPoundController.java new file mode 100644 index 0000000..1a23866 --- /dev/null +++ b/measurement/src/main/java/com/ruoyi/operation/controller/OutInPoundController.java @@ -0,0 +1,107 @@ +package com.ruoyi.operation.controller; + +import java.util.Arrays; +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.bill.domain.PoundBill; +import com.ruoyi.bill.service.IPoundBillService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.operation.service.OutInPoundService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 出入磅Controller + * + * @author ptt + * @date 2025-06-03 + */ +@RestController +@RequestMapping("/measurement/operation/outinpound") +public class OutInPoundController extends BaseController +{ + @Autowired + private IPoundBillService poundBillService; + + /** + * 查询磅单信息列表 + */ + @PreAuthorize("@ss.hasPermi('measurement:poundbill:list')") + @GetMapping("/list") + public TableDataInfo list(PoundBill poundBill) + { + startPage(); + List list = poundBillService.selectPoundBillList(poundBill); + return getDataTable(list); + } + + /** + * 导出磅单信息列表 + */ + @PreAuthorize("@ss.hasPermi('measurement:poundbill:export')") + @Log(title = "磅单信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, PoundBill poundBill) + { + List list = poundBillService.selectPoundBillList(poundBill); + ExcelUtil util = new ExcelUtil(PoundBill.class); + util.exportExcel(response, list, "磅单信息数据"); + } + + /** + * 获取磅单信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('measurement:poundbill:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) + { + return success(poundBillService.getById(id)); + } + + /** + * 新增磅单信息 + */ + @PreAuthorize("@ss.hasPermi('measurement:poundbill:add')") + @Log(title = "磅单信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PoundBill poundBill) + { + return toAjax(poundBillService.save(poundBill)); + } + + /** + * 修改磅单信息 + */ + @PreAuthorize("@ss.hasPermi('measurement:poundbill:edit')") + @Log(title = "磅单信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PoundBill poundBill) + { + return toAjax(poundBillService.updateById(poundBill)); + } + + /** + * 删除磅单信息 + */ + @PreAuthorize("@ss.hasPermi('measurement:poundbill:remove')") + @Log(title = "磅单信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids) + { + return toAjax(poundBillService.removeByIds(Arrays.asList(ids))); + } +} diff --git a/measurement/src/main/java/com/ruoyi/operation/service/OutInPoundService.java b/measurement/src/main/java/com/ruoyi/operation/service/OutInPoundService.java new file mode 100644 index 0000000..700e617 --- /dev/null +++ b/measurement/src/main/java/com/ruoyi/operation/service/OutInPoundService.java @@ -0,0 +1,62 @@ +package com.ruoyi.operation.service; + +import java.util.List; + +import com.ruoyi.bill.domain.PoundBill; + +/** + * 出入磅Service接口 + * + * @author ptt + * @date 2025-06-03 + */ +public interface OutInPoundService +{ + /** + * 查询出入磅 + * + * @param id 出入磅主键 + * @return 出入磅 + */ + public PoundBill selectPoundBillById(String id); + + /** + * 查询出入磅列表 + * + * @param poundBill 出入磅 + * @return 出入磅集合 + */ + public List selectPoundBillList(PoundBill poundBill); + + /** + * 新增出入磅 + * + * @param poundBill 出入磅 + * @return 结果 + */ + public int insertPoundBill(PoundBill poundBill); + + /** + * 修改出入磅 + * + * @param poundBill 出入磅 + * @return 结果 + */ + public int updatePoundBill(PoundBill poundBill); + + /** + * 批量删除出入磅 + * + * @param ids 需要删除的出入磅主键集合 + * @return 结果 + */ + public int deletePoundBillByIds(String[] ids); + + /** + * 删除出入磅信息 + * + * @param id 出入磅主键 + * @return 结果 + */ + public int deletePoundBillById(String id); +} diff --git a/measurement/src/main/java/com/ruoyi/operation/service/impl/OutInPoundServiceImpl.java b/measurement/src/main/java/com/ruoyi/operation/service/impl/OutInPoundServiceImpl.java new file mode 100644 index 0000000..efffea7 --- /dev/null +++ b/measurement/src/main/java/com/ruoyi/operation/service/impl/OutInPoundServiceImpl.java @@ -0,0 +1,94 @@ +package com.ruoyi.operation.service.impl; + +import java.util.List; + +import com.ruoyi.bill.domain.PoundBill; +import com.ruoyi.bill.mapper.PoundBillMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.operation.service.OutInPoundService; + +/** + * 出入磅Service业务层处理 + * + * @author ptt + * @date 2025-06-03 + */ +@Service +public class OutInPoundServiceImpl implements OutInPoundService +{ + @Autowired + private PoundBillMapper poundBillMapper; + + /** + * 查询出入磅 + * + * @param id 出入磅主键 + * @return 出入磅 + */ + @Override + public PoundBill selectPoundBillById(String id) + { + return poundBillMapper.selectPoundBillById(id); + } + + /** + * 查询出入磅列表 + * + * @param poundBill 出入磅 + * @return 出入磅 + */ + @Override + public List selectPoundBillList(PoundBill poundBill) + { + return poundBillMapper.selectPoundBillList(poundBill); + } + + /** + * 新增出入磅 + * + * @param poundBill 出入磅 + * @return 结果 + */ + @Override + public int insertPoundBill(PoundBill poundBill) + { + return poundBillMapper.insertPoundBill(poundBill); + } + + /** + * 修改出入磅 + * + * @param poundBill 出入磅 + * @return 结果 + */ + @Override + public int updatePoundBill(PoundBill poundBill) + { + return poundBillMapper.updatePoundBill(poundBill); + } + + /** + * 批量删除出入磅 + * + * @param ids 需要删除的出入磅主键 + * @return 结果 + */ + @Override + public int deletePoundBillByIds(String[] ids) + { + return poundBillMapper.deletePoundBillByIds(ids); + } + + /** + * 删除出入磅信息 + * + * @param id 出入磅主键 + * @return 结果 + */ + @Override + public int deletePoundBillById(String id) + { + return poundBillMapper.deletePoundBillById(id); + } +} diff --git a/ruoyi-ui/src/api/measurement/operation/outinpound.js b/ruoyi-ui/src/api/measurement/operation/outinpound.js new file mode 100644 index 0000000..1039f43 --- /dev/null +++ b/ruoyi-ui/src/api/measurement/operation/outinpound.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询出入磅列表 +export function listOutinpound(query) { + return request({ + url: '/measurement/operation/outinpound/list', + method: 'get', + params: query + }) +} + +// 查询出入磅详细 +export function getOutinpound(id) { + return request({ + url: '/measurement/operation/outinpound/' + id, + method: 'get' + }) +} + +// 新增出入磅 +export function addOutinpound(data) { + return request({ + url: '/measurement/operation/outinpound', + method: 'post', + data: data + }) +} + +// 修改出入磅 +export function updateOutinpound(data) { + return request({ + url: '/measurement/operation/outinpound', + method: 'put', + data: data + }) +} + +// 删除出入磅 +export function delOutinpound(id) { + return request({ + url: '/measurement/operation/outinpound/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/views/measurement/operation/outinpound/index.vue b/ruoyi-ui/src/views/measurement/operation/outinpound/index.vue new file mode 100644 index 0000000..ba68497 --- /dev/null +++ b/ruoyi-ui/src/views/measurement/operation/outinpound/index.vue @@ -0,0 +1,841 @@ + + +