ezhizao_zx 9 luni în urmă
părinte
comite
0204f3042b

+ 118 - 0
src/main/java/cn/ezhizao/project/business/accessories/controller/BizAccessoriesController.java

@@ -0,0 +1,118 @@
+package cn.ezhizao.project.business.accessories.controller;
+
+import java.util.List;
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+
+import cn.ezhizao.common.utils.poi.ExcelUtil;
+import cn.ezhizao.framework.aspectj.lang.annotation.Log;
+import cn.ezhizao.framework.aspectj.lang.enums.BusinessType;
+import cn.ezhizao.framework.web.controller.BaseController;
+import cn.ezhizao.framework.web.domain.AjaxResult;
+import cn.ezhizao.framework.web.page.TableDataInfo;
+import org.springframework.security.access.prepost.PreAuthorize;
+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 cn.ezhizao.project.business.accessories.domain.BizAccessories;
+import cn.ezhizao.project.business.accessories.service.IBizAccessoriesService;
+
+/**
+ * 辅料管理Controller
+ *
+ * @author ezhizao
+ * @date 2024-09-09
+ */
+@RestController
+@RequestMapping("/business/accessories")
+public class BizAccessoriesController extends BaseController
+{
+    @Resource
+    private IBizAccessoriesService bizAccessoriesService;
+
+    /**
+     * 查询辅料管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:accessories:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(BizAccessories bizAccessories) throws NoSuchFieldException, IllegalAccessException
+    {
+        setTenantId(bizAccessories);
+        startPage();
+        List<BizAccessories> list = bizAccessoriesService.getList(bizAccessories);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出辅料管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:accessories:export')")
+    @Log(title = "辅料管理", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, BizAccessories bizAccessories) throws NoSuchFieldException, IllegalAccessException
+    {
+        setTenantId(bizAccessories);
+        List<BizAccessories> list = bizAccessoriesService.getList(bizAccessories);
+        ExcelUtil<BizAccessories> util = new ExcelUtil<BizAccessories>(BizAccessories.class);
+        util.exportExcel(response, list, "辅料管理数据");
+    }
+
+    /**
+     * 获取辅料管理详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('business:accessories:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(bizAccessoriesService.getById(id));
+    }
+
+    /**
+     * 新增辅料管理
+     */
+    @PreAuthorize("@ss.hasPermi('business:accessories:add')")
+    @Log(title = "辅料管理", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody BizAccessories bizAccessories) throws NoSuchFieldException, IllegalAccessException
+    {
+        setTenantId(bizAccessories);
+        checkAccessories(bizAccessories);
+        return toAjax(bizAccessoriesService.save(bizAccessories));
+    }
+
+    /**
+     * 修改辅料管理
+     */
+    @PreAuthorize("@ss.hasPermi('business:accessories:edit')")
+    @Log(title = "辅料管理", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody BizAccessories bizAccessories) throws NoSuchFieldException, IllegalAccessException
+    {
+        setTenantId(bizAccessories);
+        checkAccessories(bizAccessories);
+        return toAjax(bizAccessoriesService.updateById(bizAccessories));
+    }
+
+    private void checkAccessories(BizAccessories bizAccessories) {
+        // 判断是否有重复编码
+        if (bizAccessoriesService.query().eq("accessories_code", bizAccessories.getAccessoriesCode()).ne("id", bizAccessories.getId() == null ? 0L : bizAccessories.getId()).count() > 0) {
+            throw new RuntimeException("辅料编码重复,请输入其他编码");
+        }
+    }
+
+    /**
+     * 删除辅料管理
+     */
+    @PreAuthorize("@ss.hasPermi('business:accessories:remove')")
+    @Log(title = "辅料管理", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable List<Long> ids)
+    {
+        return toAjax(bizAccessoriesService.removeBatchByIds(ids));
+    }
+}

+ 182 - 0
src/main/java/cn/ezhizao/project/business/accessories/domain/BizAccessories.java

