diff --git a/src/main/java/com/heai/modules/production/dao/DailyPlanMapper.java b/src/main/java/com/heai/modules/production/dao/DailyPlanMapper.java index 5e1687b..3d08b50 100644 --- a/src/main/java/com/heai/modules/production/dao/DailyPlanMapper.java +++ b/src/main/java/com/heai/modules/production/dao/DailyPlanMapper.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.heai.modules.app.entity.ProductionWarehouseData; import com.heai.modules.app.entity.SoBomData; import com.heai.modules.production.entity.*; +import io.swagger.models.auth.In; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; @@ -291,6 +292,8 @@ public interface DailyPlanMapper { * @throw */ int getDataSequence(); + + List checkRoutingMachRunFactor(@Param("site")String site, @Param("orderNo")String orderNo, @Param("itemNo")Float itemNo); /** * @Description 更新派工单 diff --git a/src/main/java/com/heai/modules/production/entity/SORoutingEntity.java b/src/main/java/com/heai/modules/production/entity/SORoutingEntity.java new file mode 100644 index 0000000..79387c8 --- /dev/null +++ b/src/main/java/com/heai/modules/production/entity/SORoutingEntity.java @@ -0,0 +1,475 @@ +package com.heai.modules.production.entity; + +import java.math.BigDecimal; +import java.util.Date; + +public class SORoutingEntity { + /** + * + */ + private String site; + + /** + * + */ + private String orderNo; + + /** + * + */ + private Double itemNo; + + /** + * + */ + private String operationDesc; + + /** + * + */ + private String workCenterNo; + + /** + * + */ + private Double machSetupTime; + + /** + * + */ + private Double machRunFactor; + + /** + * + */ + private String factorUnitDb; + + /** + * + */ + private String factorUnit; + + /** + * + */ + private Double qtyRequired; + + /** + * + */ + private Double qtyReported; + + /** + * + */ + private Double qtyApprove; + + /** + * + */ + private Double timeRequired; + + /** + * + */ + private Double timeReported; + + /** + * + */ + private Double efficiency; + + /** + * + */ + private Date planStartTime; + + /** + * + */ + private Date planFinishTime; + + /** + * + */ + private String barcodeID; + + /** + * + */ + private String remark; + + /** + * + */ + private String partNo; + + /** + * + */ + private Double crewsize; + + /** + * + */ + private String closedFlag; + + /** + * + */ + private String actionNotes; + + /** + * + */ + private String outWorkFlag; + + /** + * + */ + private String outWorkPartNo; + + /** + * + */ + private Double qtyOnPR; + + /** + * + */ + private Double qtyOnPO; + + /** + * + */ + private Double qtyScrapt; + + /** + * + */ + private String pfPartNo; + + /** + * + */ + private String pfRevNo; + + /** + * + */ + private String toolID; + + /** + * + */ + private String jjgzUnitFactorDb; + + /** + * + */ + private String jjgzUnitFactor; + + /** + * + */ + private Double jjgzUnitPrice; + + /** + * + */ + private BigDecimal lastApproveQty; + + /** + * + */ + private Double defectiveQty; + + public String getSite() { + return site; + } + + public void setSite(String site) { + this.site = site; + } + + public String getOrderNo() { + return orderNo; + } + + public void setOrderNo(String orderNo) { + this.orderNo = orderNo; + } + + public Double getItemNo() { + return itemNo; + } + + public void setItemNo(Double itemNo) { + this.itemNo = itemNo; + } + + public String getOperationDesc() { + return operationDesc; + } + + public void setOperationDesc(String operationDesc) { + this.operationDesc = operationDesc; + } + + public String getWorkCenterNo() { + return workCenterNo; + } + + public void setWorkCenterNo(String workCenterNo) { + this.workCenterNo = workCenterNo; + } + + public Double getMachSetupTime() { + return machSetupTime; + } + + public void setMachSetupTime(Double machSetupTime) { + this.machSetupTime = machSetupTime; + } + + public Double getMachRunFactor() { + return machRunFactor; + } + + public void setMachRunFactor(Double machRunFactor) { + this.machRunFactor = machRunFactor; + } + + public String getFactorUnitDb() { + return factorUnitDb; + } + + public void setFactorUnitDb(String factorUnitDb) { + this.factorUnitDb = factorUnitDb; + } + + public String getFactorUnit() { + return factorUnit; + } + + public void setFactorUnit(String factorUnit) { + this.factorUnit = factorUnit; + } + + public Double getQtyRequired() { + return qtyRequired; + } + + public void setQtyRequired(Double qtyRequired) { + this.qtyRequired = qtyRequired; + } + + public Double getQtyReported() { + return qtyReported; + } + + public void setQtyReported(Double qtyReported) { + this.qtyReported = qtyReported; + } + + public Double getQtyApprove() { + return qtyApprove; + } + + public void setQtyApprove(Double qtyApprove) { + this.qtyApprove = qtyApprove; + } + + public Double getTimeRequired() { + return timeRequired; + } + + public void setTimeRequired(Double timeRequired) { + this.timeRequired = timeRequired; + } + + public Double getTimeReported() { + return timeReported; + } + + public void setTimeReported(Double timeReported) { + this.timeReported = timeReported; + } + + public Double getEfficiency() { + return efficiency; + } + + public void setEfficiency(Double efficiency) { + this.efficiency = efficiency; + } + + public Date getPlanStartTime() { + return planStartTime; + } + + public void setPlanStartTime(Date planStartTime) { + this.planStartTime = planStartTime; + } + + public Date getPlanFinishTime() { + return planFinishTime; + } + + public void setPlanFinishTime(Date planFinishTime) { + this.planFinishTime = planFinishTime; + } + + public String getBarcodeID() { + return barcodeID; + } + + public void setBarcodeID(String barcodeID) { + this.barcodeID = barcodeID; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getPartNo() { + return partNo; + } + + public void setPartNo(String partNo) { + this.partNo = partNo; + } + + public Double getCrewsize() { + return crewsize; + } + + public void setCrewsize(Double crewsize) { + this.crewsize = crewsize; + } + + public String getClosedFlag() { + return closedFlag; + } + + public void setClosedFlag(String closedFlag) { + this.closedFlag = closedFlag; + } + + public String getActionNotes() { + return actionNotes; + } + + public void setActionNotes(String actionNotes) { + this.actionNotes = actionNotes; + } + + public String getOutWorkFlag() { + return outWorkFlag; + } + + public void setOutWorkFlag(String outWorkFlag) { + this.outWorkFlag = outWorkFlag; + } + + public String getOutWorkPartNo() { + return outWorkPartNo; + } + + public void setOutWorkPartNo(String outWorkPartNo) { + this.outWorkPartNo = outWorkPartNo; + } + + public Double getQtyOnPR() { + return qtyOnPR; + } + + public void setQtyOnPR(Double qtyOnPR) { + this.qtyOnPR = qtyOnPR; + } + + public Double getQtyOnPO() { + return qtyOnPO; + } + + public void setQtyOnPO(Double qtyOnPO) { + this.qtyOnPO = qtyOnPO; + } + + public Double getQtyScrapt() { + return qtyScrapt; + } + + public void setQtyScrapt(Double qtyScrapt) { + this.qtyScrapt = qtyScrapt; + } + + public String getPfPartNo() { + return pfPartNo; + } + + public void setPfPartNo(String pfPartNo) { + this.pfPartNo = pfPartNo; + } + + public String getPfRevNo() { + return pfRevNo; + } + + public void setPfRevNo(String pfRevNo) { + this.pfRevNo = pfRevNo; + } + + public String getToolID() { + return toolID; + } + + public void setToolID(String toolID) { + this.toolID = toolID; + } + + public String getJjgzUnitFactorDb() { + return jjgzUnitFactorDb; + } + + public void setJjgzUnitFactorDb(String jjgzUnitFactorDb) { + this.jjgzUnitFactorDb = jjgzUnitFactorDb; + } + + public String getJjgzUnitFactor() { + return jjgzUnitFactor; + } + + public void setJjgzUnitFactor(String jjgzUnitFactor) { + this.jjgzUnitFactor = jjgzUnitFactor; + } + + public Double getJjgzUnitPrice() { + return jjgzUnitPrice; + } + + public void setJjgzUnitPrice(Double jjgzUnitPrice) { + this.jjgzUnitPrice = jjgzUnitPrice; + } + + public BigDecimal getLastApproveQty() { + return lastApproveQty; + } + + public void setLastApproveQty(BigDecimal lastApproveQty) { + this.lastApproveQty = lastApproveQty; + } + + public Double getDefectiveQty() { + return defectiveQty; + } + + public void setDefectiveQty(Double defectiveQty) { + this.defectiveQty = defectiveQty; + } +} + diff --git a/src/main/java/com/heai/modules/production/entity/SobomData.java b/src/main/java/com/heai/modules/production/entity/SobomData.java new file mode 100644 index 0000000..230d11a --- /dev/null +++ b/src/main/java/com/heai/modules/production/entity/SobomData.java @@ -0,0 +1,188 @@ +package com.heai.modules.production.entity; + +import java.util.Date; + +public class SobomData { + /** + * + */ + private String site; + + /** + * + */ + private String orderNo; + + /** + * + */ + private Double itemNo; + + /** + * + */ + private String componentPartNo; + + /** + * + */ + private Double qtyAssembly; + + /** + * + */ + private Double qtyFixedScrapt; + + /** + * + */ + private Double scraptFactor; + + /** + * + */ + private String remark; + + /** + * + */ + private Double qtyRequired; + + /** + * + */ + private Double qtyIssue; + + /** + * + */ + private Date issueDate; + + /** + * + */ + private Double qtyReserved; + + /** + * + */ + private String matGroup; + + /** + * + */ + private Double qtyNotified; + + public String getSite() { + return site; + } + + public void setSite(String site) { + this.site = site; + } + + public String getOrderNo() { + return orderNo; + } + + public void setOrderNo(String orderNo) { + this.orderNo = orderNo; + } + + public Double getItemNo() { + return itemNo; + } + + public void setItemNo(Double itemNo) { + this.itemNo = itemNo; + } + + public String getComponentPartNo() { + return componentPartNo; + } + + public void setComponentPartNo(String componentPartNo) { + this.componentPartNo = componentPartNo; + } + + public Double getQtyAssembly() { + return qtyAssembly; + } + + public void setQtyAssembly(Double qtyAssembly) { + this.qtyAssembly = qtyAssembly; + } + + public Double getQtyFixedScrapt() { + return qtyFixedScrapt; + } + + public void setQtyFixedScrapt(Double qtyFixedScrapt) { + this.qtyFixedScrapt = qtyFixedScrapt; + } + + public Double getScraptFactor() { + return scraptFactor; + } + + public void setScraptFactor(Double scraptFactor) { + this.scraptFactor = scraptFactor; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public Double getQtyRequired() { + return qtyRequired; + } + + public void setQtyRequired(Double qtyRequired) { + this.qtyRequired = qtyRequired; + } + + public Double getQtyIssue() { + return qtyIssue; + } + + public void setQtyIssue(Double qtyIssue) { + this.qtyIssue = qtyIssue; + } + + public Date getIssueDate() { + return issueDate; + } + + public void setIssueDate(Date issueDate) { + this.issueDate = issueDate; + } + + public Double getQtyReserved() { + return qtyReserved; + } + + public void setQtyReserved(Double qtyReserved) { + this.qtyReserved = qtyReserved; + } + + public String getMatGroup() { + return matGroup; + } + + public void setMatGroup(String matGroup) { + this.matGroup = matGroup; + } + + public Double getQtyNotified() { + return qtyNotified; + } + + public void setQtyNotified(Double qtyNotified) { + this.qtyNotified = qtyNotified; + } +} + diff --git a/src/main/java/com/heai/modules/production/service/impl/DailyPlanServiceImpl.java b/src/main/java/com/heai/modules/production/service/impl/DailyPlanServiceImpl.java index 8ca1866..7287ad5 100644 --- a/src/main/java/com/heai/modules/production/service/impl/DailyPlanServiceImpl.java +++ b/src/main/java/com/heai/modules/production/service/impl/DailyPlanServiceImpl.java @@ -975,6 +975,13 @@ public class DailyPlanServiceImpl implements DailyPlanService { for (int i = 0; i checkRouting=dailyPlanMapper.checkRoutingMachRunFactor(inData.getSite(),inData.getOrderNo(),inData.getItemNo()); + if(checkRouting.size()==0){ + throw new RuntimeException("该生产订单工序不存在!"); + } + if(checkRouting.get(0).getMachRunFactor()==0||checkRouting.get(0).getMachRunFactor()==null){ + throw new RuntimeException("该生产订单工序的单位产出不能为0!请去ERP生产订单的工艺路线下修改!!"); + } int seqNo=dailyPlanMapper.getDataSequence(); dailyPlanMapper.updateDataSequence(); ScheduleData saveData=new ScheduleData(); @@ -1042,6 +1049,13 @@ public class DailyPlanServiceImpl implements DailyPlanService { // } for (int i = 0; i checkRouting=dailyPlanMapper.checkRoutingMachRunFactor(inData.getSite(),inData.getOrderNo(),inData.getItemNo()); + if(checkRouting.size()==0){ + throw new RuntimeException("该生产订单工序不存在!"); + } + if(checkRouting.get(0).getMachRunFactor()==0||checkRouting.get(0).getMachRunFactor()==null){ + throw new RuntimeException("该生产订单工序的单位产出不能为0!请去ERP生产订单的工艺路线下修改!!"); + } int seqNo=dailyPlanMapper.getDataSequence(); dailyPlanMapper.updateDataSequence(); ScheduleData saveData=new ScheduleData(); diff --git a/src/main/resources/mapper/production/DailyPlanMapper.xml b/src/main/resources/mapper/production/DailyPlanMapper.xml index 267f276..c3879d9 100644 --- a/src/main/resources/mapper/production/DailyPlanMapper.xml +++ b/src/main/resources/mapper/production/DailyPlanMapper.xml @@ -388,6 +388,10 @@ + update DataSequence set seqNo=seqNo+1 where SeqType= 'A'