|
@@ -26,6 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.http.*;
|
|
import org.springframework.http.*;
|
|
import org.springframework.http.client.ClientHttpResponse;
|
|
import org.springframework.http.client.ClientHttpResponse;
|
|
|
|
+import org.springframework.scheduling.annotation.Async;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.util.StringUtils;
|
|
import org.springframework.util.StringUtils;
|
|
@@ -2733,6 +2734,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
pushReject(str, reporter, user.getName(), reason);
|
|
pushReject(str, reporter, user.getName(), reason);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if(timeType.getSyncSap()==1){
|
|
|
|
+ cancelReportPushSap(reportIds);
|
|
|
|
+ }
|
|
return httpRespMsg;
|
|
return httpRespMsg;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -7431,4 +7435,50 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
}
|
|
}
|
|
return httpRespMsg;
|
|
return httpRespMsg;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Async
|
|
|
|
+ public void cancelReportPushSap(String reportIds){
|
|
|
|
+ if(!StringUtils.isEmpty(reportIds)){
|
|
|
|
+ List<Integer> reportIdList = ListUtil.convertIntegerIdsArrayToList(reportIds);
|
|
|
|
+ List<ReportPushLog> reportPushLogList = reportPushLogService.list(new LambdaQueryWrapper<ReportPushLog>().in(ReportPushLog::getReportId, reportIdList));
|
|
|
|
+ for (Integer reportId : reportIdList) {
|
|
|
|
+ Optional<ReportPushLog> first = reportPushLogList.stream().filter(r -> r.getReportId().equals(reportId)).findFirst();
|
|
|
|
+ if(first.isPresent()){
|
|
|
|
+ XmlRequestData xmlRequestData=new XmlRequestData();
|
|
|
|
+ ZDeleteEmployeeTime zDeleteEmployeeTime=new ZDeleteEmployeeTime();
|
|
|
|
+ zDeleteEmployeeTime.setEmployeeTimeUUID(first.get().getUuid()==null?"":first.get().getUuid());
|
|
|
|
+ xmlRequestData.setZDeleteEmployeeTime(zDeleteEmployeeTime);
|
|
|
|
+ String xml = CommonUtils.convertToXml(xmlRequestData);
|
|
|
|
+ System.out.println(xml);
|
|
|
|
+ xml=xml.substring(xml.indexOf("<XMLDATA>")+9,xml.lastIndexOf("</XMLDATA>"));
|
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
|
+ sb.append("<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:glob=\"http://sap.com/xi/SAPGlobal20/Global\">\n" +
|
|
|
|
+ " <soapenv:Header/>\n" +
|
|
|
|
+ " <soapenv:Body>\n" +
|
|
|
|
+ " <glob:ZDeleteEmployeeTimeCreateRequest_sync>\n");
|
|
|
|
+ sb.append(xml);
|
|
|
|
+ sb.append(" </glob:ZDeleteEmployeeTimeCreateRequest_sync>\n" +
|
|
|
|
+ " </soapenv:Body>\n" +
|
|
|
|
+ "</soapenv:Envelope>");
|
|
|
|
+ System.out.println(sb.toString());
|
|
|
|
+ String result = "";
|
|
|
|
+ try {
|
|
|
|
+ result = WebServiceUtils.requestByXml("https://my602728.sapbyd.cn/sap/bc/srt/scs/sap/yyatr5vf6y_deleteemployeetime?sap-vhost=my602728.sapbyd.cn", sb.toString(), 0, "_BYDHOST", "Welcome1");
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ if(!StringUtils.isEmpty(result)) {
|
|
|
|
+ result = result.substring(result.indexOf("<soap-env:Body>")+15, result.lastIndexOf("</soap-env:Body>"));
|
|
|
|
+ result = result.substring(result.indexOf(">")+1, result.lastIndexOf("</n0:ZDeleteEmployeeTimeCreateConfirmation_sync>"));
|
|
|
|
+ result="<XMLDATA>"+result+"</XMLDATA>";
|
|
|
|
+ }
|
|
|
|
+ System.out.println(result);
|
|
|
|
+ XmlResponseData xmlResponseData = (XmlResponseData) CommonUtils.convertXmlStrToObject(XmlResponseData.class, result);
|
|
|
|
+ if(StringUtils.isEmpty(xmlResponseData.getZDeleteEmployeeTime())){
|
|
|
|
+ log.error("推送取消考勤失败===》UUID:"+xmlRequestData.getZDeleteEmployeeTime().getEmployeeTimeUUID());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|