package com.jcdm.quartz.task;
|
|
import com.jcdm.main.bs.orderScheduling.domain.BsOrderScheduling;
|
import com.jcdm.main.bs.orderScheduling.service.IBsOrderSchedulingService;
|
import com.jcdm.main.webservice.service.ReceivingServices;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Component;
|
import com.jcdm.common.utils.StringUtils;
|
|
import java.util.List;
|
|
/**
|
* 定时任务调度测试
|
*
|
* @author jc
|
*/
|
@Component("ryTask")
|
public class RyTask
|
{
|
public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i)
|
{
|
System.out.println(StringUtils.format("执行多参方法: 字符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i));
|
}
|
|
public void ryParams(String params)
|
{
|
System.out.println("执行有参方法:" + params);
|
}
|
|
public void ryNoParams()
|
{
|
System.out.println("执行无参方法");
|
}
|
|
@Autowired
|
private IBsOrderSchedulingService bsOrderSchedulingService;
|
String url = "http://podqapp.cfmoto.com.cn:50200/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_MES&receiverParty=&receiverService=&interface=SI_ZPP_CF_BC_001_SYN_OUT&interfaceNamespace=http://cfmoto.com/xi/MES";
|
public void workReportingTasks(){
|
report10();
|
report20();
|
}
|
|
public void report10(){
|
BsOrderScheduling bsOrderScheduling = new BsOrderScheduling();
|
bsOrderScheduling.setReport10("0");
|
List<BsOrderScheduling> bsOrderSchedulings = bsOrderSchedulingService.selectBsOrderSchedulingList(bsOrderScheduling);
|
for (BsOrderScheduling orderScheduling : bsOrderSchedulings) {
|
String xmlResult = ReceivingServices.getInterfaceInformationXml(url, getProductionPlanInformationXml(orderScheduling.getOrderNo(), "0010"));
|
String status = ReceivingServices.xmlToJSON3(xmlResult);
|
if(status.equals("1")){
|
orderScheduling.setReport10("1");
|
int i = bsOrderSchedulingService.updateBsOrderScheduling(orderScheduling);
|
System.out.println("更新状态成功");
|
}
|
}
|
}
|
|
public void report20(){
|
BsOrderScheduling bsOrderScheduling = new BsOrderScheduling();
|
bsOrderScheduling.setReport20("0");
|
List<BsOrderScheduling> bsOrderSchedulings = bsOrderSchedulingService.selectBsOrderSchedulingList(bsOrderScheduling);
|
for (BsOrderScheduling orderScheduling : bsOrderSchedulings) {
|
String xmlResult = ReceivingServices.getInterfaceInformationXml(url, getProductionPlanInformationXml(orderScheduling.getOrderNo(), "0790"));
|
String status = ReceivingServices.xmlToJSON3(xmlResult);
|
if(status.equals("1")){
|
orderScheduling.setReport10("1");
|
int i = bsOrderSchedulingService.updateBsOrderScheduling(orderScheduling);
|
System.out.println("更新状态成功");
|
}
|
}
|
}
|
|
public static String getProductionPlanInformationXml(String orderNo,String location){
|
String content = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:urn=\"urn:sap-com:document:sap:rfc:functions\">\n" +
|
" <soapenv:Header/>\n" +
|
" <soapenv:Body>\n" +
|
" <urn:ZPP_BC_001>\n" +
|
" <IV_AUFNR>"+orderNo+"</IV_AUFNR>\n" +
|
" <IV_VORNR>"+location+"</IV_VORNR>\n" +
|
" <IV_LMNGA>1</IV_LMNGA>\n" +
|
" <IV_XMNGA>0</IV_XMNGA> \n" +
|
" <IV_STATU>1</IV_STATU> \n" +
|
" </urn:ZPP_BC_001>\n" +
|
" </soapenv:Body>\n" +
|
"</soapenv:Envelope>";
|
return content;
|
}
|
}
|