Browse Source

0412更新

master
ruanqi 3 years ago
parent
commit
2eeaae172d
  1. 2
      src/main/java/com/heai/modules/production/dao/DailyPlanMapper.java
  2. 6
      src/main/java/com/heai/modules/production/entity/GenerateReportData.java
  3. 9
      src/main/java/com/heai/modules/production/service/impl/DailyPlanServiceImpl.java
  4. 9
      src/main/resources/mapper/production/DailyPlanMapper.xml

2
src/main/java/com/heai/modules/production/dao/DailyPlanMapper.java

@ -319,6 +319,8 @@ public interface DailyPlanMapper {
* @throw
*/
List<SfdcTimeHistData> checkSfdcTimeHistData(StartSeqNoData inData);
Integer getHistSeqNo(StartSeqNoData inData);
/**
* @Description 保存开始生产
* @Title saveSfdcTimeHistDataStart

6
src/main/java/com/heai/modules/production/entity/GenerateReportData.java

@ -29,11 +29,11 @@ public class GenerateReportData {
private String workCenterDesc;
private Integer qtyRequired;
private String qtyRequired;
private Integer qtyReported;
private String qtyReported;
private Integer qtyApprove;
private String qtyApprove;
private BigDecimal timeRequired;

9
src/main/java/com/heai/modules/production/service/impl/DailyPlanServiceImpl.java

@ -712,6 +712,13 @@ public class DailyPlanServiceImpl implements DailyPlanService {
@Override
public SOScheduledRoutingOutData searchSeqNo(SOScheduledRoutingOutData inData){
StartSeqNoData startSeqNoData=new StartSeqNoData();
startSeqNoData.setSeqNo(inData.getSeqNo());
startSeqNoData.setSite(inData.getSite());
List<SfdcTimeHistData> checkSfdcTimeHistData =dailyPlanMapper.checkSfdcTimeHistData(startSeqNoData);
if(checkSfdcTimeHistData.size()==0){
throw new RuntimeException("派工单未开始生产!");
}
SOScheduledRoutingOutData result =dailyPlanMapper.searchSeqNo(inData);
return result;
}
@ -726,6 +733,8 @@ public class DailyPlanServiceImpl implements DailyPlanService {
if(checkSfdcTimeHistData.size()>0){
throw new RuntimeException("派工单已经开始生产无需再次开始!");
}
Integer histSeqNo=dailyPlanMapper.getHistSeqNo(inData);
sfdcTimeHistData.setHistSeqNo(histSeqNo);
dailyPlanMapper.saveSfdcTimeHistDataStart(sfdcTimeHistData);
}
}

9
src/main/resources/mapper/production/DailyPlanMapper.xml

@ -324,7 +324,7 @@
update ScheduleList set scheduledQty=scheduledQty+#{sumQty} where Site=#{site} and OrderNo=#{orderNo} and itemNo=#{itemNo} and type=#{scheduleType}
</update>
<select id="searchReportedQty" resultType="SORoutingData">
select top 1 isnull(QtyReported,0) QtyReported,isnull(lastApproveQty,0) lastApproveQty ,dbo.Get_PartWeightFactorForReport(#{site},#{partNo},#{orderNo}) as weightFactor from SORouting where Site=#{site} and OrderNo=#{orderNo} and itemNo=#{itemNo}
select top 1 isnull(QtyReported,0) QtyReported,isnull(lastApproveQty,0) lastApproveQty ,dbo.Get_PartWeightFactorForReport(#{site},#{partNo},#{orderNo}) as weightFactor,dbo.Get_sfdcReportedSetupTime(#{site},#{seqNo}) as timeReported from SORouting where Site=#{site} and OrderNo=#{orderNo} and itemNo=#{itemNo}
</select>
<select id="getSOScheduleRoutingData" resultType="SOScheduledRoutingOutData">
select Site,OrderNo,ItemNo,SeqNo,QtyRequired,QtyReported,QtyApprove,TimeRequired,TimeReported,
@ -430,12 +430,15 @@
</select>
<select id="checkSfdcTimeHistData" resultType="com.heai.modules.production.entity.SfdcTimeHistData">
select site,OrderNo,ItemNo,SeqNo from SFDC_TimeHist where site=#{site} and seqNo=#{seqNo} and EventDesc='开始生产'
select site,OrderNo,ItemNo,SeqNo from SFDC_TimeHist where site=#{site} and seqNo=#{seqNo} and EventDesc='开始生产' and CompletedFlag='N'
</select>
<select id="getHistSeqNo" resultType="Integer">
select isnull(max(HistSeqNo),0)+1 from SFDC_TimeHist where site=#{site} and seqNo=#{seqNo}
</select>
<insert id="saveSfdcTimeHistDataStart">
insert into SFDC_TimeHist (Site,OrderNo,ItemNo,SeqNo,HistSeqNo,EventTime,Enteredby,EventDesc,DowntimeCode,EventType,LinkHistSeqNo,TillTime,TillEnteredTime,
TillEnteredBy,CompletedFlag,TotalTime,DowntimePhaseIn,RollNo) values
(#{site},#{orderNo},#{itemNo},#{seqNo},1,GetDate(),#{enteredby},'开始生产','','P',null,null,null,null,'N',0,'','*')
(#{site},#{orderNo},#{itemNo},#{seqNo},#{histSeqNo},GetDate(),#{enteredby},'开始生产','','P',null,null,null,null,'N',0,'','*')
</insert>
</mapper>
Loading…
Cancel
Save