Browse Source

2026-01-15

优化
master
fengyuan_yang 1 month ago
parent
commit
6c001a4c54
  1. 9
      src/main/java/com/gaotao/modules/shopOrder/entity/SearchProductionLineOutputReportData.java
  2. 10
      src/main/java/com/gaotao/modules/sys/service/impl/InterfaceLogServiceImpl.java
  3. 10
      src/main/java/com/gaotao/modules/sys/service/impl/SystemLogServiceImpl.java
  4. 100
      src/main/resources/mapper/shopOrder/ProductionReportMapper.xml

9
src/main/java/com/gaotao/modules/shopOrder/entity/SearchProductionLineOutputReportData.java

@ -63,6 +63,15 @@ public class SearchProductionLineOutputReportData {
private String user;
private Integer page;
private Integer limit;
private String spec;
public String getSpec() {
return spec;
}
public void setSpec(String spec) {
this.spec = spec;
}
public Date getNeedDate() {
return needDate;

10
src/main/java/com/gaotao/modules/sys/service/impl/InterfaceLogServiceImpl.java

@ -580,7 +580,7 @@ public class InterfaceLogServiceImpl implements InterfaceLogService {
HttpEntity<String> requestEntity = new HttpEntity<>(JSON.toJSONString(requestBody), headers);
String statusCode = "ERROR";
String statusCode = "500";
String message = "";
String lastResponseData = "";
@ -595,7 +595,7 @@ public class InterfaceLogServiceImpl implements InterfaceLogService {
String flag = responseJson.getString("Flag");
if ("success".equalsIgnoreCase(flag)) {
statusCode = "SUCCESS";
statusCode = "200";
message = "接口调用成功";
String u8CCode = responseJson.getString("U8CCode");
if (u8CCode != null && !u8CCode.isEmpty()) {
@ -608,7 +608,7 @@ public class InterfaceLogServiceImpl implements InterfaceLogService {
logger.info("更新StockTransactionLog同步状态成功,site: {}, transactionId: {}, 更新条数: {}", site, transactionId, syncUpdateCount);
}
} else {
statusCode = "FAILURE";
statusCode = "500";
message = responseJson.getString("ErrMsg");
if (message == null || message.isEmpty()) {
message = "接口调用失败";
@ -616,7 +616,7 @@ public class InterfaceLogServiceImpl implements InterfaceLogService {
}
} catch (Exception e) {
statusCode = "ERROR";
statusCode = "500";
message = "接口调用异常: " + e.getMessage();
lastResponseData = e.toString();
logger.error("调用外部接口异常", e);
@ -632,7 +632,7 @@ public class InterfaceLogServiceImpl implements InterfaceLogService {
// 9. 返回结果
Map<String, Object> result = new HashMap<>();
result.put("flag", "success".equalsIgnoreCase(statusCode) ? "success" : "failure");
result.put("flag", "200".equals(statusCode) ? "success" : "failure");
result.put("u8CCode", "");
result.put("errMsg", message);

10
src/main/java/com/gaotao/modules/sys/service/impl/SystemLogServiceImpl.java

@ -558,7 +558,7 @@ public class SystemLogServiceImpl implements SystemLogService {
HttpEntity<String> requestEntity = new HttpEntity<>(JSON.toJSONString(requestBody), headers);
String statusCode = "ERROR";
String statusCode = "500";
String message = "";
String lastResponseData = "";
@ -573,7 +573,7 @@ public class SystemLogServiceImpl implements SystemLogService {
String flag = responseJson.getString("Flag");
if ("success".equalsIgnoreCase(flag)) {
statusCode = "SUCCESS";
statusCode = "200";
message = "接口调用成功";
String u8CCode = responseJson.getString("U8CCode");
if (u8CCode != null && !u8CCode.isEmpty()) {
@ -586,7 +586,7 @@ public class SystemLogServiceImpl implements SystemLogService {
logger.info("更新StockTransactionLog同步状态成功,site: {}, transactionId: {}, 更新条数: {}", site, transactionId, syncUpdateCount);
}
} else {
statusCode = "FAILURE";
statusCode = "500";
message = responseJson.getString("ErrMsg");
if (message == null || message.isEmpty()) {
message = "接口调用失败";
@ -594,7 +594,7 @@ public class SystemLogServiceImpl implements SystemLogService {
}
} catch (Exception e) {
statusCode = "ERROR";
statusCode = "500";
message = "接口调用异常: " + e.getMessage();
lastResponseData = e.toString();
logger.error("调用外部接口异常", e);
@ -610,7 +610,7 @@ public class SystemLogServiceImpl implements SystemLogService {
// 9. 返回结果
Map<String, Object> result = new HashMap<>();
result.put("flag", "success".equalsIgnoreCase(statusCode) ? "success" : "failure");
result.put("flag", "200".equals(statusCode) ? "success" : "failure");
result.put("u8CCode", "");
result.put("errMsg", message);

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

@ -130,47 +130,103 @@
<!-- </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
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 AS PartDescription,
p.Spec as spec,
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})
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})
AND T.Reverseflag = 'N'
<if test=" site != null and site != ''">
AND T.Site = #{site}
</if>
<if test=" partNo != null and partNo != ''">
<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 test=" partDescription != null and partDescription != ''">
AND p.PartDescription like '%' + #{partDescription} + '%'
</if>
<if test=" spec != null and spec != ''">
AND p.Spec like '%' + #{spec} + '%'
</if>
<if test=" orderNo != null and orderNo != ''">
AND T.OrderNo = #{orderNo}
AND T.OrderNo like '%' + #{orderNo} + '%'
</if>
<if test=" operatorID != null and operatorID != ''">
<if test=" operatorID != null and operatorID != ''">
AND T.OperatorID like '%' + #{operatorID} + '%'
</if>
<if test=" workCenterNo != null and workCenterNo != ''">
<if test=" workCenterNo != null and workCenterNo != ''">
AND R.WorkcenterNo like '%' + #{workCenterNo} + '%'
</if>
<if test=" workCenterDesc != null and workCenterDesc != ''">
AND W.WorkCenterDesc like '%' + #{workCenterDesc} + '%'
</if>
<if test=" sResourceID != null and sResourceID != ''">
AND SS.S_ResourceID like '%' + #{sResourceID} + '%'
</if>
<if test=" date1 != null ">
<if test=" date1 != null ">
AND T.ReportDate >= #{date1}
</if>
<if test=" date2 != null ">
AND dateadd( DAY, 1, #{date2} ) > T.ReportDate
<if test=" date2 != null ">
AND dateadd(DAY, 1, #{date2}) > T.ReportDate
</if>
</where>
ORDER BY T.ReportDate DESC, T.OrderNo, T.ItemNo, T.SeqNo

Loading…
Cancel
Save