|  |  |  | 
|---|
|  |  |  | import com.zy.core.properties.SlaveProperties; | 
|---|
|  |  |  | import com.zy.core.thread.BarcodeThread; | 
|---|
|  |  |  | import com.zy.core.thread.SiemensDevpThread; | 
|---|
|  |  |  | import com.zy.system.service.ConfigService; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Value; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  | import org.springframework.transaction.annotation.Transactional; | 
|---|
|  |  |  | import org.springframework.transaction.interceptor.TransactionAspectSupport; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.io.IOException; | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Slf4j | 
|---|
|  |  |  | @Service("mainService") | 
|---|
|  |  |  | @Transactional | 
|---|
|  |  |  | public class MainServiceImpl { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static final long COMMAND_TIMEOUT = 5 * 1000; | 
|---|
|  |  |  | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | StaDesc staDesc2 = staDescService.selectOne(new EntityWrapper<StaDesc>().eq("type_no", 1).eq("stn_no", staProtocol.getSiteId())); | 
|---|
|  |  |  | List<TaskWrk> taskWrkOutList = taskWrkService.selectList(new EntityWrapper<TaskWrk>() | 
|---|
|  |  |  | .eq("crn_no", staDesc2.getCrnNo()) | 
|---|
|  |  |  | .eq("wrk_sts", 12) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | if (!taskWrkOutList.isEmpty()) { | 
|---|
|  |  |  | News.watchInfo(String.valueOf(staProtocol.getSiteId()), "申请入库任务时发现正在执行的出库任务,入库任务被强制退回"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | staProtocol.setWorkNo(9997); | 
|---|
|  |  |  | staProtocol.setStaNo(inSta.getBackSta().shortValue()); | 
|---|
|  |  |  | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | TaskWrk taskWrk1 = taskWrkService.selectOne(new EntityWrapper<TaskWrk>().eq("barcode", barcode)); | 
|---|
|  |  |  | if (taskWrk1 != null) { | 
|---|
|  |  |  | News.watchInfo(String.valueOf(staProtocol.getSiteId()), "托盘码:" + barcode + "任务档存在"); | 
|---|
|  |  |  | 
|---|
|  |  |  | } else if (jsonObject.getInteger("code") == 500) { | 
|---|
|  |  |  | News.watchInfo(String.valueOf(staProtocol.getSiteId()), "条码:" + barcode + "申请WMS失败,系统回退,response=" + JSON.toJSONString(jsonObject)); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //                                staProtocol.setWorkNo(9997); | 
|---|
|  |  |  | //                                staProtocol.setStaNo(inSta.getBackSta().shortValue()); | 
|---|
|  |  |  | //                                MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); | 
|---|
|  |  |  | staProtocol.setWorkNo(9997); | 
|---|
|  |  |  | staProtocol.setStaNo(inSta.getBackSta().shortValue()); | 
|---|
|  |  |  | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | News.watchInfo(String.valueOf(staProtocol.getSiteId()), "条码:" + barcode + "申请WMS失败,response=" + JSON.toJSONString(jsonObject)); | 
|---|