diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/controller/ReportInventoryBaseController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/controller/ReportInventoryBaseController.java new file mode 100644 index 0000000..1e2f55a --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/controller/ReportInventoryBaseController.java @@ -0,0 +1,119 @@ +package com.bonus.canteen.core.ims.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import com.bonus.common.log.enums.OperaType; +//import com.bonus.canteen.core.ims.common.annotation.PreventRepeatSubmit; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +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.bonus.common.log.annotation.SysLog; +import com.bonus.common.security.annotation.RequiresPermissions; +import com.bonus.canteen.core.ims.domain.ReportInventoryBase; +import com.bonus.canteen.core.ims.service.IReportInventoryBaseService; +import com.bonus.common.core.web.controller.BaseController; +import com.bonus.common.core.web.domain.AjaxResult; +import com.bonus.common.core.utils.poi.ExcelUtil; +import com.bonus.common.core.web.page.TableDataInfo; + +/** + * 库存基础Controller + * + * @author xsheng + * @date 2025-07-16 + */ +@Api(tags = "库存基础接口") +@RestController +@RequestMapping("/ims_report_inventory_base") +public class ReportInventoryBaseController extends BaseController { + @Autowired + private IReportInventoryBaseService reportInventoryBaseService; + + /** + * 查询库存基础列表 + */ + @ApiOperation(value = "查询库存基础列表") + //@RequiresPermissions("ims:base:list") + @GetMapping("/list") + public TableDataInfo list(ReportInventoryBase reportInventoryBase) { + startPage(); + List list = reportInventoryBaseService.selectReportInventoryBaseList(reportInventoryBase); + return getDataTable(list); + } + + /** + * 导出库存基础列表 + */ + @ApiOperation(value = "导出库存基础列表") + //@PreventRepeatSubmit + //@RequiresPermissions("ims:base:export") + @SysLog(title = "库存基础", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出库存基础") + @PostMapping("/export") + public void export(HttpServletResponse response, ReportInventoryBase reportInventoryBase) { + List list = reportInventoryBaseService.selectReportInventoryBaseList(reportInventoryBase); + ExcelUtil util = new ExcelUtil(ReportInventoryBase.class); + util.exportExcel(response, list, "库存基础数据"); + } + + /** + * 获取库存基础详细信息 + */ + @ApiOperation(value = "获取库存基础详细信息") + //@RequiresPermissions("ims:base:query") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return success(reportInventoryBaseService.selectReportInventoryBaseById(id)); + } + + /** + * 新增库存基础 + */ + @ApiOperation(value = "新增库存基础") + //@PreventRepeatSubmit + //@RequiresPermissions("ims:base:add") + @SysLog(title = "库存基础", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增库存基础") + @PostMapping + public AjaxResult add(@RequestBody ReportInventoryBase reportInventoryBase) { + try { + return toAjax(reportInventoryBaseService.insertReportInventoryBase(reportInventoryBase)); + } catch (Exception e) { + return error(e.getMessage()); + } + } + + /** + * 修改库存基础 + */ + @ApiOperation(value = "修改库存基础") + //@PreventRepeatSubmit + //@RequiresPermissions("ims:base:edit") + @SysLog(title = "库存基础", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改库存基础") + @PostMapping("/edit") + public AjaxResult edit(@RequestBody ReportInventoryBase reportInventoryBase) { + try { + return toAjax(reportInventoryBaseService.updateReportInventoryBase(reportInventoryBase)); + } catch (Exception e) { + return error(e.getMessage()); + } + } + + /** + * 删除库存基础 + */ + @ApiOperation(value = "删除库存基础") + //@PreventRepeatSubmit + //@RequiresPermissions("ims:base:remove") + @SysLog(title = "库存基础", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除库存基础") + @PostMapping("/del/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(reportInventoryBaseService.deleteReportInventoryBaseByIds(ids)); + } +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/ReportInventoryBase.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/ReportInventoryBase.java new file mode 100644 index 0000000..335b014 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/ReportInventoryBase.java @@ -0,0 +1,139 @@ +package com.bonus.canteen.core.ims.domain; + +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.bonus.common.core.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.ToString; +import com.bonus.common.core.web.domain.BaseEntity; + +/** + * 库存基础对象 ims_report_inventory_base + * + * @author xsheng + * @date 2025-07-16 + */ + + +@Data +@ToString +public class ReportInventoryBase extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** 主键id */ + private Long id; + + /** 出入库详情id */ + @Excel(name = "出入库详情id") + @ApiModelProperty(value = "出入库详情id") + private Long detailId; + + /** 出入库记录id */ + @Excel(name = "出入库记录id") + @ApiModelProperty(value = "出入库记录id") + private String recordId; + + /** 仓库id */ + @Excel(name = "仓库id") + @ApiModelProperty(value = "仓库id") + private Long warehouseId; + + /** 类型 1入库 2出库 */ + @Excel(name = "类型 1入库 2出库") + @ApiModelProperty(value = "类型 1入库 2出库") + private Integer recordType; + + /** 出入库日期 */ + @ApiModelProperty(value = "出入库日期") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "出入库日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date recordDate; + + /** 出入库时间 */ + @ApiModelProperty(value = "出入库时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "出入库时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date recordTime; + + /** 入库类型(1-采购入库,2-退料入库,3-调拨入库) 出库类型(1-领取出库,2-报损出库,3-退货出库,4-调拨出库) */ + @Excel(name = "入库类型(1-采购入库,2-退料入库,3-调拨入库) 出库类型(1-领取出库,2-报损出库,3-退货出库,4-调拨出库)") + @ApiModelProperty(value = "入库类型(1-采购入库,2-退料入库,3-调拨入库) 出库类型(1-领取出库,2-报损出库,3-退货出库,4-调拨出库)") + private Long outIntoType; + + /** 原料id */ + @Excel(name = "原料id") + @ApiModelProperty(value = "原料id") + private Long materialId; + + /** 供应商id */ + @Excel(name = "供应商id") + @ApiModelProperty(value = "供应商id") + private Long supplierId; + + /** 计量单位id */ + @Excel(name = "计量单位id") + @ApiModelProperty(value = "计量单位id") + private Long unitId; + + /** 单价 */ + @Excel(name = "单价") + @ApiModelProperty(value = "单价") + private Long unitPrice; + + /** 出入库金额 */ + @Excel(name = "出入库金额") + @ApiModelProperty(value = "出入库金额") + private Long outIntoAmount; + + /** 出入库数量 */ + @Excel(name = "出入库数量") + @ApiModelProperty(value = "出入库数量") + private BigDecimal outIntoNum; + + /** 总库存数量 */ + @Excel(name = "总库存数量") + @ApiModelProperty(value = "总库存数量") + private BigDecimal inventoryNum; + + /** 总金额 */ + @Excel(name = "总金额") + @ApiModelProperty(value = "总金额") + private Long totalAmount; + + /** 生产日期 */ + @ApiModelProperty(value = "生产日期") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date productDate; + + /** 到期时间(保质期) */ + @ApiModelProperty(value = "到期时间(保质期)") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "到期时间(保质期)", width = 30, dateFormat = "yyyy-MM-dd") + private Date expireTime; + + /** 领取人id */ + @Excel(name = "领取人id") + @ApiModelProperty(value = "领取人id") + private Long fetchUserId; + + /** 操作人id */ + @Excel(name = "操作人id") + @ApiModelProperty(value = "操作人id") + private String operatorId; + + /** 操作时间 */ + @ApiModelProperty(value = "操作时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date operateTime; + + /** 状态: 0 未消费 1 已消费 */ + @Excel(name = "状态: 0 未消费 1 已消费") + @ApiModelProperty(value = "状态: 0 未消费 1 已消费") + private Integer msgStatus; + + +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/ReportInventoryBaseMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/ReportInventoryBaseMapper.java new file mode 100644 index 0000000..af97de9 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/ReportInventoryBaseMapper.java @@ -0,0 +1,60 @@ +package com.bonus.canteen.core.ims.mapper; + +import java.util.List; +import com.bonus.canteen.core.ims.domain.ReportInventoryBase; + +/** + * 库存基础Mapper接口 + * + * @author xsheng + * @date 2025-07-16 + */ +public interface ReportInventoryBaseMapper { + /** + * 查询库存基础 + * + * @param id 库存基础主键 + * @return 库存基础 + */ + public ReportInventoryBase selectReportInventoryBaseById(Long id); + + /** + * 查询库存基础列表 + * + * @param reportInventoryBase 库存基础 + * @return 库存基础集合 + */ + public List selectReportInventoryBaseList(ReportInventoryBase reportInventoryBase); + + /** + * 新增库存基础 + * + * @param reportInventoryBase 库存基础 + * @return 结果 + */ + public int insertReportInventoryBase(ReportInventoryBase reportInventoryBase); + + /** + * 修改库存基础 + * + * @param reportInventoryBase 库存基础 + * @return 结果 + */ + public int updateReportInventoryBase(ReportInventoryBase reportInventoryBase); + + /** + * 删除库存基础 + * + * @param id 库存基础主键 + * @return 结果 + */ + public int deleteReportInventoryBaseById(Long id); + + /** + * 批量删除库存基础 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteReportInventoryBaseByIds(Long[] ids); +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/IReportInventoryBaseService.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/IReportInventoryBaseService.java new file mode 100644 index 0000000..7530f38 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/IReportInventoryBaseService.java @@ -0,0 +1,60 @@ +package com.bonus.canteen.core.ims.service; + +import java.util.List; +import com.bonus.canteen.core.ims.domain.ReportInventoryBase; + +/** + * 库存基础Service接口 + * + * @author xsheng + * @date 2025-07-16 + */ +public interface IReportInventoryBaseService { + /** + * 查询库存基础 + * + * @param id 库存基础主键 + * @return 库存基础 + */ + public ReportInventoryBase selectReportInventoryBaseById(Long id); + + /** + * 查询库存基础列表 + * + * @param reportInventoryBase 库存基础 + * @return 库存基础集合 + */ + public List selectReportInventoryBaseList(ReportInventoryBase reportInventoryBase); + + /** + * 新增库存基础 + * + * @param reportInventoryBase 库存基础 + * @return 结果 + */ + public int insertReportInventoryBase(ReportInventoryBase reportInventoryBase); + + /** + * 修改库存基础 + * + * @param reportInventoryBase 库存基础 + * @return 结果 + */ + public int updateReportInventoryBase(ReportInventoryBase reportInventoryBase); + + /** + * 批量删除库存基础 + * + * @param ids 需要删除的库存基础主键集合 + * @return 结果 + */ + public int deleteReportInventoryBaseByIds(Long[] ids); + + /** + * 删除库存基础信息 + * + * @param id 库存基础主键 + * @return 结果 + */ + public int deleteReportInventoryBaseById(Long id); +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ReportInventoryBaseServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ReportInventoryBaseServiceImpl.java new file mode 100644 index 0000000..0f8f7e4 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ReportInventoryBaseServiceImpl.java @@ -0,0 +1,98 @@ +package com.bonus.canteen.core.ims.service.impl; + +import java.util.List; +import com.bonus.common.core.exception.ServiceException; +import com.bonus.common.core.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.bonus.canteen.core.ims.mapper.ReportInventoryBaseMapper; +import com.bonus.canteen.core.ims.domain.ReportInventoryBase; +import com.bonus.canteen.core.ims.service.IReportInventoryBaseService; + +/** + * 库存基础Service业务层处理 + * + * @author xsheng + * @date 2025-07-16 + */ +@Service +public class ReportInventoryBaseServiceImpl implements IReportInventoryBaseService { + @Autowired + private ReportInventoryBaseMapper reportInventoryBaseMapper; + + /** + * 查询库存基础 + * + * @param id 库存基础主键 + * @return 库存基础 + */ + @Override + public ReportInventoryBase selectReportInventoryBaseById(Long id) { + return reportInventoryBaseMapper.selectReportInventoryBaseById(id); + } + + /** + * 查询库存基础列表 + * + * @param reportInventoryBase 库存基础 + * @return 库存基础 + */ + @Override + public List selectReportInventoryBaseList(ReportInventoryBase reportInventoryBase) { + return reportInventoryBaseMapper.selectReportInventoryBaseList(reportInventoryBase); + } + + /** + * 新增库存基础 + * + * @param reportInventoryBase 库存基础 + * @return 结果 + */ + @Override + public int insertReportInventoryBase(ReportInventoryBase reportInventoryBase) { + reportInventoryBase.setCreateTime(DateUtils.getNowDate()); + try { + return reportInventoryBaseMapper.insertReportInventoryBase(reportInventoryBase); + } catch (Exception e) { + throw new ServiceException(e.getMessage()); + } + } + + /** + * 修改库存基础 + * + * @param reportInventoryBase 库存基础 + * @return 结果 + */ + @Override + public int updateReportInventoryBase(ReportInventoryBase reportInventoryBase) { + reportInventoryBase.setUpdateTime(DateUtils.getNowDate()); + try { + return reportInventoryBaseMapper.updateReportInventoryBase(reportInventoryBase); + } catch (Exception e) { + throw new ServiceException(e.getMessage()); + } + } + + /** + * 批量删除库存基础 + * + * @param ids 需要删除的库存基础主键 + * @return 结果 + */ + @Override + public int deleteReportInventoryBaseByIds(Long[] ids) { + return reportInventoryBaseMapper.deleteReportInventoryBaseByIds(ids); + } + + /** + * 删除库存基础信息 + * + * @param id 库存基础主键 + * @return 结果 + */ + @Override + public int deleteReportInventoryBaseById(Long id) { + return reportInventoryBaseMapper.deleteReportInventoryBaseById(id); + } +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/ReportInventoryBaseMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/ReportInventoryBaseMapper.xml new file mode 100644 index 0000000..7548dd7 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/ReportInventoryBaseMapper.xml @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, detail_id, record_id, warehouse_id, record_type, record_date, record_time, out_into_type, material_id, supplier_id, unit_id, unit_price, out_into_amount, out_into_num, inventory_num, total_amount, product_date, expire_time, fetch_user_id, operator_id, operate_time, msg_status, remark, create_by, create_time, update_by, update_time from ims_report_inventory_base + + + + + + + + insert into ims_report_inventory_base + + detail_id, + record_id, + warehouse_id, + record_type, + record_date, + record_time, + out_into_type, + material_id, + supplier_id, + unit_id, + unit_price, + out_into_amount, + out_into_num, + inventory_num, + total_amount, + product_date, + expire_time, + fetch_user_id, + operator_id, + operate_time, + msg_status, + remark, + create_by, + create_time, + update_by, + update_time, + + + #{detailId}, + #{recordId}, + #{warehouseId}, + #{recordType}, + #{recordDate}, + #{recordTime}, + #{outIntoType}, + #{materialId}, + #{supplierId}, + #{unitId}, + #{unitPrice}, + #{outIntoAmount}, + #{outIntoNum}, + #{inventoryNum}, + #{totalAmount}, + #{productDate}, + #{expireTime}, + #{fetchUserId}, + #{operatorId}, + #{operateTime}, + #{msgStatus}, + #{remark}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update ims_report_inventory_base + + detail_id = #{detailId}, + record_id = #{recordId}, + warehouse_id = #{warehouseId}, + record_type = #{recordType}, + record_date = #{recordDate}, + record_time = #{recordTime}, + out_into_type = #{outIntoType}, + material_id = #{materialId}, + supplier_id = #{supplierId}, + unit_id = #{unitId}, + unit_price = #{unitPrice}, + out_into_amount = #{outIntoAmount}, + out_into_num = #{outIntoNum}, + inventory_num = #{inventoryNum}, + total_amount = #{totalAmount}, + product_date = #{productDate}, + expire_time = #{expireTime}, + fetch_user_id = #{fetchUserId}, + operator_id = #{operatorId}, + operate_time = #{operateTime}, + msg_status = #{msgStatus}, + remark = #{remark}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from ims_report_inventory_base where id = #{id} + + + + delete from ims_report_inventory_base where id in + + #{id} + + + \ No newline at end of file