diff --git a/os-mes/src/main/java/com/os/mes/prod/controller/ProdOrderInfoController.java b/os-mes/src/main/java/com/os/mes/prod/controller/ProdOrderInfoController.java new file mode 100644 index 0000000..01d8f68 --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/prod/controller/ProdOrderInfoController.java @@ -0,0 +1,100 @@ +package com.os.mes.prod.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +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.os.common.annotation.Log; +import com.os.common.core.controller.BaseController; +import com.os.common.core.domain.AjaxResult; +import com.os.common.enums.BusinessType; +import com.os.mes.prod.domain.ProdOrderInfo; +import com.os.mes.prod.service.IProdOrderInfoService; +import com.os.common.utils.poi.ExcelUtil; +import com.os.common.core.page.TableDataInfo; + +/** + * 订单信息Controller + * + * @author Yinq + * @date 2024-05-17 + */ +@RestController +@RequestMapping("/mes/prod/prodOrderInfo") +public class ProdOrderInfoController extends BaseController { + @Autowired + private IProdOrderInfoService prodOrderInfoService; + + /** + * 查询订单信息列表 + */ + @PreAuthorize("@ss.hasPermi('mes/prod:prodOrderInfo:list')") + @GetMapping("/list") + public TableDataInfo list(ProdOrderInfo prodOrderInfo) { + startPage(); + List list = prodOrderInfoService.selectProdOrderInfoList(prodOrderInfo); + return getDataTable(list); + } + + /** + * 导出订单信息列表 + */ + @PreAuthorize("@ss.hasPermi('mes/prod:prodOrderInfo:export')") + @Log(title = "订单信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ProdOrderInfo prodOrderInfo) { + List list = prodOrderInfoService.selectProdOrderInfoList(prodOrderInfo); + ExcelUtil util = new ExcelUtil(ProdOrderInfo.class); + util.exportExcel(response, list, "订单信息数据"); + } + + /** + * 获取订单信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('mes/prod:prodOrderInfo:query')") + @GetMapping(value = "/{objId}") + public AjaxResult getInfo(@PathVariable("objId") Long objId) { + return success(prodOrderInfoService.selectProdOrderInfoByObjId(objId)); + } + + /** + * 新增订单信息 + */ + @PreAuthorize("@ss.hasPermi('mes/prod:prodOrderInfo:add')") + @Log(title = "订单信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ProdOrderInfo prodOrderInfo) { + prodOrderInfo.setCreateBy(getUsername()); + return toAjax(prodOrderInfoService.insertProdOrderInfo(prodOrderInfo)); + } + + /** + * 修改订单信息 + */ + @PreAuthorize("@ss.hasPermi('mes/prod:prodOrderInfo:edit')") + @Log(title = "订单信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ProdOrderInfo prodOrderInfo) { + prodOrderInfo.setUpdateBy(getUsername()); + return toAjax(prodOrderInfoService.updateProdOrderInfo(prodOrderInfo)); + } + + /** + * 删除订单信息 + */ + @PreAuthorize("@ss.hasPermi('mes/prod:prodOrderInfo:remove')") + @Log(title = "订单信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{objIds}") + public AjaxResult remove(@PathVariable Long[] objIds) { + return toAjax(prodOrderInfoService.deleteProdOrderInfoByObjIds(objIds)); + } +} diff --git a/os-mes/src/main/java/com/os/mes/prod/domain/ProdOrderInfo.java b/os-mes/src/main/java/com/os/mes/prod/domain/ProdOrderInfo.java new file mode 100644 index 0000000..7956f8e --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/prod/domain/ProdOrderInfo.java @@ -0,0 +1,435 @@ +package com.os.mes.prod.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.os.common.annotation.Excel; +import com.os.common.core.domain.BaseEntity; + +/** + * 订单信息对象 prod_order_info + * + * @author Yinq + * @date 2024-05-17 + */ +public class ProdOrderInfo extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键标识 + */ + private Long objId; + + /** + * 订单编号 + */ + @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 matkl; + + /** + * BOM编号 + */ + @Excel(name = "BOM编号") + private String bomCode; + + /** + * 订单计划数量 + */ + @Excel(name = "订单计划数量") + private Long orderAmount; + + /** + * 完成数量 + */ + @Excel(name = "完成数量") + private Long completeAmount; + + /** + * 工单类型 + */ + @Excel(name = "工单类型") + private String orderType; + + /** + * 工单状态(0未开始 1执行中 2执行完成 3取消) + */ + @Excel(name = "工单状态", readConverterExp = "0=未开始,1=执行中,2=执行完成,3=取消") + private String orderStatus; + + /** + * 完成标识(0=正常,1=降级,2=超额) + */ + @Excel(name = "完成标识", readConverterExp = "0==正常,1=降级,2=超额") + private String finishFlag; + + /** + * 计划开始时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "计划开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date beginDate; + + /** + * 计划结束时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "计划结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date endDate; + + /** + * 实际开始时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "实际开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date realBeginDate; + + /** + * 实际完成时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "实际完成时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date realEndDate; + + /** + * 工厂编号 + */ + @Excel(name = "工厂编号") + private String factoryCode; + + /** + * 是否已下达计划(0-是,1-否) + */ + @Excel(name = "是否已下达计划", readConverterExp = "0=-是,1-否") + private String isRelease; + + /** + * 工作中心 + */ + @Excel(name = "工作中心") + private String workCenterCode; + + /** + * 工艺路线 + */ + @Excel(name = "工艺路线") + private String routingCode; + + /** + * 打印名称 + */ + @Excel(name = "打印名称") + private String printName; + + /** + * 预留标识 + */ + @Excel(name = "预留标识") + private String 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 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 setMatkl(String matkl) { + this.matkl = matkl; + } + + public String getMatkl() { + return matkl; + } + + public void setBomCode(String bomCode) { + this.bomCode = bomCode; + } + + public String getBomCode() { + return bomCode; + } + + public void setOrderAmount(Long orderAmount) { + this.orderAmount = orderAmount; + } + + public Long getOrderAmount() { + return orderAmount; + } + + public void setCompleteAmount(Long completeAmount) { + this.completeAmount = completeAmount; + } + + public Long getCompleteAmount() { + return completeAmount; + } + + public void setOrderType(String orderType) { + this.orderType = orderType; + } + + public String getOrderType() { + return orderType; + } + + public void setOrderStatus(String orderStatus) { + this.orderStatus = orderStatus; + } + + public String getOrderStatus() { + return orderStatus; + } + + public void setFinishFlag(String finishFlag) { + this.finishFlag = finishFlag; + } + + public String getFinishFlag() { + return finishFlag; + } + + public void setBeginDate(Date beginDate) { + this.beginDate = beginDate; + } + + public Date getBeginDate() { + return beginDate; + } + + public void setEndDate(Date endDate) { + this.endDate = endDate; + } + + public Date getEndDate() { + return endDate; + } + + public void setRealBeginDate(Date realBeginDate) { + this.realBeginDate = realBeginDate; + } + + public Date getRealBeginDate() { + return realBeginDate; + } + + public void setRealEndDate(Date realEndDate) { + this.realEndDate = realEndDate; + } + + public Date getRealEndDate() { + return realEndDate; + } + + public void setFactoryCode(String factoryCode) { + this.factoryCode = factoryCode; + } + + public String getFactoryCode() { + return factoryCode; + } + + public void setIsRelease(String isRelease) { + this.isRelease = isRelease; + } + + public String getIsRelease() { + return isRelease; + } + + public void setWorkCenterCode(String workCenterCode) { + this.workCenterCode = workCenterCode; + } + + public String getWorkCenterCode() { + return workCenterCode; + } + + public void setRoutingCode(String routingCode) { + this.routingCode = routingCode; + } + + public String getRoutingCode() { + return routingCode; + } + + public void setPrintName(String printName) { + this.printName = printName; + } + + public String getPrintName() { + return printName; + } + + public void setIsFlag(String isFlag) { + this.isFlag = isFlag; + } + + public String 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("orderCode", getOrderCode()) + .append("saleOrderCode", getSaleOrderCode()) + .append("saleOrderLineNumber", getSaleOrderLineNumber()) + .append("materialCode", getMaterialCode()) + .append("materialName", getMaterialName()) + .append("matkl", getMatkl()) + .append("bomCode", getBomCode()) + .append("orderAmount", getOrderAmount()) + .append("completeAmount", getCompleteAmount()) + .append("orderType", getOrderType()) + .append("orderStatus", getOrderStatus()) + .append("finishFlag", getFinishFlag()) + .append("beginDate", getBeginDate()) + .append("endDate", getEndDate()) + .append("realBeginDate", getRealBeginDate()) + .append("realEndDate", getRealEndDate()) + .append("factoryCode", getFactoryCode()) + .append("isRelease", getIsRelease()) + .append("workCenterCode", getWorkCenterCode()) + .append("routingCode", getRoutingCode()) + .append("printName", getPrintName()) + .append("isFlag", getIsFlag()) + .append("createdBy", getCreatedBy()) + .append("createdTime", getCreatedTime()) + .append("updatedBy", getUpdatedBy()) + .append("updatedTime", getUpdatedTime()) + .toString(); + } +} diff --git a/os-mes/src/main/java/com/os/mes/prod/mapper/ProdOrderInfoMapper.java b/os-mes/src/main/java/com/os/mes/prod/mapper/ProdOrderInfoMapper.java new file mode 100644 index 0000000..34d8e88 --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/prod/mapper/ProdOrderInfoMapper.java @@ -0,0 +1,61 @@ +package com.os.mes.prod.mapper; + +import java.util.List; + +import com.os.mes.prod.domain.ProdOrderInfo; + +/** + * 订单信息Mapper接口 + * + * @author Yinq + * @date 2024-05-17 + */ +public interface ProdOrderInfoMapper { + /** + * 查询订单信息 + * + * @param objId 订单信息主键 + * @return 订单信息 + */ + public ProdOrderInfo selectProdOrderInfoByObjId(Long objId); + + /** + * 查询订单信息列表 + * + * @param prodOrderInfo 订单信息 + * @return 订单信息集合 + */ + public List selectProdOrderInfoList(ProdOrderInfo prodOrderInfo); + + /** + * 新增订单信息 + * + * @param prodOrderInfo 订单信息 + * @return 结果 + */ + public int insertProdOrderInfo(ProdOrderInfo prodOrderInfo); + + /** + * 修改订单信息 + * + * @param prodOrderInfo 订单信息 + * @return 结果 + */ + public int updateProdOrderInfo(ProdOrderInfo prodOrderInfo); + + /** + * 删除订单信息 + * + * @param objId 订单信息主键 + * @return 结果 + */ + public int deleteProdOrderInfoByObjId(Long objId); + + /** + * 批量删除订单信息 + * + * @param objIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteProdOrderInfoByObjIds(Long[] objIds); +} diff --git a/os-mes/src/main/java/com/os/mes/prod/service/IProdOrderInfoService.java b/os-mes/src/main/java/com/os/mes/prod/service/IProdOrderInfoService.java new file mode 100644 index 0000000..d83ab31 --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/prod/service/IProdOrderInfoService.java @@ -0,0 +1,61 @@ +package com.os.mes.prod.service; + +import java.util.List; + +import com.os.mes.prod.domain.ProdOrderInfo; + +/** + * 订单信息Service接口 + * + * @author Yinq + * @date 2024-05-17 + */ +public interface IProdOrderInfoService { + /** + * 查询订单信息 + * + * @param objId 订单信息主键 + * @return 订单信息 + */ + public ProdOrderInfo selectProdOrderInfoByObjId(Long objId); + + /** + * 查询订单信息列表 + * + * @param prodOrderInfo 订单信息 + * @return 订单信息集合 + */ + public List selectProdOrderInfoList(ProdOrderInfo prodOrderInfo); + + /** + * 新增订单信息 + * + * @param prodOrderInfo 订单信息 + * @return 结果 + */ + public int insertProdOrderInfo(ProdOrderInfo prodOrderInfo); + + /** + * 修改订单信息 + * + * @param prodOrderInfo 订单信息 + * @return 结果 + */ + public int updateProdOrderInfo(ProdOrderInfo prodOrderInfo); + + /** + * 批量删除订单信息 + * + * @param objIds 需要删除的订单信息主键集合 + * @return 结果 + */ + public int deleteProdOrderInfoByObjIds(Long[] objIds); + + /** + * 删除订单信息信息 + * + * @param objId 订单信息主键 + * @return 结果 + */ + public int deleteProdOrderInfoByObjId(Long objId); +} diff --git a/os-mes/src/main/java/com/os/mes/prod/service/impl/ProdOrderInfoServiceImpl.java b/os-mes/src/main/java/com/os/mes/prod/service/impl/ProdOrderInfoServiceImpl.java new file mode 100644 index 0000000..c53f1d2 --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/prod/service/impl/ProdOrderInfoServiceImpl.java @@ -0,0 +1,87 @@ +package com.os.mes.prod.service.impl; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.os.mes.prod.mapper.ProdOrderInfoMapper; +import com.os.mes.prod.domain.ProdOrderInfo; +import com.os.mes.prod.service.IProdOrderInfoService; + +/** + * 订单信息Service业务层处理 + * + * @author Yinq + * @date 2024-05-17 + */ +@Service +public class ProdOrderInfoServiceImpl implements IProdOrderInfoService { + @Autowired + private ProdOrderInfoMapper prodOrderInfoMapper; + + /** + * 查询订单信息 + * + * @param objId 订单信息主键 + * @return 订单信息 + */ + @Override + public ProdOrderInfo selectProdOrderInfoByObjId(Long objId) { + return prodOrderInfoMapper.selectProdOrderInfoByObjId(objId); + } + + /** + * 查询订单信息列表 + * + * @param prodOrderInfo 订单信息 + * @return 订单信息 + */ + @Override + public List selectProdOrderInfoList(ProdOrderInfo prodOrderInfo) { + return prodOrderInfoMapper.selectProdOrderInfoList(prodOrderInfo); + } + + /** + * 新增订单信息 + * + * @param prodOrderInfo 订单信息 + * @return 结果 + */ + @Override + public int insertProdOrderInfo(ProdOrderInfo prodOrderInfo) { + return prodOrderInfoMapper.insertProdOrderInfo(prodOrderInfo); + } + + /** + * 修改订单信息 + * + * @param prodOrderInfo 订单信息 + * @return 结果 + */ + @Override + public int updateProdOrderInfo(ProdOrderInfo prodOrderInfo) { + return prodOrderInfoMapper.updateProdOrderInfo(prodOrderInfo); + } + + /** + * 批量删除订单信息 + * + * @param objIds 需要删除的订单信息主键 + * @return 结果 + */ + @Override + public int deleteProdOrderInfoByObjIds(Long[] objIds) { + return prodOrderInfoMapper.deleteProdOrderInfoByObjIds(objIds); + } + + /** + * 删除订单信息信息 + * + * @param objId 订单信息主键 + * @return 结果 + */ + @Override + public int deleteProdOrderInfoByObjId(Long objId) { + return prodOrderInfoMapper.deleteProdOrderInfoByObjId(objId); + } +} diff --git a/os-mes/src/main/resources/mapper/mes/prod/ProdOrderInfoMapper.xml b/os-mes/src/main/resources/mapper/mes/prod/ProdOrderInfoMapper.xml new file mode 100644 index 0000000..c0fc73a --- /dev/null +++ b/os-mes/src/main/resources/mapper/mes/prod/ProdOrderInfoMapper.xml @@ -0,0 +1,216 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select obj_id, + order_code, + sale_order_code, + sale_order_line_number, + material_code, + material_name, + matkl, + bom_code, + order_amount, + complete_amount, + order_type, + order_status, + finish_flag, + begin_date, + end_date, + real_begin_date, + real_end_date, + factory_code, + is_release, + work_center_code, + routing_code, + print_name, + is_flag, + created_by, + created_time, + updated_by, + updated_time + from prod_order_info + + + + + + + + insert into prod_order_info + + order_code, + sale_order_code, + sale_order_line_number, + material_code, + material_name, + matkl, + bom_code, + order_amount, + complete_amount, + order_type, + order_status, + finish_flag, + begin_date, + end_date, + real_begin_date, + real_end_date, + factory_code, + is_release, + work_center_code, + routing_code, + print_name, + is_flag, + created_by, + created_time, + updated_by, + updated_time, + + + #{orderCode}, + #{saleOrderCode}, + #{saleOrderLineNumber}, + #{materialCode}, + #{materialName}, + #{matkl}, + #{bomCode}, + #{orderAmount}, + #{completeAmount}, + #{orderType}, + #{orderStatus}, + #{finishFlag}, + #{beginDate}, + #{endDate}, + #{realBeginDate}, + #{realEndDate}, + #{factoryCode}, + #{isRelease}, + #{workCenterCode}, + #{routingCode}, + #{printName}, + #{isFlag}, + #{createdBy}, + #{createdTime}, + #{updatedBy}, + #{updatedTime}, + + + + + update prod_order_info + + order_code = #{orderCode}, + sale_order_code = #{saleOrderCode}, + sale_order_line_number = #{saleOrderLineNumber}, + material_code = #{materialCode}, + material_name = #{materialName}, + matkl = #{matkl}, + bom_code = #{bomCode}, + order_amount = #{orderAmount}, + complete_amount = #{completeAmount}, + order_type = #{orderType}, + order_status = #{orderStatus}, + finish_flag = #{finishFlag}, + begin_date = #{beginDate}, + end_date = #{endDate}, + real_begin_date = #{realBeginDate}, + real_end_date = #{realEndDate}, + factory_code = #{factoryCode}, + is_release = #{isRelease}, + work_center_code = #{workCenterCode}, + routing_code = #{routingCode}, + print_name = #{printName}, + is_flag = #{isFlag}, + created_by = #{createdBy}, + created_time = #{createdTime}, + updated_by = #{updatedBy}, + updated_time = #{updatedTime}, + + where obj_id = #{objId} + + + + delete + from prod_order_info + where obj_id = #{objId} + + + + delete from prod_order_info where obj_id in + + #{objId} + + + \ No newline at end of file