add - 订单BOM、生产BOM
parent
6e4c6a06ca
commit
170354eee0
@ -0,0 +1,101 @@
|
||||
package com.aucma.base.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.aucma.common.utils.DateUtils;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
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.aucma.common.annotation.Log;
|
||||
import com.aucma.common.core.controller.BaseController;
|
||||
import com.aucma.common.core.domain.AjaxResult;
|
||||
import com.aucma.common.enums.BusinessType;
|
||||
import com.aucma.base.domain.OrderBomInfo;
|
||||
import com.aucma.base.service.IOrderBomInfoService;
|
||||
import com.aucma.common.utils.poi.ExcelUtil;
|
||||
|
||||
/**
|
||||
* 订单BOMController
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-09-28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base/orderBomInfo")
|
||||
public class OrderBomInfoController extends BaseController {
|
||||
@Autowired
|
||||
private IOrderBomInfoService orderBomInfoService;
|
||||
|
||||
/**
|
||||
* 查询订单BOM列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:orderBomInfo:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(OrderBomInfo orderBomInfo) {
|
||||
List<OrderBomInfo> list = orderBomInfoService.selectOrderBomInfoList(orderBomInfo);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出订单BOM列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:orderBomInfo:export')")
|
||||
@Log(title = "订单BOM", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, OrderBomInfo orderBomInfo) {
|
||||
List<OrderBomInfo> list = orderBomInfoService.selectOrderBomInfoList(orderBomInfo);
|
||||
ExcelUtil<OrderBomInfo> util = new ExcelUtil<OrderBomInfo>(OrderBomInfo.class);
|
||||
util.exportExcel(response, list, "订单BOM数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单BOM详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:orderBomInfo:query')")
|
||||
@GetMapping(value = "/{objId}")
|
||||
public AjaxResult getInfo(@PathVariable("objId") Long objId) {
|
||||
return success(orderBomInfoService.selectOrderBomInfoByObjId(objId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单BOM
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:orderBomInfo:add')")
|
||||
@Log(title = "订单BOM", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody OrderBomInfo orderBomInfo) {
|
||||
orderBomInfo.setCreatedBy(getUsername());
|
||||
orderBomInfo.setCreatedTime(DateUtils.getNowDate());
|
||||
return toAjax(orderBomInfoService.insertOrderBomInfo(orderBomInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单BOM
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:orderBomInfo:edit')")
|
||||
@Log(title = "订单BOM", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody OrderBomInfo orderBomInfo) {
|
||||
orderBomInfo.setUpdatedBy(getUsername());
|
||||
orderBomInfo.setUpdatedTime(DateUtils.getNowDate());
|
||||
return toAjax(orderBomInfoService.updateOrderBomInfo(orderBomInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单BOM
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:orderBomInfo:remove')")
|
||||
@Log(title = "订单BOM", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{objIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] objIds) {
|
||||
return toAjax(orderBomInfoService.deleteOrderBomInfoByObjIds(objIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,253 @@
|
||||
package com.aucma.base.domain;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.aucma.common.core.domain.model.TreeStringEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.aucma.common.annotation.Excel;
|
||||
import com.aucma.common.core.domain.TreeEntity;
|
||||
|
||||
/**
|
||||
* 订单BOM对象 order_bominfo
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-09-28
|
||||
*/
|
||||
public class OrderBomInfo extends TreeStringEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键标识
|
||||
*/
|
||||
private Long objId;
|
||||
|
||||
/**
|
||||
* BOM编号
|
||||
*/
|
||||
@Excel(name = "BOM编号")
|
||||
private String bomCode;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
@Excel(name = "物料编码")
|
||||
private String materialCode;
|
||||
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
@Excel(name = "物料名称")
|
||||
private String materialName;
|
||||
|
||||
/**
|
||||
* 物料类别
|
||||
*/
|
||||
@Excel(name = "物料类别")
|
||||
private String materialType;
|
||||
|
||||
/**
|
||||
* 标准数量
|
||||
*/
|
||||
@Excel(name = "标准数量")
|
||||
private Long standardAmount;
|
||||
|
||||
/**
|
||||
* 启用标识
|
||||
*/
|
||||
@Excel(name = "启用标识")
|
||||
private Long isFlag;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@Excel(name = "创建人")
|
||||
private String createdBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@Excel(name = "更新人")
|
||||
private String updatedBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updatedTime;
|
||||
|
||||
/**
|
||||
* 工厂编号
|
||||
*/
|
||||
@Excel(name = "工厂编号")
|
||||
private String factoryCode;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@Excel(name = "排序")
|
||||
private String sort;
|
||||
|
||||
/**
|
||||
* 销售凭证
|
||||
*/
|
||||
@Excel(name = "销售凭证")
|
||||
private String vbeln;
|
||||
|
||||
/**
|
||||
* 销售单据项目
|
||||
*/
|
||||
@Excel(name = "销售单据项目")
|
||||
private String vbpos;
|
||||
|
||||
public void setObjId(Long objId) {
|
||||
this.objId = objId;
|
||||
}
|
||||
|
||||
public Long getObjId() {
|
||||
return objId;
|
||||
}
|
||||
|
||||
public void setBomCode(String bomCode) {
|
||||
this.bomCode = bomCode;
|
||||
}
|
||||
|
||||
public String getBomCode() {
|
||||
return bomCode;
|
||||
}
|
||||
|
||||
public void setMaterialCode(String materialCode) {
|
||||
this.materialCode = materialCode;
|
||||
}
|
||||
|
||||
public String getMaterialCode() {
|
||||
return materialCode;
|
||||
}
|
||||
|
||||
public void setMaterialName(String materialName) {
|
||||
this.materialName = materialName;
|
||||
}
|
||||
|
||||
public String getMaterialName() {
|
||||
return materialName;
|
||||
}
|
||||
|
||||
public void setMaterialType(String materialType) {
|
||||
this.materialType = materialType;
|
||||
}
|
||||
|
||||
public String getMaterialType() {
|
||||
return materialType;
|
||||
}
|
||||
|
||||
public void setStandardAmount(Long standardAmount) {
|
||||
this.standardAmount = standardAmount;
|
||||
}
|
||||
|
||||
public Long getStandardAmount() {
|
||||
return standardAmount;
|
||||
}
|
||||
|
||||
public void setIsFlag(Long isFlag) {
|
||||
this.isFlag = isFlag;
|
||||
}
|
||||
|
||||
public Long getIsFlag() {
|
||||
return isFlag;
|
||||
}
|
||||
|
||||
public void setCreatedBy(String createdBy) {
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
public String getCreatedBy() {
|
||||
return createdBy;
|
||||
}
|
||||
|
||||
public void setCreatedTime(Date createdTime) {
|
||||
this.createdTime = createdTime;
|
||||
}
|
||||
|
||||
public Date getCreatedTime() {
|
||||
return createdTime;
|
||||
}
|
||||
|
||||
public void setUpdatedBy(String updatedBy) {
|
||||
this.updatedBy = updatedBy;
|
||||
}
|
||||
|
||||
public String getUpdatedBy() {
|
||||
return updatedBy;
|
||||
}
|
||||
|
||||
public void setUpdatedTime(Date updatedTime) {
|
||||
this.updatedTime = updatedTime;
|
||||
}
|
||||
|
||||
public Date getUpdatedTime() {
|
||||
return updatedTime;
|
||||
}
|
||||
|
||||
public void setFactoryCode(String factoryCode) {
|
||||
this.factoryCode = factoryCode;
|
||||
}
|
||||
|
||||
public String getFactoryCode() {
|
||||
return factoryCode;
|
||||
}
|
||||
|
||||
public void setSort(String sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public String getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public void setVbeln(String vbeln) {
|
||||
this.vbeln = vbeln;
|
||||
}
|
||||
|
||||
public String getVbeln() {
|
||||
return vbeln;
|
||||
}
|
||||
|
||||
public void setVbpos(String vbpos) {
|
||||
this.vbpos = vbpos;
|
||||
}
|
||||
|
||||
public String getVbpos() {
|
||||
return vbpos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("objId", getObjId())
|
||||
.append("bomCode", getBomCode())
|
||||
.append("materialCode", getMaterialCode())
|
||||
.append("materialName", getMaterialName())
|
||||
.append("materialType", getMaterialType())
|
||||
.append("standardAmount", getStandardAmount())
|
||||
.append("parentId", getParentId())
|
||||
.append("isFlag", getIsFlag())
|
||||
.append("createdBy", getCreatedBy())
|
||||
.append("createdTime", getCreatedTime())
|
||||
.append("updatedBy", getUpdatedBy())
|
||||
.append("updatedTime", getUpdatedTime())
|
||||
.append("factoryCode", getFactoryCode())
|
||||
.append("sort", getSort())
|
||||
.append("vbeln", getVbeln())
|
||||
.append("vbpos", getVbpos())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.aucma.base.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.aucma.base.domain.OrderBomInfo;
|
||||
|
||||
/**
|
||||
* 订单BOMMapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-09-28
|
||||
*/
|
||||
public interface OrderBomInfoMapper
|
||||
{
|
||||
/**
|
||||
* 查询订单BOM
|
||||
*
|
||||
* @param objId 订单BOM主键
|
||||
* @return 订单BOM
|
||||
*/
|
||||
public OrderBomInfo selectOrderBomInfoByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询订单BOM列表
|
||||
*
|
||||
* @param orderBomInfo 订单BOM
|
||||
* @return 订单BOM集合
|
||||
*/
|
||||
public List<OrderBomInfo> selectOrderBomInfoList(OrderBomInfo orderBomInfo);
|
||||
|
||||
/**
|
||||
* 新增订单BOM
|
||||
*
|
||||
* @param orderBomInfo 订单BOM
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertOrderBomInfo(OrderBomInfo orderBomInfo);
|
||||
|
||||
/**
|
||||
* 修改订单BOM
|
||||
*
|
||||
* @param orderBomInfo 订单BOM
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateOrderBomInfo(OrderBomInfo orderBomInfo);
|
||||
|
||||
/**
|
||||
* 删除订单BOM
|
||||
*
|
||||
* @param objId 订单BOM主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteOrderBomInfoByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 批量删除订单BOM
|
||||
*
|
||||
* @param objIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteOrderBomInfoByObjIds(Long[] objIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.aucma.base.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.aucma.base.domain.OrderBomInfo;
|
||||
|
||||
/**
|
||||
* 订单BOMService接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-09-28
|
||||
*/
|
||||
public interface IOrderBomInfoService
|
||||
{
|
||||
/**
|
||||
* 查询订单BOM
|
||||
*
|
||||
* @param objId 订单BOM主键
|
||||
* @return 订单BOM
|
||||
*/
|
||||
public OrderBomInfo selectOrderBomInfoByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询订单BOM列表
|
||||
*
|
||||
* @param orderBomInfo 订单BOM
|
||||
* @return 订单BOM集合
|
||||
*/
|
||||
public List<OrderBomInfo> selectOrderBomInfoList(OrderBomInfo orderBomInfo);
|
||||
|
||||
/**
|
||||
* 新增订单BOM
|
||||
*
|
||||
* @param orderBomInfo 订单BOM
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertOrderBomInfo(OrderBomInfo orderBomInfo);
|
||||
|
||||
/**
|
||||
* 修改订单BOM
|
||||
*
|
||||
* @param orderBomInfo 订单BOM
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateOrderBomInfo(OrderBomInfo orderBomInfo);
|
||||
|
||||
/**
|
||||
* 批量删除订单BOM
|
||||
*
|
||||
* @param objIds 需要删除的订单BOM主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteOrderBomInfoByObjIds(Long[] objIds);
|
||||
|
||||
/**
|
||||
* 删除订单BOM信息
|
||||
*
|
||||
* @param objId 订单BOM主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteOrderBomInfoByObjId(Long objId);
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package com.aucma.base.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.aucma.base.mapper.OrderBomInfoMapper;
|
||||
import com.aucma.base.domain.OrderBomInfo;
|
||||
import com.aucma.base.service.IOrderBomInfoService;
|
||||
|
||||
/**
|
||||
* 订单BOMService业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-09-28
|
||||
*/
|
||||
@Service
|
||||
public class OrderBomInfoServiceImpl implements IOrderBomInfoService
|
||||
{
|
||||
@Autowired
|
||||
private OrderBomInfoMapper orderBomInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询订单BOM
|
||||
*
|
||||
* @param objId 订单BOM主键
|
||||
* @return 订单BOM
|
||||
*/
|
||||
@Override
|
||||
public OrderBomInfo selectOrderBomInfoByObjId(Long objId)
|
||||
{
|
||||
return orderBomInfoMapper.selectOrderBomInfoByObjId(objId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单BOM列表
|
||||
*
|
||||
* @param orderBomInfo 订单BOM
|
||||
* @return 订单BOM
|
||||
*/
|
||||
@Override
|
||||
public List<OrderBomInfo> selectOrderBomInfoList(OrderBomInfo orderBomInfo)
|
||||
{
|
||||
return orderBomInfoMapper.selectOrderBomInfoList(orderBomInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单BOM
|
||||
*
|
||||
* @param orderBomInfo 订单BOM
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertOrderBomInfo(OrderBomInfo orderBomInfo)
|
||||
{
|
||||
return orderBomInfoMapper.insertOrderBomInfo(orderBomInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单BOM
|
||||
*
|
||||
* @param orderBomInfo 订单BOM
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateOrderBomInfo(OrderBomInfo orderBomInfo)
|
||||
{
|
||||
return orderBomInfoMapper.updateOrderBomInfo(orderBomInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除订单BOM
|
||||
*
|
||||
* @param objIds 需要删除的订单BOM主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteOrderBomInfoByObjIds(Long[] objIds)
|
||||
{
|
||||
return orderBomInfoMapper.deleteOrderBomInfoByObjIds(objIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单BOM信息
|
||||
*
|
||||
* @param objId 订单BOM主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteOrderBomInfoByObjId(Long objId)
|
||||
{
|
||||
return orderBomInfoMapper.deleteOrderBomInfoByObjId(objId);
|
||||
}
|
||||
}
|
@ -0,0 +1,131 @@
|
||||
<?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.aucma.base.mapper.OrderBomInfoMapper">
|
||||
|
||||
<resultMap type="OrderBomInfo" id="OrderBomInfoResult">
|
||||
<result property="objId" column="obj_id" />
|
||||
<result property="bomCode" column="bom_code" />
|
||||
<result property="materialCode" column="material_code" />
|
||||
<result property="materialName" column="material_name" />
|
||||
<result property="materialType" column="material_type" />
|
||||
<result property="standardAmount" column="standard_amount" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="isFlag" column="is_flag" />
|
||||
<result property="createdBy" column="created_by" />
|
||||
<result property="createdTime" column="created_time" />
|
||||
<result property="updatedBy" column="updated_by" />
|
||||
<result property="updatedTime" column="updated_time" />
|
||||
<result property="factoryCode" column="factory_code" />
|
||||
<result property="sort" column="sort" />
|
||||
<result property="vbeln" column="vbeln" />
|
||||
<result property="vbpos" column="vbpos" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectOrderBomInfoVo">
|
||||
select obj_id, bom_code, material_code, material_name, material_type, standard_amount, parent_id, is_flag, created_by, created_time, updated_by, updated_time, factory_code, sort, vbeln, vbpos from order_bominfo
|
||||
</sql>
|
||||
|
||||
<select id="selectOrderBomInfoList" parameterType="OrderBomInfo" resultMap="OrderBomInfoResult">
|
||||
<include refid="selectOrderBomInfoVo"/>
|
||||
<where>
|
||||
<if test="bomCode != null and bomCode != ''"> and bom_code = #{bomCode}</if>
|
||||
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
|
||||
<if test="materialName != null and materialName != ''"> and material_name like concat(concat('%', #{materialName}), '%')</if>
|
||||
<if test="materialType != null and materialType != ''"> and material_type = #{materialType}</if>
|
||||
<if test="standardAmount != null "> and standard_amount = #{standardAmount}</if>
|
||||
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId}</if>
|
||||
<if test="isFlag != null "> and is_flag = #{isFlag}</if>
|
||||
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy}</if>
|
||||
<if test="createdTime != null "> and created_time = #{createdTime}</if>
|
||||
<if test="updatedBy != null and updatedBy != ''"> and updated_by = #{updatedBy}</if>
|
||||
<if test="updatedTime != null "> and updated_time = #{updatedTime}</if>
|
||||
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
|
||||
<if test="sort != null and sort != ''"> and sort = #{sort}</if>
|
||||
<if test="vbeln != null and vbeln != ''"> and vbeln = #{vbeln}</if>
|
||||
<if test="vbpos != null and vbpos != ''"> and vbpos = #{vbpos}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectOrderBomInfoByObjId" parameterType="Long" resultMap="OrderBomInfoResult">
|
||||
<include refid="selectOrderBomInfoVo"/>
|
||||
where obj_id = #{objId}
|
||||
</select>
|
||||
|
||||
<insert id="insertOrderBomInfo" parameterType="OrderBomInfo">
|
||||
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
|
||||
SELECT seq_order_bominfo.NEXTVAL as objId FROM DUAL
|
||||
</selectKey>
|
||||
insert into order_bominfo
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="objId != null">obj_id,</if>
|
||||
<if test="bomCode != null">bom_code,</if>
|
||||
<if test="materialCode != null">material_code,</if>
|
||||
<if test="materialName != null">material_name,</if>
|
||||
<if test="materialType != null">material_type,</if>
|
||||
<if test="standardAmount != null">standard_amount,</if>
|
||||
<if test="parentId != null">parent_id,</if>
|
||||
<if test="isFlag != null">is_flag,</if>
|
||||
<if test="createdBy != null">created_by,</if>
|
||||
<if test="createdTime != null">created_time,</if>
|
||||
<if test="updatedBy != null">updated_by,</if>
|
||||
<if test="updatedTime != null">updated_time,</if>
|
||||
<if test="factoryCode != null">factory_code,</if>
|
||||
<if test="sort != null">sort,</if>
|
||||
<if test="vbeln != null">vbeln,</if>
|
||||
<if test="vbpos != null">vbpos,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="objId != null">#{objId},</if>
|
||||
<if test="bomCode != null">#{bomCode},</if>
|
||||
<if test="materialCode != null">#{materialCode},</if>
|
||||
<if test="materialName != null">#{materialName},</if>
|
||||
<if test="materialType != null">#{materialType},</if>
|
||||
<if test="standardAmount != null">#{standardAmount},</if>
|
||||
<if test="parentId != null">#{parentId},</if>
|
||||
<if test="isFlag != null">#{isFlag},</if>
|
||||
<if test="createdBy != null">#{createdBy},</if>
|
||||
<if test="createdTime != null">#{createdTime},</if>
|
||||
<if test="updatedBy != null">#{updatedBy},</if>
|
||||
<if test="updatedTime != null">#{updatedTime},</if>
|
||||
<if test="factoryCode != null">#{factoryCode},</if>
|
||||
<if test="sort != null">#{sort},</if>
|
||||
<if test="vbeln != null">#{vbeln},</if>
|
||||
<if test="vbpos != null">#{vbpos},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateOrderBomInfo" parameterType="OrderBomInfo">
|
||||
update order_bominfo
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="bomCode != null">bom_code = #{bomCode},</if>
|
||||
<if test="materialCode != null">material_code = #{materialCode},</if>
|
||||
<if test="materialName != null">material_name = #{materialName},</if>
|
||||
<if test="materialType != null">material_type = #{materialType},</if>
|
||||
<if test="standardAmount != null">standard_amount = #{standardAmount},</if>
|
||||
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||
<if test="isFlag != null">is_flag = #{isFlag},</if>
|
||||
<if test="createdBy != null">created_by = #{createdBy},</if>
|
||||
<if test="createdTime != null">created_time = #{createdTime},</if>
|
||||
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
|
||||
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
|
||||
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
|
||||
<if test="sort != null">sort = #{sort},</if>
|
||||
<if test="vbeln != null">vbeln = #{vbeln},</if>
|
||||
<if test="vbpos != null">vbpos = #{vbpos},</if>
|
||||
</trim>
|
||||
where obj_id = #{objId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteOrderBomInfoByObjId" parameterType="Long">
|
||||
delete from order_bominfo where obj_id = #{objId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteOrderBomInfoByObjIds" parameterType="String">
|
||||
delete from order_bominfo where obj_id in
|
||||
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
||||
#{objId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,81 @@
|
||||
package com.aucma.common.core.domain.model;
|
||||
|
||||
import com.aucma.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Tree基类
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class TreeStringEntity extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 父菜单名称 */
|
||||
private String parentName;
|
||||
|
||||
/** 父菜单ID */
|
||||
private String parentId;
|
||||
|
||||
/** 显示顺序 */
|
||||
private Integer orderNum;
|
||||
|
||||
/** 祖级列表 */
|
||||
private String ancestors;
|
||||
|
||||
/** 子部门 */
|
||||
private List<?> children = new ArrayList<>();
|
||||
|
||||
public String getParentName()
|
||||
{
|
||||
return parentName;
|
||||
}
|
||||
|
||||
public void setParentName(String parentName)
|
||||
{
|
||||
this.parentName = parentName;
|
||||
}
|
||||
|
||||
public String getParentId()
|
||||
{
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setParentId(String parentId)
|
||||
{
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public Integer getOrderNum()
|
||||
{
|
||||
return orderNum;
|
||||
}
|
||||
|
||||
public void setOrderNum(Integer orderNum)
|
||||
{
|
||||
this.orderNum = orderNum;
|
||||
}
|
||||
|
||||
public String getAncestors()
|
||||
{
|
||||
return ancestors;
|
||||
}
|
||||
|
||||
public void setAncestors(String ancestors)
|
||||
{
|
||||
this.ancestors = ancestors;
|
||||
}
|
||||
|
||||
public List<?> getChildren()
|
||||
{
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<?> children)
|
||||
{
|
||||
this.children = children;
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>aucma</artifactId>
|
||||
<groupId>com.aucma</groupId>
|
||||
<version>3.8.6</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>aucma-production</artifactId>
|
||||
|
||||
|
||||
<description>
|
||||
system系统模块
|
||||
</description>
|
||||
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- 基础数据-->
|
||||
<dependency>
|
||||
<groupId>com.aucma</groupId>
|
||||
<artifactId>aucma-base</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
@ -0,0 +1,103 @@
|
||||
package com.aucma.production.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.aucma.common.utils.DateUtils;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
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.aucma.common.annotation.Log;
|
||||
import com.aucma.common.core.controller.BaseController;
|
||||
import com.aucma.common.core.domain.AjaxResult;
|
||||
import com.aucma.common.enums.BusinessType;
|
||||
import com.aucma.production.domain.BaseBomInfo;
|
||||
import com.aucma.production.service.IBaseBomInfoService;
|
||||
import com.aucma.common.utils.poi.ExcelUtil;
|
||||
import com.aucma.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 生产BOMController
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-09-28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/production/baseBomInfo" )
|
||||
public class BaseBomInfoController extends BaseController {
|
||||
@Autowired
|
||||
private IBaseBomInfoService baseBomInfoService;
|
||||
|
||||
/**
|
||||
* 查询生产BOM列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('production:baseBomInfo:list')" )
|
||||
@GetMapping("/list" )
|
||||
public TableDataInfo list(BaseBomInfo baseBomInfo) {
|
||||
startPage();
|
||||
List<BaseBomInfo> list = baseBomInfoService.selectBaseBomInfoList(baseBomInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出生产BOM列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('production:baseBomInfo:export')" )
|
||||
@Log(title = "生产BOM" , businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export" )
|
||||
public void export(HttpServletResponse response, BaseBomInfo baseBomInfo) {
|
||||
List<BaseBomInfo> list = baseBomInfoService.selectBaseBomInfoList(baseBomInfo);
|
||||
ExcelUtil<BaseBomInfo> util = new ExcelUtil<BaseBomInfo>(BaseBomInfo. class);
|
||||
util.exportExcel(response, list, "生产BOM数据" );
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取生产BOM详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('production:baseBomInfo:query')" )
|
||||
@GetMapping(value = "/{objId}" )
|
||||
public AjaxResult getInfo(@PathVariable("objId" ) Long objId) {
|
||||
return success(baseBomInfoService.selectBaseBomInfoByObjId(objId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产BOM
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('production:baseBomInfo:add')" )
|
||||
@Log(title = "生产BOM" , businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BaseBomInfo baseBomInfo) {
|
||||
baseBomInfo.setCreatedBy(getUsername());
|
||||
baseBomInfo.setCreatedTime(DateUtils.getNowDate());
|
||||
return toAjax(baseBomInfoService.insertBaseBomInfo(baseBomInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产BOM
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('production:baseBomInfo:edit')" )
|
||||
@Log(title = "生产BOM" , businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BaseBomInfo baseBomInfo) {
|
||||
baseBomInfo.setUpdatedBy(getUsername());
|
||||
baseBomInfo.setUpdatedTime(DateUtils.getNowDate());
|
||||
return toAjax(baseBomInfoService.updateBaseBomInfo(baseBomInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产BOM
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('production:baseBomInfo:remove')" )
|
||||
@Log(title = "生产BOM" , businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{objIds}" )
|
||||
public AjaxResult remove(@PathVariable Long[] objIds) {
|
||||
return toAjax(baseBomInfoService.deleteBaseBomInfoByObjIds(objIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,251 @@
|
||||
package com.aucma.production.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.aucma.common.annotation.Excel;
|
||||
import com.aucma.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 生产BOM对象 base_bominfo
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-09-28
|
||||
*/
|
||||
public class BaseBomInfo extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键标识
|
||||
*/
|
||||
private Long objId;
|
||||
|
||||
/**
|
||||
* BOM编号
|
||||
*/
|
||||
@Excel(name = "BOM编号")
|
||||
private String bomCode;
|
||||
|
||||
/**
|
||||
* 子物料编号
|
||||
*/
|
||||
@Excel(name = "子物料编号")
|
||||
private String materialCode;
|
||||
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
@Excel(name = "物料名称")
|
||||
private String materialName;
|
||||
|
||||
/**
|
||||
* 物料类型
|
||||
*/
|
||||
@Excel(name = "物料类型")
|
||||
private String materialType;
|
||||
|
||||
/**
|
||||
* 标准数量
|
||||
*/
|
||||
@Excel(name = "标准数量")
|
||||
private Long standardAmount;
|
||||
|
||||
/**
|
||||
* 父物料编号
|
||||
*/
|
||||
@Excel(name = "父物料编号")
|
||||
private String parentId;
|
||||
|
||||
/**
|
||||
* 工厂编号
|
||||
*/
|
||||
@Excel(name = "工厂编号")
|
||||
private String plantCode;
|
||||
|
||||
/**
|
||||
* 产线/工位
|
||||
*/
|
||||
@Excel(name = "产线/工位")
|
||||
private String productLineCode;
|
||||
|
||||
/**
|
||||
* 是否标识
|
||||
*/
|
||||
@Excel(name = "是否标识")
|
||||
private Long isFlag;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@Excel(name = "创建人")
|
||||
private String createdBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@Excel(name = "更新人")
|
||||
private String updatedBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updatedTime;
|
||||
|
||||
/**
|
||||
* 工单编号
|
||||
*/
|
||||
@Excel(name = "工单编号")
|
||||
private String orderCode;
|
||||
|
||||
public void setObjId(Long objId) {
|
||||
this.objId = objId;
|
||||
}
|
||||
|
||||
public Long getObjId() {
|
||||
return objId;
|
||||
}
|
||||
|
||||
public void setBomCode(String bomCode) {
|
||||
this.bomCode = bomCode;
|
||||
}
|
||||
|
||||
public String getBomCode() {
|
||||
return bomCode;
|
||||
}
|
||||
|
||||
public void setMaterialCode(String materialCode) {
|
||||
this.materialCode = materialCode;
|
||||
}
|
||||
|
||||
public String getMaterialCode() {
|
||||
return materialCode;
|
||||
}
|
||||
|
||||
public void setMaterialName(String materialName) {
|
||||
this.materialName = materialName;
|
||||
}
|
||||
|
||||
public String getMaterialName() {
|
||||
return materialName;
|
||||
}
|
||||
|
||||
public void setMaterialType(String materialType) {
|
||||
this.materialType = materialType;
|
||||
}
|
||||
|
||||
public String getMaterialType() {
|
||||
return materialType;
|
||||
}
|
||||
|
||||
public void setStandardAmount(Long standardAmount) {
|
||||
this.standardAmount = standardAmount;
|
||||
}
|
||||
|
||||
public Long getStandardAmount() {
|
||||
return standardAmount;
|
||||
}
|
||||
|
||||
public void setParentId(String parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public String getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setPlantCode(String plantCode) {
|
||||
this.plantCode = plantCode;
|
||||
}
|
||||
|
||||
public String getPlantCode() {
|
||||
return plantCode;
|
||||
}
|
||||
|
||||
public void setProductLineCode(String productLineCode) {
|
||||
this.productLineCode = productLineCode;
|
||||
}
|
||||
|
||||
public String getProductLineCode() {
|
||||
return productLineCode;
|
||||
}
|
||||
|
||||
public void setIsFlag(Long isFlag) {
|
||||
this.isFlag = isFlag;
|
||||
}
|
||||
|
||||
public Long getIsFlag() {
|
||||
return isFlag;
|
||||
}
|
||||
|
||||
public void setCreatedBy(String createdBy) {
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
public String getCreatedBy() {
|
||||
return createdBy;
|
||||
}
|
||||
|
||||
public void setCreatedTime(Date createdTime) {
|
||||
this.createdTime = createdTime;
|
||||
}
|
||||
|
||||
public Date getCreatedTime() {
|
||||
return createdTime;
|
||||
}
|
||||
|
||||
public void setUpdatedBy(String updatedBy) {
|
||||
this.updatedBy = updatedBy;
|
||||
}
|
||||
|
||||
public String getUpdatedBy() {
|
||||
return updatedBy;
|
||||
}
|
||||
|
||||
public void setUpdatedTime(Date updatedTime) {
|
||||
this.updatedTime = updatedTime;
|
||||
}
|
||||
|
||||
public Date getUpdatedTime() {
|
||||
return updatedTime;
|
||||
}
|
||||
|
||||
public void setOrderCode(String orderCode) {
|
||||
this.orderCode = orderCode;
|
||||
}
|
||||
|
||||
public String getOrderCode() {
|
||||
return orderCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("objId", getObjId())
|
||||
.append("bomCode", getBomCode())
|
||||
.append("materialCode", getMaterialCode())
|
||||
.append("materialName", getMaterialName())
|
||||
.append("materialType", getMaterialType())
|
||||
.append("standardAmount", getStandardAmount())
|
||||
.append("parentId", getParentId())
|
||||
.append("plantCode", getPlantCode())
|
||||
.append("productLineCode", getProductLineCode())
|
||||
.append("isFlag", getIsFlag())
|
||||
.append("createdBy", getCreatedBy())
|
||||
.append("createdTime", getCreatedTime())
|
||||
.append("updatedBy", getUpdatedBy())
|
||||
.append("updatedTime", getUpdatedTime())
|
||||
.append("orderCode", getOrderCode())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.aucma.production.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.aucma.production.domain.BaseBomInfo;
|
||||
|
||||
/**
|
||||
* 生产BOMMapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-09-28
|
||||
*/
|
||||
public interface BaseBomInfoMapper
|
||||
{
|
||||
/**
|
||||
* 查询生产BOM
|
||||
*
|
||||
* @param objId 生产BOM主键
|
||||
* @return 生产BOM
|
||||
*/
|
||||
public BaseBomInfo selectBaseBomInfoByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询生产BOM列表
|
||||
*
|
||||
* @param baseBomInfo 生产BOM
|
||||
* @return 生产BOM集合
|
||||
*/
|
||||
public List<BaseBomInfo> selectBaseBomInfoList(BaseBomInfo baseBomInfo);
|
||||
|
||||
/**
|
||||
* 新增生产BOM
|
||||
*
|
||||
* @param baseBomInfo 生产BOM
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseBomInfo(BaseBomInfo baseBomInfo);
|
||||
|
||||
/**
|
||||
* 修改生产BOM
|
||||
*
|
||||
* @param baseBomInfo 生产BOM
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseBomInfo(BaseBomInfo baseBomInfo);
|
||||
|
||||
/**
|
||||
* 删除生产BOM
|
||||
*
|
||||
* @param objId 生产BOM主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseBomInfoByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 批量删除生产BOM
|
||||
*
|
||||
* @param objIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseBomInfoByObjIds(Long[] objIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.aucma.production.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.aucma.production.domain.BaseBomInfo;
|
||||
|
||||
/**
|
||||
* 生产BOMService接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-09-28
|
||||
*/
|
||||
public interface IBaseBomInfoService
|
||||
{
|
||||
/**
|
||||
* 查询生产BOM
|
||||
*
|
||||
* @param objId 生产BOM主键
|
||||
* @return 生产BOM
|
||||
*/
|
||||
public BaseBomInfo selectBaseBomInfoByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询生产BOM列表
|
||||
*
|
||||
* @param baseBomInfo 生产BOM
|
||||
* @return 生产BOM集合
|
||||
*/
|
||||
public List<BaseBomInfo> selectBaseBomInfoList(BaseBomInfo baseBomInfo);
|
||||
|
||||
/**
|
||||
* 新增生产BOM
|
||||
*
|
||||
* @param baseBomInfo 生产BOM
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseBomInfo(BaseBomInfo baseBomInfo);
|
||||
|
||||
/**
|
||||
* 修改生产BOM
|
||||
*
|
||||
* @param baseBomInfo 生产BOM
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseBomInfo(BaseBomInfo baseBomInfo);
|
||||
|
||||
/**
|
||||
* 批量删除生产BOM
|
||||
*
|
||||
* @param objIds 需要删除的生产BOM主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseBomInfoByObjIds(Long[] objIds);
|
||||
|
||||
/**
|
||||
* 删除生产BOM信息
|
||||
*
|
||||
* @param objId 生产BOM主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseBomInfoByObjId(Long objId);
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package com.aucma.production.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.aucma.production.mapper.BaseBomInfoMapper;
|
||||
import com.aucma.production.domain.BaseBomInfo;
|
||||
import com.aucma.production.service.IBaseBomInfoService;
|
||||
|
||||
/**
|
||||
* 生产BOMService业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-09-28
|
||||
*/
|
||||
@Service
|
||||
public class BaseBomInfoServiceImpl implements IBaseBomInfoService
|
||||
{
|
||||
@Autowired
|
||||
private BaseBomInfoMapper baseBomInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询生产BOM
|
||||
*
|
||||
* @param objId 生产BOM主键
|
||||
* @return 生产BOM
|
||||
*/
|
||||
@Override
|
||||
public BaseBomInfo selectBaseBomInfoByObjId(Long objId)
|
||||
{
|
||||
return baseBomInfoMapper.selectBaseBomInfoByObjId(objId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生产BOM列表
|
||||
*
|
||||
* @param baseBomInfo 生产BOM
|
||||
* @return 生产BOM
|
||||
*/
|
||||
@Override
|
||||
public List<BaseBomInfo> selectBaseBomInfoList(BaseBomInfo baseBomInfo)
|
||||
{
|
||||
return baseBomInfoMapper.selectBaseBomInfoList(baseBomInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产BOM
|
||||
*
|
||||
* @param baseBomInfo 生产BOM
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBaseBomInfo(BaseBomInfo baseBomInfo)
|
||||
{
|
||||
return baseBomInfoMapper.insertBaseBomInfo(baseBomInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产BOM
|
||||
*
|
||||
* @param baseBomInfo 生产BOM
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBaseBomInfo(BaseBomInfo baseBomInfo)
|
||||
{
|
||||
return baseBomInfoMapper.updateBaseBomInfo(baseBomInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除生产BOM
|
||||
*
|
||||
* @param objIds 需要删除的生产BOM主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseBomInfoByObjIds(Long[] objIds)
|
||||
{
|
||||
return baseBomInfoMapper.deleteBaseBomInfoByObjIds(objIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产BOM信息
|
||||
*
|
||||
* @param objId 生产BOM主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseBomInfoByObjId(Long objId)
|
||||
{
|
||||
return baseBomInfoMapper.deleteBaseBomInfoByObjId(objId);
|
||||
}
|
||||
}
|
@ -0,0 +1,126 @@
|
||||
<?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.aucma.production.mapper.BaseBomInfoMapper">
|
||||
|
||||
<resultMap type="BaseBomInfo" id="BaseBomInfoResult">
|
||||
<result property="objId" column="obj_id" />
|
||||
<result property="bomCode" column="bom_code" />
|
||||
<result property="materialCode" column="material_code" />
|
||||
<result property="materialName" column="material_name" />
|
||||
<result property="materialType" column="material_type" />
|
||||
<result property="standardAmount" column="standard_amount" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="plantCode" column="plant_code" />
|
||||
<result property="productLineCode" column="product_line_code" />
|
||||
<result property="isFlag" column="is_flag" />
|
||||
<result property="createdBy" column="created_by" />
|
||||
<result property="createdTime" column="created_time" />
|
||||
<result property="updatedBy" column="updated_by" />
|
||||
<result property="updatedTime" column="updated_time" />
|
||||
<result property="orderCode" column="order_code" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBaseBomInfoVo">
|
||||
select obj_id, bom_code, material_code, material_name, material_type, standard_amount, parent_id, plant_code, product_line_code, is_flag, created_by, created_time, updated_by, updated_time, order_code from base_bominfo
|
||||
</sql>
|
||||
|
||||
<select id="selectBaseBomInfoList" parameterType="BaseBomInfo" resultMap="BaseBomInfoResult">
|
||||
<include refid="selectBaseBomInfoVo"/>
|
||||
<where>
|
||||
<if test="bomCode != null and bomCode != ''"> and bom_code = #{bomCode}</if>
|
||||
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
|
||||
<if test="materialName != null and materialName != ''"> and material_name like concat(concat('%', #{materialName}), '%')</if>
|
||||
<if test="materialType != null and materialType != ''"> and material_type = #{materialType}</if>
|
||||
<if test="standardAmount != null "> and standard_amount = #{standardAmount}</if>
|
||||
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId}</if>
|
||||
<if test="plantCode != null and plantCode != ''"> and plant_code = #{plantCode}</if>
|
||||
<if test="productLineCode != null and productLineCode != ''"> and product_line_code = #{productLineCode}</if>
|
||||
<if test="isFlag != null "> and is_flag = #{isFlag}</if>
|
||||
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy}</if>
|
||||
<if test="createdTime != null "> and created_time = #{createdTime}</if>
|
||||
<if test="updatedBy != null and updatedBy != ''"> and updated_by = #{updatedBy}</if>
|
||||
<if test="updatedTime != null "> and updated_time = #{updatedTime}</if>
|
||||
<if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBaseBomInfoByObjId" parameterType="Long" resultMap="BaseBomInfoResult">
|
||||
<include refid="selectBaseBomInfoVo"/>
|
||||
where obj_id = #{objId}
|
||||
</select>
|
||||
|
||||
<insert id="insertBaseBomInfo" parameterType="BaseBomInfo">
|
||||
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
|
||||
SELECT seq_base_bominfo.NEXTVAL as objId FROM DUAL
|
||||
</selectKey>
|
||||
insert into base_bominfo
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="objId != null">obj_id,</if>
|
||||
<if test="bomCode != null">bom_code,</if>
|
||||
<if test="materialCode != null">material_code,</if>
|
||||
<if test="materialName != null">material_name,</if>
|
||||
<if test="materialType != null">material_type,</if>
|
||||
<if test="standardAmount != null">standard_amount,</if>
|
||||
<if test="parentId != null">parent_id,</if>
|
||||
<if test="plantCode != null">plant_code,</if>
|
||||
<if test="productLineCode != null">product_line_code,</if>
|
||||
<if test="isFlag != null">is_flag,</if>
|
||||
<if test="createdBy != null">created_by,</if>
|
||||
<if test="createdTime != null">created_time,</if>
|
||||
<if test="updatedBy != null">updated_by,</if>
|
||||
<if test="updatedTime != null">updated_time,</if>
|
||||
<if test="orderCode != null">order_code,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="objId != null">#{objId},</if>
|
||||
<if test="bomCode != null">#{bomCode},</if>
|
||||
<if test="materialCode != null">#{materialCode},</if>
|
||||
<if test="materialName != null">#{materialName},</if>
|
||||
<if test="materialType != null">#{materialType},</if>
|
||||
<if test="standardAmount != null">#{standardAmount},</if>
|
||||
<if test="parentId != null">#{parentId},</if>
|
||||
<if test="plantCode != null">#{plantCode},</if>
|
||||
<if test="productLineCode != null">#{productLineCode},</if>
|
||||
<if test="isFlag != null">#{isFlag},</if>
|
||||
<if test="createdBy != null">#{createdBy},</if>
|
||||
<if test="createdTime != null">#{createdTime},</if>
|
||||
<if test="updatedBy != null">#{updatedBy},</if>
|
||||
<if test="updatedTime != null">#{updatedTime},</if>
|
||||
<if test="orderCode != null">#{orderCode},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBaseBomInfo" parameterType="BaseBomInfo">
|
||||
update base_bominfo
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="bomCode != null">bom_code = #{bomCode},</if>
|
||||
<if test="materialCode != null">material_code = #{materialCode},</if>
|
||||
<if test="materialName != null">material_name = #{materialName},</if>
|
||||
<if test="materialType != null">material_type = #{materialType},</if>
|
||||
<if test="standardAmount != null">standard_amount = #{standardAmount},</if>
|
||||
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||
<if test="plantCode != null">plant_code = #{plantCode},</if>
|
||||
<if test="productLineCode != null">product_line_code = #{productLineCode},</if>
|
||||
<if test="isFlag != null">is_flag = #{isFlag},</if>
|
||||
<if test="createdBy != null">created_by = #{createdBy},</if>
|
||||
<if test="createdTime != null">created_time = #{createdTime},</if>
|
||||
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
|
||||
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
|
||||
<if test="orderCode != null">order_code = #{orderCode},</if>
|
||||
</trim>
|
||||
where obj_id = #{objId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBaseBomInfoByObjId" parameterType="Long">
|
||||
delete from base_bominfo where obj_id = #{objId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBaseBomInfoByObjIds" parameterType="String">
|
||||
delete from base_bominfo where obj_id in
|
||||
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
||||
#{objId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue