diff --git a/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisMaterialController.java b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisMaterialController.java new file mode 100644 index 000000000..799dc1581 --- /dev/null +++ b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisMaterialController.java @@ -0,0 +1,134 @@ + +/** + * @Project: emis + * @Title: EmisMaterialController.java + * @author linfso + * @date 2024-05-26 15:33:32 + * @Copyright: ShangHai Duta 2022 All rights reserved. + * @version v1.0 + * @Description:

物料类型 控制器

+ */ + +package com.xdadan.erp.web.emis; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +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 com.xdadan.erp.common.annotation.Log; +import com.xdadan.erp.common.core.controller.BaseController; +import com.xdadan.erp.common.core.domain.AjaxResult; +import com.xdadan.erp.common.core.page.TableDataInfo; +import com.xdadan.erp.common.enums.BusinessType; +import com.xdadan.erp.common.utils.StringUtils; +import com.xdadan.erp.common.utils.poi.ExcelUtil; + +import com.xdadan.erp.emis.domain.EmisMaterial; +import com.xdadan.erp.emis.service.IEmisMaterialService; + +/** + * 物料类型Controller + * + * @author linfso + * @date 2024-05-26 15:33:32 + */ +@RestController +@RequestMapping("/emis/emisMaterial") +public class EmisMaterialController extends BaseController +{ + @Autowired + private IEmisMaterialService emisMaterialService; + + /** + * 查询物料类型列表 + */ + @PreAuthorize("@ss.hasPermi('emis:emisMaterial:list')") + @GetMapping("/list") + public TableDataInfo list(EmisMaterial emisMaterial) + { + startPage(); + List list = emisMaterialService.selectEmisMaterialList(emisMaterial); + return getDataTable(list); + } + + + /** + * 检查是否重复 + * + * @param emisMaterial + * @return 数量 + */ + @PreAuthorize("@ss.hasPermi('emis:emisMaterial:list')") + @GetMapping("/checkUnique") + public AjaxResult checkUnique(EmisMaterial emisMaterial) + { + int cnt=emisMaterialService.checkUnique(emisMaterial); + return AjaxResult.success("检查成功",cnt); + } + + + /** + * 导出物料类型列表 + */ + @PreAuthorize("@ss.hasPermi('emis:emisMaterial:export')") + @Log(title = "物料类型", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, EmisMaterial emisMaterial) + { + List list = emisMaterialService.selectEmisMaterialList(emisMaterial); + ExcelUtil util = new ExcelUtil(EmisMaterial.class); + util.exportExcel(response, list, "物料类型数据"); + } + + /** + * 获取物料类型详细信息 + */ + @PreAuthorize("@ss.hasPermi('emis:emisMaterial:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(emisMaterialService.selectEmisMaterialById(id)); + } + + /** + * 新增物料类型 + */ + @PreAuthorize("@ss.hasPermi('emis:emisMaterial:add')") + @Log(title = "物料类型", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody EmisMaterial emisMaterial) + { + return toAjax(emisMaterialService.insertEmisMaterial(emisMaterial)); + } + + /** + * 修改物料类型 + */ + @PreAuthorize("@ss.hasPermi('emis:emisMaterial:edit')") + @Log(title = "物料类型", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody EmisMaterial emisMaterial) + { + return toAjax(emisMaterialService.updateEmisMaterial(emisMaterial)); + } + + /** + * 删除物料类型 + */ + @PreAuthorize("@ss.hasPermi('emis:emisMaterial:remove')") + @Log(title = "物料类型", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(emisMaterialService.deleteEmisMaterialByIds(ids)); + } +} diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/domain/EmisMaterial.java b/emis-biz/src/main/java/com/xdadan/erp/emis/domain/EmisMaterial.java new file mode 100644 index 000000000..b9cb346e9 --- /dev/null +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/domain/EmisMaterial.java @@ -0,0 +1,71 @@ +/** + * @Project: emis + * @Title: EmisMaterial.java + * @author linfso + * @date 2024-05-26 15:33:32 + * @Copyright: ShangHai Duta 2022 All rights reserved. + * @version v1.0 + * @Description:

物料类型 实体类

+ */ + +package com.xdadan.erp.emis.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.xdadan.erp.common.annotation.Excel; +import com.xdadan.erp.common.core.domain.BaseEntity; +import com.xdadan.erp.common.core.domain.TreeEntity; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import lombok.Data; + + +/** + * @ClassName EmisMaterial + * @Description 物料类型 + * @author linfso + * @date 2024-05-26 15:33:32 + */ + @Data +public class EmisMaterial extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /* 序号 */ + private Long id; + /* 物料编号 */ + private String materialCode; + /* 物料名称 */ + private String materialName; + /* 物料英文名称 */ + private String materialNameEn; + /* 是否列表 */ + private String blList; + /* 单个数量 */ + private Integer unitNumber; + /* 出售价格 */ + private BigDecimal unitPrice; + /* 采购价格 */ + private BigDecimal stockPrice; + /* 计量单位 */ + private String goodsUnit; + /* 数量 */ + private Integer quantity; + /* 库存预警 */ + private Integer alertNumber; + /* 最低申购数量 */ + private Integer lowQuantity; + /* 是否需要运单发放 */ + private String blNeedbill; + /* 是否提供给网点申请 1-是 */ + private String blApply; + /* 是否提供给运单发放 */ + private String blSend; + /* 启用状态 1-启用 0-停用 */ + private String blEnable; + /* 排序 */ + private Integer orderNum; + +} diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/mapper/EmisMaterialMapper.java b/emis-biz/src/main/java/com/xdadan/erp/emis/mapper/EmisMaterialMapper.java new file mode 100644 index 000000000..148185f35 --- /dev/null +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/mapper/EmisMaterialMapper.java @@ -0,0 +1,80 @@ +/** + * @Project: emis + * @Title: EmisMaterialMapper.java + * @author linfso + * @date 2024-05-26 15:33:32 + * @Copyright: ShangHai Doitinfo 2022 All rights reserved. + * @version v1.0 + * @Description:

物料类型 Mapper 接口

+ * Warning : This file is generate by ai tools,don't edit!!! + */ +package com.xdadan.erp.emis.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.xdadan.erp.emis.domain.EmisMaterial; +/** + * @ClassName EmisMaterialMapper + * @Description

物料类型 Mapper 接口

+ * @author linfso + * @date 2024-05-26 15:33:32 + */ +public interface EmisMaterialMapper extends BaseMapper +{ + /** + * 主键查询 + * @param id + * @return + */ + public EmisMaterial selectEmisMaterialById(Long id); + + /** + * 查询列表 + * + * @param emisMaterial + * @return 集合 + */ + public List selectEmisMaterialList(EmisMaterial emisMaterial); + + + /** + * 检查是否重复 + * + * @param emisMaterial + * @return 数量 + */ + public int checkUnique(EmisMaterial emisMaterial); + + + /** + * 新增 + * + * @param emisMaterial + * @return + */ + public int insertEmisMaterial(EmisMaterial emisMaterial); + + /** + * 修改 + * + * @param emisMaterial + * @return + */ + public int updateEmisMaterial(EmisMaterial emisMaterial); + + /** + * 删除 + * + * @param id 主键 + * @return 结果 + */ + public int deleteEmisMaterialById(Long id); + + /** + * 批量删除 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteEmisMaterialByIds(Long[] ids); +} diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/service/IEmisMaterialService.java b/emis-biz/src/main/java/com/xdadan/erp/emis/service/IEmisMaterialService.java new file mode 100644 index 000000000..bf953d038 --- /dev/null +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/service/IEmisMaterialService.java @@ -0,0 +1,78 @@ + /** + * @Project: emis + * @Title: EmisMaterialService.java + * @author linfso + * @date 2024-05-26 15:33:32 + * @Copyright: ShangHai Duta 2022 All rights reserved. + * @version v1.0 + * @Description:

物料类型 服务类接口

+ */ +package com.xdadan.erp.emis.service; + +import java.util.List; +import com.xdadan.erp.emis.domain.EmisMaterial; + +/** + * @ClassName EmisMaterialService + * @Description 物料类型 + * @author linfso + * @date 2024-05-26 15:33:32 + */ +public interface IEmisMaterialService +{ + /** + * 主键查询 + * @param id + * @return + */ + public EmisMaterial selectEmisMaterialById(Long id); + + /** + * 查询物料类型列表 + * + * @param emisMaterial 物料类型 + * @return 物料类型集合 + */ + public List selectEmisMaterialList(EmisMaterial emisMaterial); + + + /** + * 检查是否重复 + * + * @param emisMaterial + * @return 数量 + */ + public int checkUnique(EmisMaterial emisMaterial); + + /** + * 新增物料类型 + * + * @param emisMaterial 物料类型 + * @return 结果 + */ + public int insertEmisMaterial(EmisMaterial emisMaterial); + + /** + * 修改物料类型 + * + * @param emisMaterial 物料类型 + * @return 结果 + */ + public int updateEmisMaterial(EmisMaterial emisMaterial); + + /** + * 批量删除物料类型 + * + * @param ids 需要删除的物料类型主键集合 + * @return 结果 + */ + public int deleteEmisMaterialByIds(Long[] ids); + + /** + * 删除物料类型信息 + * + * @param id 物料类型主键 + * @return 结果 + */ + public int deleteEmisMaterialById(Long id); +} diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisMaterialServiceImpl.java b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisMaterialServiceImpl.java new file mode 100644 index 000000000..d0ef8bcc3 --- /dev/null +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisMaterialServiceImpl.java @@ -0,0 +1,117 @@ + /** + * @Project: emis + * @Title: EmisMaterialServiceImpl.java + * @author linfso + * @date 2024-05-26 15:33:32 + * @Copyright: ShangHai Duta 2022 All rights reserved. + * @version v1.0 + * @Description:

物料类型 实体类

+ */ + +package com.xdadan.erp.emis.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.xdadan.erp.emis.domain.EmisMaterial; +import com.xdadan.erp.emis.mapper.EmisMaterialMapper; +import com.xdadan.erp.emis.service.IEmisMaterialService; + +/** + * 物料类型Service业务层处理 + * + * @author linfso + * @date 2024-05-26 15:33:32 + */ +@Service +public class EmisMaterialServiceImpl implements IEmisMaterialService +{ + @Autowired + private EmisMaterialMapper emisMaterialMapper; + + /** + * 查询物料类型 + * + * @param id 物料类型主键 + * @return 物料类型 + */ + @Override + public EmisMaterial selectEmisMaterialById(Long id) + { + return emisMaterialMapper.selectEmisMaterialById(id); + } + + + /** + * 查询物料类型列表 + * + * @param emisMaterial 物料类型 + * @return 物料类型 + */ + @Override + public List selectEmisMaterialList(EmisMaterial emisMaterial) + { + return emisMaterialMapper.selectEmisMaterialList(emisMaterial); + } + + /** + * 检查是否重复 + * + * @param emisMaterial + * @return 数量 + */ + @Override + public int checkUnique(EmisMaterial emisMaterial) + { + return emisMaterialMapper.checkUnique(emisMaterial); + } + + /** + * 新增物料类型 + * + * @param emisMaterial 物料类型 + * @return 结果 + */ + @Override + public int insertEmisMaterial(EmisMaterial emisMaterial) + { + return emisMaterialMapper.insertEmisMaterial(emisMaterial); + } + + /** + * 修改物料类型 + * + * @param emisMaterial 物料类型 + * @return 结果 + */ + @Override + public int updateEmisMaterial(EmisMaterial emisMaterial) + { + return emisMaterialMapper.updateEmisMaterial(emisMaterial); + } + + /** + * 批量删除物料类型 + * + * @param ids 需要删除的物料类型主键 + * @return 结果 + */ + @Override + public int deleteEmisMaterialByIds(Long[] ids) + { + return emisMaterialMapper.deleteEmisMaterialByIds(ids); + } + + /** + * 删除物料类型信息 + * + * @param id 物料类型主键 + * @return 结果 + */ + @Override + public int deleteEmisMaterialById(Long id) + { + return emisMaterialMapper.deleteEmisMaterialById(id); + } + +} diff --git a/emis-biz/src/main/resources/mapper/EmisMaterialMapper.xml b/emis-biz/src/main/resources/mapper/EmisMaterialMapper.xml new file mode 100644 index 000000000..fe91b2d20 --- /dev/null +++ b/emis-biz/src/main/resources/mapper/EmisMaterialMapper.xml @@ -0,0 +1,214 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, material_code, material_name, material_name_en, bl_list, unit_number, unit_price, stock_price, goods_unit, quantity, alert_number, low_quantity, bl_needbill, bl_apply, bl_send, bl_enable, order_num, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_material + + + + + + + + + + insert into emis_material + + id, + material_code, + material_name, + material_name_en, + bl_list, + unit_number, + unit_price, + stock_price, + goods_unit, + quantity, + alert_number, + low_quantity, + bl_needbill, + bl_apply, + bl_send, + bl_enable, + order_num, + remark, + tenant_id, + del_flag, + create_by, + create_time, + update_by, + update_time, + create_site, + update_site, + + + #{id}, + #{materialCode}, + #{materialName}, + #{materialNameEn}, + #{blList}, + #{unitNumber}, + #{unitPrice}, + #{stockPrice}, + #{goodsUnit}, + #{quantity}, + #{alertNumber}, + #{lowQuantity}, + #{blNeedbill}, + #{blApply}, + #{blSend}, + #{blEnable}, + #{orderNum}, + #{remark}, + #{tenantId}, + #{delFlag}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{createSite}, + #{updateSite}, + + + + + update emis_material + + material_code = #{materialCode}, + material_name = #{materialName}, + material_name_en = #{materialNameEn}, + bl_list = #{blList}, + unit_number = #{unitNumber}, + unit_price = #{unitPrice}, + stock_price = #{stockPrice}, + goods_unit = #{goodsUnit}, + quantity = #{quantity}, + alert_number = #{alertNumber}, + low_quantity = #{lowQuantity}, + bl_needbill = #{blNeedbill}, + bl_apply = #{blApply}, + bl_send = #{blSend}, + bl_enable = #{blEnable}, + order_num = #{orderNum}, + remark = #{remark}, + tenant_id = #{tenantId}, + del_flag = #{delFlag}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + create_site = #{createSite}, + update_site = #{updateSite}, + + where id = #{id} + + + + delete from emis_material where id = #{id} + + + + delete from emis_material where id in + + #{id} + + + \ No newline at end of file