基础信息 BOM子表

highway
A0010407 1 year ago
parent f10988a3c3
commit 495255e9a5

@ -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;
/**
* BOMController
*
* @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<BaseBomComponent> 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<BaseBomComponent> list = baseBomComponentService.selectBaseBomComponentList(baseBomComponent);
ExcelUtil<BaseBomComponent> util = new ExcelUtil<BaseBomComponent>(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));
}
}

@ -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();
}
}

@ -0,0 +1,61 @@
package com.op.wms.mapper;
import java.util.List;
import com.op.wms.domain.BaseBomComponent;
/**
* BOMMapper
*
* @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<BaseBomComponent> 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);
}

@ -0,0 +1,60 @@
package com.op.wms.service;
import java.util.List;
import com.op.wms.domain.BaseBomComponent;
/**
* BOMService
*
* @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<BaseBomComponent> 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);
}

@ -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;
/**
* BOMService
*
* @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<BaseBomComponent> 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);
}
}

@ -0,0 +1,163 @@
<?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="com.op.wms.mapper.BaseBomComponentMapper">
<resultMap type="BaseBomComponent" id="BaseBomComponentResult">
<result property="id" column="id" />
<result property="bomCode" column="bom_code" />
<result property="site" column="site" />
<result property="productCode" column="product_code" />
<result property="cumc" column="cumc" />
<result property="component" column="component" />
<result property="bomHierarchy" column="bom_hierarchy" />
<result property="projectNo" column="project_no" />
<result property="standardDosage" column="standard_dosage" />
<result property="lossRate" column="loss_rate" />
<result property="lossAmount" column="loss_amount" />
<result property="cilosses" column="cilosses" />
<result property="componentUnit" column="component_unit" />
<result property="componentProFlag" column="component_pro_flag" />
<result property="msi" column="msi" />
<result property="sanka" column="sanka" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectBaseBomComponentVo">
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
</sql>
<select id="selectBaseBomComponentList" parameterType="BaseBomComponent" resultMap="BaseBomComponentResult">
<include refid="selectBaseBomComponentVo"/>
<where>
<if test="bomCode != null and bomCode != ''"> and bom_code = #{bomCode}</if>
<if test="site != null and site != ''"> and site = #{site}</if>
<if test="productCode != null and productCode != ''"> and product_code = #{productCode}</if>
<if test="cumc != null and cumc != ''"> and cumc = #{cumc}</if>
<if test="component != null and component != ''"> and component = #{component}</if>
<if test="bomHierarchy != null and bomHierarchy != ''"> and bom_hierarchy = #{bomHierarchy}</if>
<if test="projectNo != null and projectNo != ''"> and project_no = #{projectNo}</if>
<if test="standardDosage != null "> and standard_dosage = #{standardDosage}</if>
<if test="lossRate != null "> and loss_rate = #{lossRate}</if>
<if test="lossAmount != null "> and loss_amount = #{lossAmount}</if>
<if test="cilosses != null "> and cilosses = #{cilosses}</if>
<if test="componentUnit != null and componentUnit != ''"> and component_unit = #{componentUnit}</if>
<if test="componentProFlag != null and componentProFlag != ''"> and component_pro_flag = #{componentProFlag}</if>
<if test="msi != null and msi != ''"> and msi = #{msi}</if>
<if test="sanka != null and sanka != ''"> and sanka = #{sanka}</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
</where>
</select>
<select id="selectBaseBomComponentById" parameterType="Long" resultMap="BaseBomComponentResult">
<include refid="selectBaseBomComponentVo"/>
where id = #{id}
</select>
<insert id="insertBaseBomComponent" parameterType="BaseBomComponent">
insert into base_bom_component
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="bomCode != null and bomCode != ''">bom_code,</if>
<if test="site != null">site,</if>
<if test="productCode != null">product_code,</if>
<if test="cumc != null">cumc,</if>
<if test="component != null">component,</if>
<if test="bomHierarchy != null">bom_hierarchy,</if>
<if test="projectNo != null">project_no,</if>
<if test="standardDosage != null">standard_dosage,</if>
<if test="lossRate != null">loss_rate,</if>
<if test="lossAmount != null">loss_amount,</if>
<if test="cilosses != null">cilosses,</if>
<if test="componentUnit != null">component_unit,</if>
<if test="componentProFlag != null">component_pro_flag,</if>
<if test="msi != null">msi,</if>
<if test="sanka != null">sanka,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="bomCode != null and bomCode != ''">#{bomCode},</if>
<if test="site != null">#{site},</if>
<if test="productCode != null">#{productCode},</if>
<if test="cumc != null">#{cumc},</if>
<if test="component != null">#{component},</if>
<if test="bomHierarchy != null">#{bomHierarchy},</if>
<if test="projectNo != null">#{projectNo},</if>
<if test="standardDosage != null">#{standardDosage},</if>
<if test="lossRate != null">#{lossRate},</if>
<if test="lossAmount != null">#{lossAmount},</if>
<if test="cilosses != null">#{cilosses},</if>
<if test="componentUnit != null">#{componentUnit},</if>
<if test="componentProFlag != null">#{componentProFlag},</if>
<if test="msi != null">#{msi},</if>
<if test="sanka != null">#{sanka},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateBaseBomComponent" parameterType="BaseBomComponent">
update base_bom_component
<trim prefix="SET" suffixOverrides=",">
<if test="bomCode != null and bomCode != ''">bom_code = #{bomCode},</if>
<if test="site != null">site = #{site},</if>
<if test="productCode != null">product_code = #{productCode},</if>
<if test="cumc != null">cumc = #{cumc},</if>
<if test="component != null">component = #{component},</if>
<if test="bomHierarchy != null">bom_hierarchy = #{bomHierarchy},</if>
<if test="projectNo != null">project_no = #{projectNo},</if>
<if test="standardDosage != null">standard_dosage = #{standardDosage},</if>
<if test="lossRate != null">loss_rate = #{lossRate},</if>
<if test="lossAmount != null">loss_amount = #{lossAmount},</if>
<if test="cilosses != null">cilosses = #{cilosses},</if>
<if test="componentUnit != null">component_unit = #{componentUnit},</if>
<if test="componentProFlag != null">component_pro_flag = #{componentProFlag},</if>
<if test="msi != null">msi = #{msi},</if>
<if test="sanka != null">sanka = #{sanka},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBaseBomComponentById" parameterType="Long">
delete from base_bom_component where id = #{id}
</delete>
<delete id="deleteBaseBomComponentByIds" parameterType="String">
delete from base_bom_component where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save