Administrator
2023-04-17 63fbfddabe08e353ad75e495c2ac8dc5203da88c
提交 | 用户 | 时间
58d006 1 package com.mandi.fendan.util;
A 2
3 import java.util.List;
4
5 import org.apache.log4j.Logger;
6 import org.quartz.Job;
7 import org.quartz.JobExecutionContext;
8 import org.quartz.JobExecutionException;
9 import org.springframework.context.ApplicationContext;
10
11 import com.mandi.common.SpringContext;
12 import com.mandi.fendan.mapper.fd_errsheetMapper;
13 import com.mandi.fendan.persist.ErrSheet;
14 import com.mandi.fendan.service.IErpService;
15
16 public class SendcmErrsheetJob implements Job{
17     private Logger log=Logger.getLogger(SendcmErrsheetJob.class);    
18     
19     @Override
20     public void execute(JobExecutionContext arg0) throws JobExecutionException {
21         ApplicationContext ac=SpringContext.getAppContext();
22         IErpService erpser=ac.getBean(IErpService.class);
23         fd_errsheetMapper errsper=ac.getBean(fd_errsheetMapper.class);
24         List<ErrSheet> errList=errsper.getAll();
25 //        log.info("查找出门错误单据::::::::::开始:::::::::");
26         if(errList!=null){
27             for (int i = 0; i <errList.size(); i++) {
28                 ErrSheet es=errList.get(i);
29                 boolean delboo=true;
30                 try {
31                     erpser.sxccCheck(es.getBsNo(), es.getVehicleId(), es.getZZ());
32                 } catch (Exception e) {
33                     delboo=false;
34                     es.setErrmsg(e.getMessage());
35                     errsper.udpateErr(es);
36                 }
37                 if(delboo){
38                     errsper.del(es.getId());
39                 }
40             }
41         }
42 //        log.info("查找出门错误单据::::::::::结束:::::::::");
43         
44     }
45
46 }