add - 生产计划

master
yinq 1 year ago
parent e9cad25945
commit 980f771f2d

@ -44,6 +44,17 @@ public class OrderBomInfoController extends BaseController {
return success(list); return success(list);
} }
/**
* BOM
* @param orderBomInfo
* @return
*/
@GetMapping("/findOrderBomList")
public AjaxResult findOrderBomList(OrderBomInfo orderBomInfo) {
List<OrderBomInfo> list = orderBomInfoService.selectOrderBomInfoList(orderBomInfo);
return success(list);
}
/** /**
* BOM * BOM
*/ */

@ -0,0 +1,101 @@
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.ProductPlanInfo;
import com.aucma.production.service.IProductPlanInfoService;
import com.aucma.common.utils.poi.ExcelUtil;
import com.aucma.common.core.page.TableDataInfo;
/**
* Controller
*
* @author Yinq
* @date 2023-10-07
*/
@RestController
@RequestMapping("/production/planInfo" )
public class ProductPlanInfoController extends BaseController {
@Autowired
private IProductPlanInfoService productPlanInfoService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:planInfo:list')" )
@GetMapping("/list" )
public TableDataInfo list(ProductPlanInfo productPlanInfo) {
startPage();
List<ProductPlanInfo> list = productPlanInfoService.selectProductPlanInfoList(productPlanInfo);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:planInfo:export')" )
@Log(title = "生产计划" , businessType = BusinessType.EXPORT)
@PostMapping("/export" )
public void export(HttpServletResponse response, ProductPlanInfo productPlanInfo) {
List<ProductPlanInfo> list = productPlanInfoService.selectProductPlanInfoList(productPlanInfo);
ExcelUtil<ProductPlanInfo> util = new ExcelUtil<ProductPlanInfo>(ProductPlanInfo. class);
util.exportExcel(response, list, "生产计划数据" );
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:planInfo:query')" )
@GetMapping(value = "/{objId}" )
public AjaxResult getInfo(@PathVariable("objId" ) Long objId) {
return success(productPlanInfoService.selectProductPlanInfoByObjId(objId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:planInfo:add')" )
@Log(title = "生产计划" , businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ProductPlanInfo productPlanInfo) {
productPlanInfo.setCreatedBy(getUsername());
return toAjax(productPlanInfoService.insertProductPlanInfo(productPlanInfo));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:planInfo:edit')" )
@Log(title = "生产计划" , businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ProductPlanInfo productPlanInfo) {
productPlanInfo.setUpdatedBy(getUsername());
return toAjax(productPlanInfoService.updateProductPlanInfo(productPlanInfo));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:planInfo:remove')" )
@Log(title = "生产计划" , businessType = BusinessType.DELETE)
@DeleteMapping("/{objIds}" )
public AjaxResult remove(@PathVariable Long[] objIds) {
return toAjax(productPlanInfoService.deleteProductPlanInfoByObjIds(objIds));
}
}

@ -0,0 +1,283 @@
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;
/**
* product_planinfo
*
* @author Yinq
* @date 2023-10-07
*/
public class ProductPlanInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private Long objId;
/**
*
*/
@Excel(name = "计划编号")
private String planCode;
/**
*
*/
@Excel(name = "工单编号")
private String orderCode;
/**
*
*/
@Excel(name = "销售订单编号")
private String saleOrderCode;
/**
*
*/
@Excel(name = "销售订单行号")
private String saleorderLinenumber;
/**
*
*/
@Excel(name = "物料编号")
private String materialCode;
/**
*
*/
@Excel(name = "物料名称")
private String materialName;
/**
*
*/
@Excel(name = "计划工位")
private String productLineCode;
/**
*
*/
@Excel(name = "计划数量")
private Long planAmount;
/**
*
*/
@Excel(name = "完成数量")
private Long completeAmount;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date beginTime;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
/**
*
*/
@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;
public void setObjId(Long objId) {
this.objId = objId;
}
public Long getObjId() {
return objId;
}
public void setPlanCode(String planCode) {
this.planCode = planCode;
}
public String getPlanCode() {
return planCode;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getOrderCode() {
return orderCode;
}
public void setSaleOrderCode(String saleOrderCode) {
this.saleOrderCode = saleOrderCode;
}
public String getSaleOrderCode() {
return saleOrderCode;
}
public void setSaleorderLinenumber(String saleorderLinenumber) {
this.saleorderLinenumber = saleorderLinenumber;
}
public String getSaleorderLinenumber() {
return saleorderLinenumber;
}
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 setProductLineCode(String productLineCode) {
this.productLineCode = productLineCode;
}
public String getProductLineCode() {
return productLineCode;
}
public void setPlanAmount(Long planAmount) {
this.planAmount = planAmount;
}
public Long getPlanAmount() {
return planAmount;
}
public void setCompleteAmount(Long completeAmount) {
this.completeAmount = completeAmount;
}
public Long getCompleteAmount() {
return completeAmount;
}
public void setBeginTime(Date beginTime) {
this.beginTime = beginTime;
}
public Date getBeginTime() {
return beginTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public Date getEndTime() {
return endTime;
}
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;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("objId", getObjId())
.append("planCode", getPlanCode())
.append("orderCode", getOrderCode())
.append("saleOrderCode", getSaleOrderCode())
.append("saleorderLinenumber", getSaleorderLinenumber())
.append("materialCode", getMaterialCode())
.append("materialName", getMaterialName())
.append("productLineCode", getProductLineCode())
.append("planAmount", getPlanAmount())
.append("completeAmount", getCompleteAmount())
.append("beginTime", getBeginTime())
.append("endTime", getEndTime())
.append("isFlag", getIsFlag())
.append("createdBy", getCreatedBy())
.append("createdTime", getCreatedTime())
.append("updatedBy", getUpdatedBy())
.append("updatedTime", getUpdatedTime())
.toString();
}
}

@ -0,0 +1,61 @@
package com.aucma.production.mapper;
import java.util.List;
import com.aucma.production.domain.ProductPlanInfo;
/**
* Mapper
*
* @author Yinq
* @date 2023-10-07
*/
public interface ProductPlanInfoMapper
{
/**
*
*
* @param objId
* @return
*/
public ProductPlanInfo selectProductPlanInfoByObjId(Long objId);
/**
*
*
* @param productPlanInfo
* @return
*/
public List<ProductPlanInfo> selectProductPlanInfoList(ProductPlanInfo productPlanInfo);
/**
*
*
* @param productPlanInfo
* @return
*/
public int insertProductPlanInfo(ProductPlanInfo productPlanInfo);
/**
*
*
* @param productPlanInfo
* @return
*/
public int updateProductPlanInfo(ProductPlanInfo productPlanInfo);
/**
*
*
* @param objId
* @return
*/
public int deleteProductPlanInfoByObjId(Long objId);
/**
*
*
* @param objIds
* @return
*/
public int deleteProductPlanInfoByObjIds(Long[] objIds);
}

@ -0,0 +1,63 @@
package com.aucma.production.service;
import java.util.List;
import com.aucma.production.domain.ProductPlanInfo;
/**
* Service
*
* @author Yinq
* @date 2023-10-07
*/
public interface IProductPlanInfoService
{
/**
*
*
* @param objId
* @return
*/
public ProductPlanInfo selectProductPlanInfoByObjId(Long objId);
/**
*
*
* @param productPlanInfo
* @return
*/
public List<ProductPlanInfo> selectProductPlanInfoList(ProductPlanInfo productPlanInfo);
/**
*
*
* @param productPlanInfo
* @return
*/
public int insertProductPlanInfo(ProductPlanInfo productPlanInfo);
/**
*
*
* @param productPlanInfo
* @return
*/
public int updateProductPlanInfo(ProductPlanInfo productPlanInfo);
/**
*
*
* @param objIds
* @return
*/
public int deleteProductPlanInfoByObjIds(Long[] objIds);
/**
*
*
* @param objId
* @return
*/
public int deleteProductPlanInfoByObjId(Long objId);
}

@ -0,0 +1,100 @@
package com.aucma.production.service.impl;
import java.util.List;
import com.aucma.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.aucma.production.mapper.ProductPlanInfoMapper;
import com.aucma.production.domain.ProductPlanInfo;
import com.aucma.production.service.IProductPlanInfoService;
/**
* Service
*
* @author Yinq
* @date 2023-10-07
*/
@Service
public class ProductPlanInfoServiceImpl implements IProductPlanInfoService
{
@Autowired
private ProductPlanInfoMapper productPlanInfoMapper;
/**
*
*
* @param objId
* @return
*/
@Override
public ProductPlanInfo selectProductPlanInfoByObjId(Long objId)
{
return productPlanInfoMapper.selectProductPlanInfoByObjId(objId);
}
/**
*
*
* @param productPlanInfo
* @return
*/
@Override
public List<ProductPlanInfo> selectProductPlanInfoList(ProductPlanInfo productPlanInfo)
{
return productPlanInfoMapper.selectProductPlanInfoList(productPlanInfo);
}
/**
*
*
* @param productPlanInfo
* @return
*/
@Override
public int insertProductPlanInfo(ProductPlanInfo productPlanInfo)
{
productPlanInfo.setCreatedTime(DateUtils.getNowDate());
return productPlanInfoMapper.insertProductPlanInfo(productPlanInfo);
}
/**
*
*
* @param productPlanInfo
* @return
*/
@Override
public int updateProductPlanInfo(ProductPlanInfo productPlanInfo)
{
productPlanInfo.setUpdatedTime(DateUtils.getNowDate());
return productPlanInfoMapper.updateProductPlanInfo(productPlanInfo);
}
/**
*
*
* @param objIds
* @return
*/
@Override
public int deleteProductPlanInfoByObjIds(Long[] objIds)
{
return productPlanInfoMapper.deleteProductPlanInfoByObjIds(objIds);
}
/**
*
*
* @param objId
* @return
*/
@Override
public int deleteProductPlanInfoByObjId(Long objId)
{
return productPlanInfoMapper.deleteProductPlanInfoByObjId(objId);
}
}

@ -0,0 +1,166 @@
<?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.ProductPlanInfoMapper">
<resultMap type="ProductPlanInfo" id="ProductPlanInfoResult">
<result property="objId" column="obj_id"/>
<result property="planCode" column="plan_code"/>
<result property="orderCode" column="order_code"/>
<result property="saleOrderCode" column="saleorder_code"/>
<result property="saleorderLinenumber" column="saleorder_linenumber"/>
<result property="materialCode" column="material_code"/>
<result property="materialName" column="material_name"/>
<result property="productLineCode" column="productline_code"/>
<result property="planAmount" column="plan_amount"/>
<result property="completeAmount" column="complete_amount"/>
<result property="beginTime" column="begin_time"/>
<result property="endTime" column="end_time"/>
<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"/>
</resultMap>
<sql id="selectProductPlanInfoVo">
select obj_id,
plan_code,
order_code,
saleorder_code,
saleorder_linenumber,
material_code,
material_name,
productline_code,
plan_amount,
complete_amount,
begin_time,
end_time,
is_flag,
created_by,
created_time,
updated_by,
updated_time
from product_planinfo
</sql>
<select id="selectProductPlanInfoList" parameterType="ProductPlanInfo" resultMap="ProductPlanInfoResult">
<include refid="selectProductPlanInfoVo"/>
<where>
<if test="planCode != null and planCode != ''">and plan_code like concat(concat('%', #{planCode}), '%')
</if>
<if test="orderCode != null and orderCode != ''">and order_code = #{orderCode}</if>
<if test="saleOrderCode != null and saleOrderCode != ''">and saleorder_code = #{saleOrderCode}</if>
<if test="saleorderLinenumber != null and saleorderLinenumber != ''">and saleorder_linenumber =
#{saleorderLinenumber}
</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="productLineCode != null and productLineCode != ''">and productline_code = #{productLineCode}</if>
<if test="planAmount != null ">and plan_amount = #{planAmount}</if>
<if test="completeAmount != null ">and complete_amount = #{completeAmount}</if>
<if test="params.beginBeginTime != null and params.beginBeginTime != '' and params.endBeginTime != null and params.endBeginTime != ''">
and begin_time between to_date(#{params.beginBeginTime}, 'yyyy-mm-dd hh24:mi:ss') and
to_date(#{params.endBeginTime}, 'yyyy-mm-dd hh24:mi:ss')
</if>
<if test="params.beginEndTime != null and params.beginEndTime != '' and params.endEndTime != null and params.endEndTime != ''">
and end_time between to_date(#{params.beginEndTime}, 'yyyy-mm-dd hh24:mi:ss') and
to_date(#{params.endEndTime}, 'yyyy-mm-dd hh24:mi:ss')
</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>
</where>
</select>
<select id="selectProductPlanInfoByObjId" parameterType="Long" resultMap="ProductPlanInfoResult">
<include refid="selectProductPlanInfoVo"/>
where obj_id = #{objId}
</select>
<insert id="insertProductPlanInfo" parameterType="ProductPlanInfo">
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
SELECT seq_product_planinfo.NEXTVAL as objId FROM DUAL
</selectKey>
insert into product_planinfo
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="objId != null">obj_id,</if>
<if test="planCode != null">plan_code,</if>
<if test="orderCode != null">order_code,</if>
<if test="saleOrderCode != null">saleorder_code,</if>
<if test="saleorderLinenumber != null">saleorder_linenumber,</if>
<if test="materialCode != null">material_code,</if>
<if test="materialName != null">material_name,</if>
<if test="productLineCode != null">productline_code,</if>
<if test="planAmount != null">plan_amount,</if>
<if test="completeAmount != null">complete_amount,</if>
<if test="beginTime != null">begin_time,</if>
<if test="endTime != null">end_time,</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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="objId != null">#{objId},</if>
<if test="planCode != null">#{planCode},</if>
<if test="orderCode != null">#{orderCode},</if>
<if test="saleOrderCode != null">#{saleOrderCode},</if>
<if test="saleorderLinenumber != null">#{saleorderLinenumber},</if>
<if test="materialCode != null">#{materialCode},</if>
<if test="materialName != null">#{materialName},</if>
<if test="productLineCode != null">#{productLineCode},</if>
<if test="planAmount != null">#{planAmount},</if>
<if test="completeAmount != null">#{completeAmount},</if>
<if test="beginTime != null">#{beginTime},</if>
<if test="endTime != null">#{endTime},</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>
</trim>
</insert>
<update id="updateProductPlanInfo" parameterType="ProductPlanInfo">
update product_planinfo
<trim prefix="SET" suffixOverrides=",">
<if test="planCode != null">plan_code = #{planCode},</if>
<if test="orderCode != null">order_code = #{orderCode},</if>
<if test="saleOrderCode != null">saleorder_code = #{saleOrderCode},</if>
<if test="saleorderLinenumber != null">saleorder_linenumber = #{saleorderLinenumber},</if>
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="productLineCode != null">productline_code = #{productLineCode},</if>
<if test="planAmount != null">plan_amount = #{planAmount},</if>
<if test="completeAmount != null">complete_amount = #{completeAmount},</if>
<if test="beginTime != null">begin_time = #{beginTime},</if>
<if test="endTime != null">end_time = #{endTime},</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>
</trim>
where obj_id = #{objId}
</update>
<delete id="deleteProductPlanInfoByObjId" parameterType="Long">
delete
from product_planinfo
where obj_id = #{objId}
</delete>
<delete id="deleteProductPlanInfoByObjIds" parameterType="String">
delete from product_planinfo where obj_id in
<foreach item="objId" collection="array" open="(" separator="," close=")">
#{objId}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save