Browse Source

部分更新

master
ruanqi 4 years ago
parent
commit
e914b4ee76
  1. 21
      src/main/java/com/gaotao/modules/shopOrder/controller/ProductionReportController.java
  2. 33
      src/main/java/com/gaotao/modules/shopOrder/service/Impl/ProductionReportServiceImpl.java
  3. 13
      src/main/java/com/gaotao/modules/shopOrder/service/ProductionReportService.java
  4. 65
      src/main/resources/mapper/shopOrder/ProductionReportMapper.xml

21
src/main/java/com/gaotao/modules/shopOrder/controller/ProductionReportController.java

@ -204,4 +204,25 @@ public class ProductionReportController {
}
return map;
}
/**
* @Description TODO
* @Title 取消报工
* @param inData
* @author rq
* @date 2022/5/22 16:13
* @return Object
* @throw
*/
@PostMapping("/cancelReport")
@ResponseBody
public Object cancelReport(@RequestBody SearchProductionLineOutputReportData inData){
ResponseData responseData = new ResponseData();
try {
responseData = productionReportService.cancelReport(inData);
} catch (Exception e) {
responseData.setMsg(e.getMessage());
responseData.setCode("500");
}
return responseData;
}
}

33
src/main/java/com/gaotao/modules/shopOrder/service/Impl/ProductionReportServiceImpl.java

@ -1,21 +1,28 @@
package com.gaotao.modules.shopOrder.service.Impl;
import com.gaotao.common.utils.DateUtil;
import com.gaotao.modules.base.dao.BaseMapper;
import com.gaotao.modules.base.entity.AccessSiteData;
import com.gaotao.modules.base.entity.SiteData;
import com.gaotao.modules.base.entity.WorkCenterData;
import com.gaotao.modules.pda.utils.ResponseData;
import com.gaotao.modules.schedule.mapper.ProcedureMapper;
import com.gaotao.modules.shopOrder.dao.ProductionReportMapper;
import com.gaotao.modules.shopOrder.entity.*;
import com.gaotao.modules.shopOrder.service.ProductionReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Service
public class ProductionReportServiceImpl implements ProductionReportService {
@Autowired
private ProcedureMapper procedureMapper;
@Autowired
private BaseMapper baseMapper;
@ -121,4 +128,28 @@ public class ProductionReportServiceImpl implements ProductionReportService {
List<SearchReportInOrderNoData> result = productionReportMapper.searchReportInOrderNoData(indata);
return result;
}
@Override
@Transactional
public ResponseData cancelReport(SearchProductionLineOutputReportData inData) {
ResponseData responseData = new ResponseData();
List<Object> params = new ArrayList<>();
params.add(inData.getSite());
params.add(inData.getOrderNo());
params.add(inData.getItemNo());
params.add(inData.getSeqNo());
List<Map<String, Object>> resultList = procedureMapper.getProcedureData("sfdc_cancelsfdc", params);
Map<String, Object> resultMap=resultList.get(0);
String resultCode=String.valueOf(resultMap.get("resultCode"));
if ("400".equalsIgnoreCase(resultCode)) {
String msg = String.valueOf(resultMap.get("resultMsg"));
throw new RuntimeException(msg);
}
responseData.setCode("200");
responseData.setSuccess(true);
responseData.setMsg("操作成功!");
return responseData;
}
}

13
src/main/java/com/gaotao/modules/shopOrder/service/ProductionReportService.java

@ -66,7 +66,7 @@ public interface ProductionReportService {
//=============查询-产线产量报告===================
/**
* @Description 查询-生产派工单
* @Description 查询-产线产量报告
* @Title searchProductionLineOutputReport
* @param indata
* @author rq
@ -100,4 +100,15 @@ public interface ProductionReportService {
*/
List<SearchReportInOrderNoData> searchReportInOrderNoData(SearchReportInOrderNoData indata);
/**
* @Description 取消报工
* @Title 取消报工
* @param
* @author rq
* @date 2021/10/9 16:37
* @return
* @throw
*/
ResponseData cancelReport(SearchProductionLineOutputReportData inData);
}

65
src/main/resources/mapper/shopOrder/ProductionReportMapper.xml

