add - 订单BOM、生产BOM

master
yinq 12 months ago
parent 6e4c6a06ca
commit 170354eee0

@ -85,6 +85,12 @@
<artifactId>aucma-api</artifactId>
</dependency>
<!-- 生产模块-->
<dependency>
<groupId>com.aucma</groupId>
<artifactId>aucma-production</artifactId>
</dependency>
</dependencies>
<build>

@ -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>

@ -184,6 +184,13 @@
<version>${aucma.version}</version>
</dependency>
<!-- API接口-->
<dependency>
<groupId>com.aucma</groupId>
<artifactId>aucma-production</artifactId>
<version>${aucma.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
@ -196,6 +203,7 @@
<module>aucma-common</module>
<module>aucma-base</module>
<module>aucma-api</module>
<module>aucma-production</module>
</modules>
<packaging>pom</packaging>

Loading…
Cancel
Save