@@ -0,0 +1,182 @@
+package cn.ezhizao.project.business.accessories.domain;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+import cn.ezhizao.framework.aspectj.lang.annotation.Excel;
+import cn.ezhizao.framework.web.domain.BaseEntity;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 辅料管理对象 biz_accessories
+ *
+ * @author ezhizao
+ * @date 2024-09-09
+ */
+@Data
+@TableName(value = "biz_accessories")
+public class BizAccessories extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 辅料编号 */
+    @Excel(name = "辅料编号")
+    @ApiModelProperty(value = "辅料编号")
+    private String accessoriesCode;
+
+    /** 账号 */
+    @Excel(name = "账号")
+    @ApiModelProperty(value = "账号")
+    private String itype;
+
+    /** 主管部门 */
+    @Excel(name = "主管部门")
+    @ApiModelProperty(value = "主管部门")
+    private String cusven;
+
+    /** 物料描述 */
+    @Excel(name = "物料描述")
+    @ApiModelProperty(value = "物料描述")
+    private String description;
+
+    /** 采购单位 */
+    @Excel(name = "采购单位")
+    @ApiModelProperty(value = "采购单位")
+    private String unit;
+
+    /** 建立者 */
+    @Excel(name = "建立者")
+    @ApiModelProperty(value = "建立者")
+    private String cruser;
+
+    /** 修改日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "修改日期", width = 30, dateFormat = "yyyy-MM-dd")
+    @ApiModelProperty(value = "修改日期")
+    private Date mddate;
+
+    /** 修改者 */
+    @Excel(name = "修改者")
+    @ApiModelProperty(value = "修改者")
+    private String mduser;
+
+    /** 换算单位 */
+    @Excel(name = "换算单位")
+    @ApiModelProperty(value = "换算单位")
+    private String pouom;
+
+    /** 环保大类码501\502\503\504 */
+    @Excel(name = "环保大类码501\502\503\504")
+    @ApiModelProperty(value = "环保大类码501\502\503\504")
+    private String htype;
+
+    /** 环保大类简称 */
+    @Excel(name = "环保大类简称")
+    @ApiModelProperty(value = "环保大类简称")
+    private String htyna;
+
+    /** 操作者 */
+    @Excel(name = "操作者")
+    @ApiModelProperty(value = "操作者")
+    private String writeruser;
+
+    /** 月用量 */
+    @Excel(name = "月用量")
+    @ApiModelProperty(value = "月用量")
+    private BigDecimal monthUseAmount;
+
+    /** 类别 备库物资 */
+    @Excel(name = "类别 备库物资")
+    @ApiModelProperty(value = "类别 备库物资")
+    private String ltype;
+
+    /** 交货天数 */
+    @Excel(name = "交货天数")
+    @ApiModelProperty(value = "交货天数")
+    private Long deliveryDate;
+
+    /** 安全库存量 */
+    @Excel(name = "安全库存量")
+    @ApiModelProperty(value = "安全库存量")
+    private BigDecimal safetyStock;
+
+    /** 单价 */
+    @Excel(name = "单价")
+    @ApiModelProperty(value = "单价")
+    private BigDecimal price;
+
+    /** NA 正常FM封存 CL 停用 */
+    @Excel(name = "NA 正常FM封存 CL 停用")
+    @ApiModelProperty(value = "NA 正常FM封存 CL 停用")
+    private String status;
+
+    /** 建立日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "建立日期", width = 30, dateFormat = "yyyy-MM-dd")
+    @ApiModelProperty(value = "建立日期")
+    private Date crdate;
+
+    /** 环保标志Y-有环保要求N-无 */
+    @Excel(name = "环保标志Y-有环保要求N-无")
+    @ApiModelProperty(value = "环保标志Y-有环保要求N-无")
+    private String ecoMark;
+
+    /** 单位换算比例 */
+    @Excel(name = "单位换算比例")
+    @ApiModelProperty(value = "单位换算比例")
+    private BigDecimal conversionRatio;
+
+    /** 更新日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "更新日期", width = 30, dateFormat = "yyyy-MM-dd")
+    @ApiModelProperty(value = "更新日期")
+    private Date writedate;
+
+    /** 包装箱尺寸 */
+    @Excel(name = "包装箱尺寸")
+    @ApiModelProperty(value = "包装箱尺寸")
+    private String packageStandard;
+
+    /** 美捷原系统物料编码 */
+    @Excel(name = "美捷原系统物料编码")
+    @ApiModelProperty(value = "美捷原系统物料编码")
+    private String ypart;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    @ApiModelProperty(value = "${comment}")
+    private BigDecimal yamt;
+
+    /** 当月加权平均单价(未税) */
+    @Excel(name = "当月加权平均单价", readConverterExp = "未=税")
+    @ApiModelProperty(value = "当月加权平均单价")
+    private BigDecimal monthAvgPrice;
+
+    /** 可变费/固定费=K/G */
+    @Excel(name = "可变费/固定费=K/G")
+    @ApiModelProperty(value = "可变费/固定费=K/G")
+    private String ftype;
+
+    /** 领用计费形式整体/天数/产量(Z/T/C)整体就是不可分割领用后全部消耗 */
+    @Excel(name = "领用计费形式整体/天数/产量(Z/T/C)整体就是不可分割领用后全部消耗")
+    @ApiModelProperty(value = "领用计费形式整体/天数/产量(Z/T/C)整体就是不可分割领用后全部消耗")
+    private String ktype;
+
+    /** 标准寿命天数:从领用日起开始计算使用天数(按月计算) */
+    @Excel(name = "标准寿命天数:从领用日起开始计算使用天数(按月计算)")
+    @ApiModelProperty(value = "标准寿命天数:从领用日起开始计算使用天数(按月计算)")
+    private Long ktyts;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    @ApiModelProperty(value = "${comment}")
+    private String facno;
+
+    /** 租户id */
+    @ApiModelProperty(value = "${comment}")
+    private Long tenantId;
+
+}

+ 29 - 0
src/main/java/cn/ezhizao/project/business/accessories/mapper/BizAccessoriesMapper.java

@@ -0,0 +1,29 @@
+package cn.ezhizao.project.business.accessories.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import cn.ezhizao.project.business.accessories.domain.BizAccessories;
+
+/**
+ * 辅料管理Mapper接口
+ *
+ * @author ezhizao
+ * @date 2024-09-09
+ */
+public interface BizAccessoriesMapper extends BaseMapper<BizAccessories>
+{
+    /**
+     * 查询辅料管理列表
+     *
+     * @param bizAccessories 辅料管理
+     * @return 辅料管理集合
+     */
+    public List<BizAccessories> getList(BizAccessories bizAccessories);
+
+    /**
+     * 物理删除
+     * @param bizAccessories
+     * @return 删除结果
+    */
+    public int physicalDelete(BizAccessories bizAccessories);
+}

+ 30 - 0
src/main/java/cn/ezhizao/project/business/accessories/service/IBizAccessoriesService.java

@@ -0,0 +1,30 @@
+package cn.ezhizao.project.business.accessories.service;
+
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.IService;
+import cn.ezhizao.project.business.accessories.domain.BizAccessories;
+
+/**
+ * 辅料管理Service接口
+ *
+ * @author ezhizao
+ * @date 2024-09-09
+ */
+public interface IBizAccessoriesService extends IService<BizAccessories>
+{
+    /**
+     * 查询辅料管理列表
+     *
+     * @param bizAccessories 辅料管理
+     * @return 辅料管理集合
+     */
+    public List<BizAccessories> getList(BizAccessories bizAccessories);
+
+    /**
+     * 物理删除
+     * @param bizAccessories
+     * @return 删除结果
+     */
+    public int physicalDelete(BizAccessories bizAccessories);
+
+}

+ 43 - 0
src/main/java/cn/ezhizao/project/business/accessories/service/impl/BizAccessoriesServiceImpl.java

@@ -0,0 +1,43 @@
+package cn.ezhizao.project.business.accessories.service.impl;
+
+import java.util.List;
+import javax.annotation.Resource;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import cn.ezhizao.project.business.accessories.mapper.BizAccessoriesMapper;
+import cn.ezhizao.project.business.accessories.domain.BizAccessories;
+import cn.ezhizao.project.business.accessories.service.IBizAccessoriesService;
+
+/**
+ * 辅料管理Service业务层处理
+ *
+ * @author ezhizao
+ * @date 2024-09-09
+ */
+@Service
+public class BizAccessoriesServiceImpl  extends ServiceImpl<BizAccessoriesMapper, BizAccessories> implements IBizAccessoriesService
+{
+    @Resource
+    private BizAccessoriesMapper bizAccessoriesMapper;
+
+    /**
+     * 查询辅料管理列表
+     *
+     * @param bizAccessories 辅料管理
+     * @return 辅料管理
+     */
+    @Override
+    public List<BizAccessories> getList(BizAccessories bizAccessories)
+    {
+        return bizAccessoriesMapper.getList(bizAccessories);
+    }
+
+    /**
+     * 物理删除
+     * @param bizAccessories
+     * @return 删除结果
+     */
+    @Override
+    public int physicalDelete(BizAccessories bizAccessories){ return bizAccessoriesMapper.physicalDelete(bizAccessories); };
+
+}

