春风项目四线(合箱线、总装线)
懒羊羊
2024-01-22 55b0cb49a929591ebb18df62aa5d68636d4c7e9c
提交 | 用户 | 时间
fd2207 1 package com.jcdm.quartz.task;
2
55b0cb 3 import com.jcdm.main.bs.orderScheduling.domain.BsOrderScheduling;
4 import com.jcdm.main.bs.orderScheduling.service.IBsOrderSchedulingService;
5 import com.jcdm.main.webservice.service.ReceivingServices;
6 import org.springframework.beans.factory.annotation.Autowired;
fd2207 7 import org.springframework.stereotype.Component;
8 import com.jcdm.common.utils.StringUtils;
55b0cb 9
10 import java.util.List;
fd2207 11
12 /**
13  * 定时任务调度测试
14  * 
15  * @author jc
16  */
17 @Component("ryTask")
18 public class RyTask
19 {
20     public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i)
21     {
22         System.out.println(StringUtils.format("执行多参方法: 字符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i));
23     }
24
25     public void ryParams(String params)
26     {
27         System.out.println("执行有参方法:" + params);
28     }
29
30     public void ryNoParams()
31     {
32         System.out.println("执行无参方法");
33     }
55b0cb 34
35     @Autowired
36     private IBsOrderSchedulingService bsOrderSchedulingService;
37     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";
38     public void workReportingTasks(){
39         report10();
40         report20();
41     }
42
43     public void report10(){
44         BsOrderScheduling bsOrderScheduling = new BsOrderScheduling();
45         bsOrderScheduling.setReport10("0");
46         List<BsOrderScheduling> bsOrderSchedulings = bsOrderSchedulingService.selectBsOrderSchedulingList(bsOrderScheduling);
47         for (BsOrderScheduling orderScheduling : bsOrderSchedulings) {
48             String xmlResult = ReceivingServices.getInterfaceInformationXml(url, getProductionPlanInformationXml(orderScheduling.getOrderNo(), "0010"));
49             String status = ReceivingServices.xmlToJSON3(xmlResult);
50             if(status.equals("1")){
51                 orderScheduling.setReport10("1");
52                 int i = bsOrderSchedulingService.updateBsOrderScheduling(orderScheduling);
53                 System.out.println("更新状态成功");
54             }
55         }
56     }
57
58     public void report20(){
59         BsOrderScheduling bsOrderScheduling = new BsOrderScheduling();
60         bsOrderScheduling.setReport20("0");
61         List<BsOrderScheduling> bsOrderSchedulings = bsOrderSchedulingService.selectBsOrderSchedulingList(bsOrderScheduling);
62         for (BsOrderScheduling orderScheduling : bsOrderSchedulings) {
63             String xmlResult = ReceivingServices.getInterfaceInformationXml(url, getProductionPlanInformationXml(orderScheduling.getOrderNo(), "0790"));
64             String status = ReceivingServices.xmlToJSON3(xmlResult);
65             if(status.equals("1")){
66                 orderScheduling.setReport10("1");
67                 int i = bsOrderSchedulingService.updateBsOrderScheduling(orderScheduling);
68                 System.out.println("更新状态成功");
69             }
70         }
71     }
72
73     public static String getProductionPlanInformationXml(String orderNo,String location){
74         String content = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:urn=\"urn:sap-com:document:sap:rfc:functions\">\n" +
75                 "   <soapenv:Header/>\n" +
76                 "   <soapenv:Body>\n" +
77                 "      <urn:ZPP_BC_001>\n" +
78                 "         <IV_AUFNR>"+orderNo+"</IV_AUFNR>\n" +
79                 "          <IV_VORNR>"+location+"</IV_VORNR>\n" +
80                 "           <IV_LMNGA>1</IV_LMNGA>\n" +
81                 "           <IV_XMNGA>0</IV_XMNGA>   \n" +
82                 "         <IV_STATU>1</IV_STATU>  \n" +
83                 "      </urn:ZPP_BC_001>\n" +
84                 "   </soapenv:Body>\n" +
85                 "</soapenv:Envelope>";
86         return content;
87     }
fd2207 88 }