@ -58,19 +58,64 @@
</where>
</select>
<select id="searchProductionLineOutputReport" resultType="com.gaotao.modules.shopOrder.entity.SearchProductionLineOutputReportData">
Select s.NeedDate,s.PartNo,p.PartDescription+' / '+p.Spec as PartDescription,R.WorkcenterNo,W.WorkCenterDesc,T.Site,T.OrderNo,T.ItemNo,T.SeqNo,T.ReportDate,T.OperatorID,O.OperatorName,
(Case when T.Direction='+' then 1 else -1 end)*T.ReportQty as ReportQty,(Case when T.Direction='+' then 1 else -1 end)*T.ApproveQty as ApproveQty
,(Case when T.Direction='+' then 1 else -1 end)*T.ReportedSetupTime as ReportedSetupTime,(Case when T.Direction='+' then 1 else -1 end)*T.ReportedManfTime as ReportedManfTime,
(Case when T.Direction='+' then 1 else -1 end)*T.ReportedCleanupTime as ReportedCleanupTime,T.ScrapReason,T.DownTimeReason,T.Reverseflag,T.RelevantSeqNo,T.Remark,T.starttime,
T.finishtime,T.downtime,(T.ReportQty - T.ApproveQty) as DefectQty,T.AssJobSeqNo,SS.QtyRequired,SS.S_ResourceID,R.OperationDesc,P.ConfigurationTemplateID as CustomerName,
P.Remark as CustPartNo,Round((case when T.ReportedManfTime=0 then 999999 else T.ApproveQty / T.ReportedManfTime end),2) as ActRunRate,T.Scheduled_ShiftNo,T.Scheduled_Date,
T.FirstReportFlag,T.ReportedSetupDowntime,T.ReportedManfDowntime
from SFDC as T
left join SOScheduledRouting as SS on T.Site=SS.Site and T.OrderNo=SS.OrderNo and T.ItemNo=SS.ItemNo and T.AssJobSeqNo=SS.SeqNo,ShopOrder as S,SORouting as R,Part as P,WorkCenter as W,Operator as O
<!-- <select id="searchProductionLineOutputReport" resultType="com.gaotao.modules.shopOrder.entity.SearchProductionLineOutputReportData">-->
<!-- Select s.NeedDate,s.PartNo,p.PartDescription+' / '+p.Spec as PartDescription,R.WorkcenterNo,W.WorkCenterDesc,T.Site,T.OrderNo,T.ItemNo,T.SeqNo,T.ReportDate,T.OperatorID,O.OperatorName,-->
<!-- (Case when T.Direction='+' then 1 else -1 end)*T.ReportQty as ReportQty,(Case when T.Direction='+' then 1 else -1 end)*T.ApproveQty as ApproveQty-->
<!-- ,(Case when T.Direction='+' then 1 else -1 end)*T.ReportedSetupTime as ReportedSetupTime,(Case when T.Direction='+' then 1 else -1 end)*T.ReportedManfTime as ReportedManfTime,-->
<!-- (Case when T.Direction='+' then 1 else -1 end)*T.ReportedCleanupTime as ReportedCleanupTime,T.ScrapReason,T.DownTimeReason,T.Reverseflag,T.RelevantSeqNo,T.Remark,T.starttime,-->
<!-- T.finishtime,T.downtime,(T.ReportQty - T.ApproveQty) as DefectQty,T.AssJobSeqNo,SS.QtyRequired,SS.S_ResourceID,R.OperationDesc,P.ConfigurationTemplateID as CustomerName,-->
<!-- P.Remark as CustPartNo,Round((case when T.ReportedManfTime=0 then 999999 else T.ApproveQty / T.ReportedManfTime end),2) as ActRunRate,T.Scheduled_ShiftNo,T.Scheduled_Date,-->
<!-- T.FirstReportFlag,T.ReportedSetupDowntime,T.ReportedManfDowntime-->
<!-- from SFDC as T-->
<!-- left join SOScheduledRouting as SS on T.Site=SS.Site and T.OrderNo=SS.OrderNo and T.ItemNo=SS.ItemNo and T.AssJobSeqNo=SS.SeqNo,ShopOrder as S,SORouting as R,Part as P,WorkCenter as W,Operator as O-->
<!-- <where>-->
<!-- and T.Site=S.Site and T.OrderNo=S.OrderNo and T.Site=R.Site and T.OrderNo=R.OrderNo and T.ItemNo=R.ItemNo and s.Site=p.Site-->
<!-- and s.PartNo=p.PartNo and R.Site=W.Site and R.WorkCenterNo=W.WorkCenterNo and T.Site=O.Site and T.OperatorID=O.OperatorID-->
<!-- and T.Site in (Select Site from AccessSite where upper(UserID)=#{user})-->
<!-- <if test=" site != null and site != ''">-->
<!-- AND T.Site = #{site}-->
<!-- </if>-->
<!-- <if test=" partNo != null and partNo != ''">-->
<!-- AND s.PartNo like #{partNo}-->
<!-- </if>-->
<!-- <if test=" partDescription != null and partDescription != ''">-->
<!-- AND p.PartDescription+' / '+p.Spec like #{partDescription}-->
<!-- </if>-->
<!-- <if test=" orderNo != null and orderNo != ''">-->
<!-- AND T.OrderNo = #{orderNo}-->
<!-- </if>-->
<!-- <if test=" operatorID != null and operatorID != ''">-->
<!-- AND T.OperatorID like #{operatorID}-->
<!-- </if>-->
<!-- <if test=" workCenterNo != null and workCenterNo != ''">-->
<!-- AND R.WorkcenterNo like #{workCenterNo}-->
<!-- </if>-->
<!-- <if test=" sResourceID != null and sResourceID != ''">-->
<!-- AND SS.S_ResourceID like #{sResourceID}-->
<!-- </if>-->
<!-- <if test=" date1 != null ">-->
<!-- AND T.ReportDate >= #{date1}-->
<!-- </if>-->
<!-- <if test=" date2 != null ">-->
<!-- AND #{date2} >= T.ReportDate-->
<!-- </if>-->
<!-- </where>-->
<!-- </select>-->
<select id="searchProductionLineOutputReport" resultType="com.gaotao.modules.shopOrder.entity.SearchProductionLineOutputReportData">
Select T.Site,T.OrderNo,T.ItemNo,T.SeqNo,T.ReportDate,T.OperatorID,T.Direction,T.ReportQty,T.ApproveQty,Round(T.ReportedSetupTime,2) as reportedSetupTime,R.WorkcenterNo,W.WorkCenterDesc,O.OperatorName
,Round(T.ReportedManfTime,2) as reportedManfTime,T.ReportedCleanupTime,T.ScrapReason,T.DownTimeReason,T.Reverseflag,T.RelevantSeqNo,T.Remark
,T.starttime,T.finishtime,T.downtime,T.AssJobSeqNo,(T.ReportQty - T.ApproveQty) as DefectQty
,R.OperationDesc,SS.QtyRequired,SS.S_ResourceID,T.RollNo,T.Scheduled_ShiftNo,T.Scheduled_Date,T.FirstReportFlag,T.ReportedSetupDowntime ,T.ReportedManfDowntime
,S.PartNo,p.PartDescription+' / '+p.Spec as PartDescription,P.ConfigurationTemplateID as CustomerName,
P.Remark as CustPartNo,Round((case when T.ReportedManfTime=0 then 999999 else T.ApproveQty / T.ReportedManfTime end),2) as ActRunRate,s.NeedDate
from SFDC as T
left join SOScheduledRouting as SS on T.Site=SS.Site and T.OrderNo=SS.OrderNo and T.ItemNo=SS.ItemNo and T.AssJobSeqNo=SS.SeqNo
,ShopOrder as S,SORouting as R,Part as P,WorkCenter as W,Operator as O
<where>
and T.Site=S.Site and T.OrderNo=S.OrderNo and T.Site=R.Site and T.OrderNo=R.OrderNo and T.ItemNo=R.ItemNo and s.Site=p.Site
and s.PartNo=p.PartNo and R.Site=W.Site and R.WorkCenterNo=W.WorkCenterNo and T.Site=O.Site and T.OperatorID=O.OperatorID
and T.Site=R.Site and T.OrderNo=R.OrderNo and T.ItemNo=R.ItemNo
and T.Site in (Select Site from AccessSite where upper(UserID)=#{user})
<if test=" site != null and site != ''">
AND T.Site = #{site}

Loading…
Cancel
Save