diff --git a/aucma-base/src/main/java/com/aucma/base/controller/OrderBomInfoController.java b/aucma-base/src/main/java/com/aucma/base/controller/OrderBomInfoController.java index 5fa7235..b1ed300 100644 --- a/aucma-base/src/main/java/com/aucma/base/controller/OrderBomInfoController.java +++ b/aucma-base/src/main/java/com/aucma/base/controller/OrderBomInfoController.java @@ -44,6 +44,17 @@ public class OrderBomInfoController extends BaseController { return success(list); } + /** + * 查询订单BOM下拉框列表 + * @param orderBomInfo + * @return + */ + @GetMapping("/findOrderBomList") + public AjaxResult findOrderBomList(OrderBomInfo orderBomInfo) { + List list = orderBomInfoService.selectOrderBomInfoList(orderBomInfo); + return success(list); + } + /** * 导出订单BOM列表 */ diff --git a/aucma-production/src/main/java/com/aucma/production/controller/ProductPlanInfoController.java b/aucma-production/src/main/java/com/aucma/production/controller/ProductPlanInfoController.java new file mode 100644 index 0000000..61bd30e --- /dev/null +++ b/aucma-production/src/main/java/com/aucma/production/controller/ProductPlanInfoController.java @@ -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 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 list = productPlanInfoService.selectProductPlanInfoList(productPlanInfo); + ExcelUtil util = new ExcelUtil(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)); + } +} diff --git a/aucma-production/src/main/java/com/aucma/production/domain/ProductPlanInfo.java b/aucma-production/src/main/java/com/aucma/production/domain/ProductPlanInfo.java new file mode 100644 index 0000000..5942d83 --- /dev/null +++ b/aucma-production/src/main/java/com/aucma/production/domain/ProductPlanInfo.java @@ -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(); + } +} diff --git a/aucma-production/src/main/java/com/aucma/production/mapper/ProductPlanInfoMapper.java b/aucma-production/src/main/java/com/aucma/production/mapper/ProductPlanInfoMapper.java new file mode 100644 index 0000000..c185c65 --- /dev/null +++ b/aucma-production/src/main/java/com/aucma/production/mapper/ProductPlanInfoMapper.java @@ -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 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); +} diff --git a/aucma-production/src/main/java/com/aucma/production/service/IProductPlanInfoService.java b/aucma-production/src/main/java/com/aucma/production/service/IProductPlanInfoService.java new file mode 100644 index 0000000..f279b27 --- /dev/null +++ b/aucma-production/src/main/java/com/aucma/production/service/IProductPlanInfoService.java @@ -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 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); + + +} diff --git a/aucma-production/src/main/java/com/aucma/production/service/impl/ProductPlanInfoServiceImpl.java b/aucma-production/src/main/java/com/aucma/production/service/impl/ProductPlanInfoServiceImpl.java new file mode 100644 index 0000000..adc954f --- /dev/null +++ b/aucma-production/src/main/java/com/aucma/production/service/impl/ProductPlanInfoServiceImpl.java @@ -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 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); + } + + + +} diff --git a/aucma-production/src/main/resources/mapper/production/ProductPlanInfoMapper.xml b/aucma-production/src/main/resources/mapper/production/ProductPlanInfoMapper.xml new file mode 100644 index 0000000..da15d3a --- /dev/null +++ b/aucma-production/src/main/resources/mapper/production/ProductPlanInfoMapper.xml @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + SELECT seq_product_planinfo.NEXTVAL as objId FROM DUAL + + insert into product_planinfo + + 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, + + + #{objId}, + #{planCode}, + #{orderCode}, + #{saleOrderCode}, + #{saleorderLinenumber}, + #{materialCode}, + #{materialName}, + #{productLineCode}, + #{planAmount}, + #{completeAmount}, + #{beginTime}, + #{endTime}, + #{isFlag}, + #{createdBy}, + #{createdTime}, + #{updatedBy}, + #{updatedTime}, + + + + + update product_planinfo + + plan_code = #{planCode}, + order_code = #{orderCode}, + saleorder_code = #{saleOrderCode}, + saleorder_linenumber = #{saleorderLinenumber}, + material_code = #{materialCode}, + material_name = #{materialName}, + productline_code = #{productLineCode}, + plan_amount = #{planAmount}, + complete_amount = #{completeAmount}, + begin_time = #{beginTime}, + end_time = #{endTime}, + is_flag = #{isFlag}, + created_by = #{createdBy}, + created_time = #{createdTime}, + updated_by = #{updatedBy}, + updated_time = #{updatedTime}, + + where obj_id = #{objId} + + + + delete + from product_planinfo + where obj_id = #{objId} + + + + delete from product_planinfo where obj_id in + + #{objId} + + + \ No newline at end of file