+ 58 - 0
src/main/resources/mybatis/business/accessories/BizAccessoriesMapper.xml

@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.ezhizao.project.business.accessories.mapper.BizAccessoriesMapper">
+
+    <resultMap type="cn.ezhizao.project.business.accessories.domain.BizAccessories" id="BizAccessoriesResult">
+        <id column="id" property="id"/>
+    </resultMap>
+
+
+    <select id="getList" parameterType="BizAccessories" resultMap="BizAccessoriesResult">
+        SELECT * FROM biz_accessories
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            deleted = 0
+            <if test="accessoriesCode != null  and accessoriesCode != ''"> AND accessories_code = #{accessoriesCode}</if>
+            <if test="itype != null  and itype != ''"> AND itype = #{itype}</if>
+            <if test="cusven != null  and cusven != ''"> AND cusven = #{cusven}</if>
+            <if test="description != null  and description != ''"> AND description = #{description}</if>
+            <if test="unit != null  and unit != ''"> AND unit = #{unit}</if>
+            <if test="cruser != null  and cruser != ''"> AND cruser = #{cruser}</if>
+            <if test="mddate != null "> AND mddate = #{mddate}</if>
+            <if test="mduser != null  and mduser != ''"> AND mduser = #{mduser}</if>
+            <if test="pouom != null  and pouom != ''"> AND pouom = #{pouom}</if>
+            <if test="htype != null  and htype != ''"> AND htype = #{htype}</if>
+            <if test="htyna != null  and htyna != ''"> AND htyna = #{htyna}</if>
+            <if test="writeruser != null  and writeruser != ''"> AND writeruser = #{writeruser}</if>
+            <if test="monthUseAmount != null "> AND month_use_amount = #{monthUseAmount}</if>
+            <if test="ltype != null  and ltype != ''"> AND ltype = #{ltype}</if>
+            <if test="deliveryDate != null "> AND delivery_date = #{deliveryDate}</if>
+            <if test="safetyStock != null "> AND safety_stock = #{safetyStock}</if>
+            <if test="price != null "> AND price = #{price}</if>
+            <if test="status != null  and status != ''"> AND status = #{status}</if>
+            <if test="crdate != null "> AND crdate = #{crdate}</if>
+            <if test="ecoMark != null  and ecoMark != ''"> AND eco_mark = #{ecoMark}</if>
+            <if test="conversionRatio != null "> AND conversion_ratio = #{conversionRatio}</if>
+            <if test="writedate != null "> AND writedate = #{writedate}</if>
+            <if test="packageStandard != null  and packageStandard != ''"> AND package_standard = #{packageStandard}</if>
+            <if test="ypart != null  and ypart != ''"> AND ypart = #{ypart}</if>
+            <if test="yamt != null "> AND yamt = #{yamt}</if>
+            <if test="monthAvgPrice != null "> AND month_avg_price = #{monthAvgPrice}</if>
+            <if test="ftype != null  and ftype != ''"> AND ftype = #{ftype}</if>
+            <if test="ktype != null  and ktype != ''"> AND ktype = #{ktype}</if>
+            <if test="ktyts != null "> AND ktyts = #{ktyts}</if>
+            <if test="facno != null  and facno != ''"> AND facno = #{facno}</if>
+        </trim>
+    </select>
+
+    <delete id="physicalDelete">
+        DELETE FROM biz_accessories
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            <if test="id != null">
+                id = #{id} AND
+            </if>
+       <!-- 删除条件为其他外键可以在这里加 -->
+        </trim>
+    </delete>
+</mapper>