diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseBomComponentController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseBomComponentController.java new file mode 100644 index 00000000..f3ba75a6 --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseBomComponentController.java @@ -0,0 +1,97 @@ +package com.op.wms.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +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.op.common.log.annotation.Log; +import com.op.common.log.enums.BusinessType; +import com.op.common.security.annotation.RequiresPermissions; +import com.op.wms.domain.BaseBomComponent; +import com.op.wms.service.IBaseBomComponentService; +import com.op.common.core.web.controller.BaseController; +import com.op.common.core.web.domain.AjaxResult; +import com.op.common.core.utils.poi.ExcelUtil; +import com.op.common.core.web.page.TableDataInfo; + +/** + * 物料BOM子表Controller + * + * @author Open Platform + * @date 2023-08-04 + */ +@RestController +@RequestMapping("/bomComponent") +public class BaseBomComponentController extends BaseController { + @Autowired + private IBaseBomComponentService baseBomComponentService; + + /** + * 查询物料BOM子表列表 + */ + @RequiresPermissions("wms:bomComponent:list") + @GetMapping("/list") + public TableDataInfo list(BaseBomComponent baseBomComponent) { + startPage(); + List list = baseBomComponentService.selectBaseBomComponentList(baseBomComponent); + return getDataTable(list); + } + + /** + * 导出物料BOM子表列表 + */ + @RequiresPermissions("wms:bomComponent:export") + @Log(title = "物料BOM子表", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, BaseBomComponent baseBomComponent) { + List list = baseBomComponentService.selectBaseBomComponentList(baseBomComponent); + ExcelUtil util = new ExcelUtil(BaseBomComponent.class); + util.exportExcel(response, list, "物料BOM子表数据"); + } + + /** + * 获取物料BOM子表详细信息 + */ + @RequiresPermissions("wms:bomComponent:query") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return success(baseBomComponentService.selectBaseBomComponentById(id)); + } + + /** + * 新增物料BOM子表 + */ + @RequiresPermissions("wms:bomComponent:add") + @Log(title = "物料BOM子表", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody BaseBomComponent baseBomComponent) { + return toAjax(baseBomComponentService.insertBaseBomComponent(baseBomComponent)); + } + + /** + * 修改物料BOM子表 + */ + @RequiresPermissions("wms:bomComponent:edit") + @Log(title = "物料BOM子表", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody BaseBomComponent baseBomComponent) { + return toAjax(baseBomComponentService.updateBaseBomComponent(baseBomComponent)); + } + + /** + * 删除物料BOM子表 + */ + @RequiresPermissions("wms:bomComponent:remove") + @Log(title = "物料BOM子表", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(baseBomComponentService.deleteBaseBomComponentByIds(ids)); + } +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/domain/BaseBomComponent.java b/op-modules/op-wms/src/main/java/com/op/wms/domain/BaseBomComponent.java new file mode 100644 index 00000000..7e8ddc4c --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/domain/BaseBomComponent.java @@ -0,0 +1,258 @@ +package com.op.wms.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; + +/** + * 物料BOM子表对象 base_bom_component + * + * @author Open Platform + * @date 2023-08-04 + */ +public class BaseBomComponent extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** BOM单号 */ + @Excel(name = "BOM单号") + private String bomCode; + + /** 工厂/站点 */ + @Excel(name = "工厂/站点") + private String site; + + /** 物料编码 */ + @Excel(name = "物料编码") + private String productCode; + + /** 组件上层物料编码 */ + @Excel(name = "组件上层物料编码") + private String cumc; + + /** 组件编码 */ + @Excel(name = "组件编码") + private String component; + + /** BOM层次 */ + @Excel(name = "BOM层次") + private String bomHierarchy; + + /** 项目编号 */ + @Excel(name = "项目编号") + private String projectNo; + + /** 标准用量 */ + @Excel(name = "标准用量") + private Long standardDosage; + + /** 损耗率 */ + @Excel(name = "损耗率") + private Long lossRate; + + /** 损耗额 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "损耗额", width = 30, dateFormat = "yyyy-MM-dd") + private Date lossAmount; + + /** 含损耗用量 */ + @Excel(name = "含损耗用量") + private Long cilosses; + + /** 组件数量单位 */ + @Excel(name = "组件数量单位") + private String componentUnit; + + /** 组件采购标志 */ + @Excel(name = "组件采购标志") + private String componentProFlag; + + /** 物料供应标识 */ + @Excel(name = "物料供应标识") + private String msi; + + /** 成本核算标识相关 */ + @Excel(name = "成本核算标识相关") + private String sanka; + + /** 预留字段1 */ + @Excel(name = "预留字段1") + private String attr1; + + /** 预留字段2 */ + @Excel(name = "预留字段2") + private String attr2; + + /** 预留字段3 */ + @Excel(name = "预留字段3") + private String attr3; + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + public void setBomCode(String bomCode) { + this.bomCode = bomCode; + } + + public String getBomCode() { + return bomCode; + } + public void setSite(String site) { + this.site = site; + } + + public String getSite() { + return site; + } + public void setProductCode(String productCode) { + this.productCode = productCode; + } + + public String getProductCode() { + return productCode; + } + public void setCumc(String cumc) { + this.cumc = cumc; + } + + public String getCumc() { + return cumc; + } + public void setComponent(String component) { + this.component = component; + } + + public String getComponent() { + return component; + } + public void setBomHierarchy(String bomHierarchy) { + this.bomHierarchy = bomHierarchy; + } + + public String getBomHierarchy() { + return bomHierarchy; + } + public void setProjectNo(String projectNo) { + this.projectNo = projectNo; + } + + public String getProjectNo() { + return projectNo; + } + public void setStandardDosage(Long standardDosage) { + this.standardDosage = standardDosage; + } + + public Long getStandardDosage() { + return standardDosage; + } + public void setLossRate(Long lossRate) { + this.lossRate = lossRate; + } + + public Long getLossRate() { + return lossRate; + } + public void setLossAmount(Date lossAmount) { + this.lossAmount = lossAmount; + } + + public Date getLossAmount() { + return lossAmount; + } + public void setCilosses(Long cilosses) { + this.cilosses = cilosses; + } + + public Long getCilosses() { + return cilosses; + } + public void setComponentUnit(String componentUnit) { + this.componentUnit = componentUnit; + } + + public String getComponentUnit() { + return componentUnit; + } + public void setComponentProFlag(String componentProFlag) { + this.componentProFlag = componentProFlag; + } + + public String getComponentProFlag() { + return componentProFlag; + } + public void setMsi(String msi) { + this.msi = msi; + } + + public String getMsi() { + return msi; + } + public void setSanka(String sanka) { + this.sanka = sanka; + } + + public String getSanka() { + return sanka; + } + public void setAttr1(String attr1) { + this.attr1 = attr1; + } + + public String getAttr1() { + return attr1; + } + public void setAttr2(String attr2) { + this.attr2 = attr2; + } + + public String getAttr2() { + return attr2; + } + public void setAttr3(String attr3) { + this.attr3 = attr3; + } + + public String getAttr3() { + return attr3; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("bomCode", getBomCode()) + .append("site", getSite()) + .append("productCode", getProductCode()) + .append("cumc", getCumc()) + .append("component", getComponent()) + .append("bomHierarchy", getBomHierarchy()) + .append("projectNo", getProjectNo()) + .append("standardDosage", getStandardDosage()) + .append("lossRate", getLossRate()) + .append("lossAmount", getLossAmount()) + .append("cilosses", getCilosses()) + .append("componentUnit", getComponentUnit()) + .append("componentProFlag", getComponentProFlag()) + .append("msi", getMsi()) + .append("sanka", getSanka()) + .append("attr1", getAttr1()) + .append("attr2", getAttr2()) + .append("attr3", getAttr3()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseBomComponentMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseBomComponentMapper.java new file mode 100644 index 00000000..77b82ca3 --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseBomComponentMapper.java @@ -0,0 +1,61 @@ +package com.op.wms.mapper; + +import java.util.List; + +import com.op.wms.domain.BaseBomComponent; + +/** + * 物料BOM子表Mapper接口 + * + * @author Open Platform + * @date 2023-08-04 + */ +public interface BaseBomComponentMapper { + /** + * 查询物料BOM子表 + * + * @param id 物料BOM子表主键 + * @return 物料BOM子表 + */ + public BaseBomComponent selectBaseBomComponentById(Long id); + + /** + * 查询物料BOM子表列表 + * + * @param baseBomComponent 物料BOM子表 + * @return 物料BOM子表集合 + */ + public List selectBaseBomComponentList(BaseBomComponent baseBomComponent); + + /** + * 新增物料BOM子表 + * + * @param baseBomComponent 物料BOM子表 + * @return 结果 + */ + public int insertBaseBomComponent(BaseBomComponent baseBomComponent); + + /** + * 修改物料BOM子表 + * + * @param baseBomComponent 物料BOM子表 + * @return 结果 + */ + public int updateBaseBomComponent(BaseBomComponent baseBomComponent); + + /** + * 删除物料BOM子表 + * + * @param id 物料BOM子表主键 + * @return 结果 + */ + public int deleteBaseBomComponentById(Long id); + + /** + * 批量删除物料BOM子表 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteBaseBomComponentByIds(Long[] ids); +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseBomComponentService.java b/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseBomComponentService.java new file mode 100644 index 00000000..2ff7f57f --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseBomComponentService.java @@ -0,0 +1,60 @@ +package com.op.wms.service; + +import java.util.List; +import com.op.wms.domain.BaseBomComponent; + +/** + * 物料BOM子表Service接口 + * + * @author Open Platform + * @date 2023-08-04 + */ +public interface IBaseBomComponentService { + /** + * 查询物料BOM子表 + * + * @param id 物料BOM子表主键 + * @return 物料BOM子表 + */ + public BaseBomComponent selectBaseBomComponentById(Long id); + + /** + * 查询物料BOM子表列表 + * + * @param baseBomComponent 物料BOM子表 + * @return 物料BOM子表集合 + */ + public List selectBaseBomComponentList(BaseBomComponent baseBomComponent); + + /** + * 新增物料BOM子表 + * + * @param baseBomComponent 物料BOM子表 + * @return 结果 + */ + public int insertBaseBomComponent(BaseBomComponent baseBomComponent); + + /** + * 修改物料BOM子表 + * + * @param baseBomComponent 物料BOM子表 + * @return 结果 + */ + public int updateBaseBomComponent(BaseBomComponent baseBomComponent); + + /** + * 批量删除物料BOM子表 + * + * @param ids 需要删除的物料BOM子表主键集合 + * @return 结果 + */ + public int deleteBaseBomComponentByIds(Long[] ids); + + /** + * 删除物料BOM子表信息 + * + * @param id 物料BOM子表主键 + * @return 结果 + */ + public int deleteBaseBomComponentById(Long id); +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseBomComponentServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseBomComponentServiceImpl.java new file mode 100644 index 00000000..b9c704e2 --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseBomComponentServiceImpl.java @@ -0,0 +1,89 @@ +package com.op.wms.service.impl; + +import java.util.List; +import com.op.common.core.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.op.wms.mapper.BaseBomComponentMapper; +import com.op.wms.domain.BaseBomComponent; +import com.op.wms.service.IBaseBomComponentService; + +/** + * 物料BOM子表Service业务层处理 + * + * @author Open Platform + * @date 2023-08-04 + */ +@Service +public class BaseBomComponentServiceImpl implements IBaseBomComponentService { + @Autowired + private BaseBomComponentMapper baseBomComponentMapper; + + /** + * 查询物料BOM子表 + * + * @param id 物料BOM子表主键 + * @return 物料BOM子表 + */ + @Override + public BaseBomComponent selectBaseBomComponentById(Long id) { + return baseBomComponentMapper.selectBaseBomComponentById(id); + } + + /** + * 查询物料BOM子表列表 + * + * @param baseBomComponent 物料BOM子表 + * @return 物料BOM子表 + */ + @Override + public List selectBaseBomComponentList(BaseBomComponent baseBomComponent) { + return baseBomComponentMapper.selectBaseBomComponentList(baseBomComponent); + } + + /** + * 新增物料BOM子表 + * + * @param baseBomComponent 物料BOM子表 + * @return 结果 + */ + @Override + public int insertBaseBomComponent(BaseBomComponent baseBomComponent) { + baseBomComponent.setCreateTime(DateUtils.getNowDate()); + return baseBomComponentMapper.insertBaseBomComponent(baseBomComponent); + } + + /** + * 修改物料BOM子表 + * + * @param baseBomComponent 物料BOM子表 + * @return 结果 + */ + @Override + public int updateBaseBomComponent(BaseBomComponent baseBomComponent) { + baseBomComponent.setUpdateTime(DateUtils.getNowDate()); + return baseBomComponentMapper.updateBaseBomComponent(baseBomComponent); + } + + /** + * 批量删除物料BOM子表 + * + * @param ids 需要删除的物料BOM子表主键 + * @return 结果 + */ + @Override + public int deleteBaseBomComponentByIds(Long[] ids) { + return baseBomComponentMapper.deleteBaseBomComponentByIds(ids); + } + + /** + * 删除物料BOM子表信息 + * + * @param id 物料BOM子表主键 + * @return 结果 + */ + @Override + public int deleteBaseBomComponentById(Long id) { + return baseBomComponentMapper.deleteBaseBomComponentById(id); + } +} diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/BaseBomComponentMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/BaseBomComponentMapper.xml new file mode 100644 index 00000000..764914fc --- /dev/null +++ b/op-modules/op-wms/src/main/resources/mapper/wms/BaseBomComponentMapper.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, bom_code, site, product_code, cumc, component, bom_hierarchy, project_no, standard_dosage, loss_rate, loss_amount, cilosses, component_unit, component_pro_flag, msi, sanka, attr1, attr2, attr3, create_by, create_time, update_by, update_time, remark from base_bom_component + + + + + + + + insert into base_bom_component + + id, + bom_code, + site, + product_code, + cumc, + component, + bom_hierarchy, + project_no, + standard_dosage, + loss_rate, + loss_amount, + cilosses, + component_unit, + component_pro_flag, + msi, + sanka, + attr1, + attr2, + attr3, + create_by, + create_time, + update_by, + update_time, + remark, + + + #{id}, + #{bomCode}, + #{site}, + #{productCode}, + #{cumc}, + #{component}, + #{bomHierarchy}, + #{projectNo}, + #{standardDosage}, + #{lossRate}, + #{lossAmount}, + #{cilosses}, + #{componentUnit}, + #{componentProFlag}, + #{msi}, + #{sanka}, + #{attr1}, + #{attr2}, + #{attr3}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update base_bom_component + + bom_code = #{bomCode}, + site = #{site}, + product_code = #{productCode}, + cumc = #{cumc}, + component = #{component}, + bom_hierarchy = #{bomHierarchy}, + project_no = #{projectNo}, + standard_dosage = #{standardDosage}, + loss_rate = #{lossRate}, + loss_amount = #{lossAmount}, + cilosses = #{cilosses}, + component_unit = #{componentUnit}, + component_pro_flag = #{componentProFlag}, + msi = #{msi}, + sanka = #{sanka}, + attr1 = #{attr1}, + attr2 = #{attr2}, + attr3 = #{attr3}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + delete from base_bom_component where id = #{id} + + + + delete from base_bom_component where id in + + #{id} + + + \ No newline at end of file