Browse Source

2026-01-15

优化
master
fengyuan_yang 2 months 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. 78
      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 String user;
private Integer page; private Integer page;
private Integer limit; private Integer limit;
private String spec;
public String getSpec() {
return spec;
}
public void setSpec(String spec) {
this.spec = spec;
}
public Date getNeedDate() { public Date getNeedDate() {
return needDate; 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); HttpEntity<String> requestEntity = new HttpEntity<>(JSON.toJSONString(requestBody), headers);
String statusCode = "ERROR";
String statusCode = "500";
String message = ""; String message = "";
String lastResponseData = ""; String lastResponseData = "";
@ -595,7 +595,7 @@ public class InterfaceLogServiceImpl implements InterfaceLogService {
String flag = responseJson.getString("Flag"); String flag = responseJson.getString("Flag");
if ("success".equalsIgnoreCase(flag)) { if ("success".equalsIgnoreCase(flag)) {
statusCode = "SUCCESS";
statusCode = "200";
message = "接口调用成功"; message = "接口调用成功";
String u8CCode = responseJson.getString("U8CCode"); String u8CCode = responseJson.getString("U8CCode");
if (u8CCode != null && !u8CCode.isEmpty()) { if (u8CCode != null && !u8CCode.isEmpty()) {
@ -608,7 +608,7 @@ public class InterfaceLogServiceImpl implements InterfaceLogService {
logger.info("更新StockTransactionLog同步状态成功,site: {}, transactionId: {}, 更新条数: {}", site, transactionId, syncUpdateCount); logger.info("更新StockTransactionLog同步状态成功,site: {}, transactionId: {}, 更新条数: {}", site, transactionId, syncUpdateCount);
} }
} else { } else {
statusCode = "FAILURE";
statusCode = "500";
message = responseJson.getString("ErrMsg"); message = responseJson.getString("ErrMsg");
if (message == null || message.isEmpty()) { if (message == null || message.isEmpty()) {
message = "接口调用失败"; message = "接口调用失败";
@ -616,7 +616,7 @@ public class InterfaceLogServiceImpl implements InterfaceLogService {
} }
} catch (Exception e) { } catch (Exception e) {
statusCode = "ERROR";
statusCode = "500";
message = "接口调用异常: " + e.getMessage(); message = "接口调用异常: " + e.getMessage();
lastResponseData = e.toString(); lastResponseData = e.toString();
logger.error("调用外部接口异常", e); logger.error("调用外部接口异常", e);
@ -632,7 +632,7 @@ public class InterfaceLogServiceImpl implements InterfaceLogService {
// 9. 返回结果 // 9. 返回结果
Map<String, Object> result = new HashMap<>(); 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("u8CCode", "");
result.put("errMsg", message); 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); HttpEntity<String> requestEntity = new HttpEntity<>(JSON.toJSONString(requestBody), headers);
String statusCode = "ERROR";
String statusCode = "500";
String message = ""; String message = "";
String lastResponseData = ""; String lastResponseData = "";
@ -573,7 +573,7 @@ public class SystemLogServiceImpl implements SystemLogService {
String flag = responseJson.getString("Flag"); String flag = responseJson.getString("Flag");
if ("success".equalsIgnoreCase(flag)) { if ("success".equalsIgnoreCase(flag)) {
statusCode = "SUCCESS";
statusCode = "200";
message = "接口调用成功"; message = "接口调用成功";
String u8CCode = responseJson.getString("U8CCode"); String u8CCode = responseJson.getString("U8CCode");
if (u8CCode != null && !u8CCode.isEmpty()) { if (u8CCode != null && !u8CCode.isEmpty()) {
@ -586,7 +586,7 @@ public class SystemLogServiceImpl implements SystemLogService {
logger.info("更新StockTransactionLog同步状态成功,site: {}, transactionId: {}, 更新条数: {}", site, transactionId, syncUpdateCount); logger.info("更新StockTransactionLog同步状态成功,site: {}, transactionId: {}, 更新条数: {}", site, transactionId, syncUpdateCount);
} }
} else { } else {
statusCode = "FAILURE";
statusCode = "500";
message = responseJson.getString("ErrMsg"); message = responseJson.getString("ErrMsg");
if (message == null || message.isEmpty()) { if (message == null || message.isEmpty()) {
message = "接口调用失败"; message = "接口调用失败";
@ -594,7 +594,7 @@ public class SystemLogServiceImpl implements SystemLogService {
} }
} catch (Exception e) { } catch (Exception e) {
statusCode = "ERROR";
statusCode = "500";
message = "接口调用异常: " + e.getMessage(); message = "接口调用异常: " + e.getMessage();
lastResponseData = e.toString(); lastResponseData = e.toString();
logger.error("调用外部接口异常", e); logger.error("调用外部接口异常", e);
@ -610,7 +610,7 @@ public class SystemLogServiceImpl implements SystemLogService {
// 9. 返回结果 // 9. 返回结果
Map<String, Object> result = new HashMap<>(); 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("u8CCode", "");
result.put("errMsg", message); result.put("errMsg", message);

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

@ -130,15 +130,65 @@
<!-- </select>--> <!-- </select>-->
<select id="searchProductionLineOutputReport" resultType="com.gaotao.modules.shopOrder.entity.SearchProductionLineOutputReportData"> <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> <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 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 s.PartNo = p.PartNo and R.Site = W.Site and R.WorkCenterNo = W.WorkCenterNo and T.Site = O.Site and T.OperatorID = O.OperatorID
@ -152,10 +202,13 @@
AND s.PartNo like '%' + #{partNo} + '%' AND s.PartNo like '%' + #{partNo} + '%'
</if> </if>
<if test=" partDescription != null and partDescription != ''"> <if test=" partDescription != null and partDescription != ''">
AND p.PartDescription+' / '+p.Spec like '%' + #{partDescription} + '%'
AND p.PartDescription like '%' + #{partDescription} + '%'
</if>
<if test=" spec != null and spec != ''">
AND p.Spec like '%' + #{spec} + '%'
</if> </if>
<if test=" orderNo != null and orderNo != ''"> <if test=" orderNo != null and orderNo != ''">
AND T.OrderNo = #{orderNo}
AND T.OrderNo like '%' + #{orderNo} + '%'
</if> </if>
<if test=" operatorID != null and operatorID != ''"> <if test=" operatorID != null and operatorID != ''">
AND T.OperatorID like '%' + #{operatorID} + '%' AND T.OperatorID like '%' + #{operatorID} + '%'
@ -163,6 +216,9 @@
<if test=" workCenterNo != null and workCenterNo != ''"> <if test=" workCenterNo != null and workCenterNo != ''">
AND R.WorkcenterNo like '%' + #{workCenterNo} + '%' AND R.WorkcenterNo like '%' + #{workCenterNo} + '%'
</if> </if>
<if test=" workCenterDesc != null and workCenterDesc != ''">
AND W.WorkCenterDesc like '%' + #{workCenterDesc} + '%'
</if>
<if test=" sResourceID != null and sResourceID != ''"> <if test=" sResourceID != null and sResourceID != ''">
AND SS.S_ResourceID like '%' + #{sResourceID} + '%' AND SS.S_ResourceID like '%' + #{sResourceID} + '%'
</if> </if>

Loading…
Cancel
Save