package com.mandi.fendan.util;
|
|
import java.util.List;
|
|
import org.apache.log4j.Logger;
|
import org.quartz.Job;
|
import org.quartz.JobExecutionContext;
|
import org.quartz.JobExecutionException;
|
import org.springframework.context.ApplicationContext;
|
|
import com.mandi.common.SpringContext;
|
import com.mandi.fendan.mapper.fd_errsheetMapper;
|
import com.mandi.fendan.persist.ErrSheet;
|
import com.mandi.fendan.service.IErpService;
|
|
public class SendcmErrsheetJob implements Job{
|
private Logger log=Logger.getLogger(SendcmErrsheetJob.class);
|
|
@Override
|
public void execute(JobExecutionContext arg0) throws JobExecutionException {
|
ApplicationContext ac=SpringContext.getAppContext();
|
IErpService erpser=ac.getBean(IErpService.class);
|
fd_errsheetMapper errsper=ac.getBean(fd_errsheetMapper.class);
|
List<ErrSheet> errList=errsper.getAll();
|
// log.info("查找出门错误单据::::::::::开始:::::::::");
|
if(errList!=null){
|
for (int i = 0; i <errList.size(); i++) {
|
ErrSheet es=errList.get(i);
|
boolean delboo=true;
|
try {
|
erpser.sxccCheck(es.getBsNo(), es.getVehicleId(), es.getZZ());
|
} catch (Exception e) {
|
delboo=false;
|
es.setErrmsg(e.getMessage());
|
errsper.udpateErr(es);
|
}
|
if(delboo){
|
errsper.del(es.getId());
|
}
|
}
|
}
|
// log.info("查找出门错误单据::::::::::结束:::::::::");
|
|
}
|
|
}
|