|
@@ -124,7 +124,7 @@ public class CommSendService {
|
|
|
if (e == null) {
|
|
|
return;
|
|
|
}
|
|
|
- List<RealExamFault> listREF = realExamFaultService.listAllType2YesLoopReadState(e.getExamId());
|
|
|
+ List<RealExamFault> listREF = realExamFaultService.listAllType2LoopReadStateByExamId(e.getExamId());
|
|
|
listREF.forEach(ref -> {
|
|
|
Sim s = simService.selectSimBySimId(e.getSimId());
|
|
|
Fault f = faultService.selectFaultByFaultId(ref.getFaultId());
|
|
@@ -147,7 +147,7 @@ public class CommSendService {
|
|
|
}
|
|
|
|
|
|
public void readOneExamAtLast(RealExam re) {
|
|
|
- List<RealExamFault> listREF = realExamFaultService.listAllType2YesLoopReadState(re.getExamId());
|
|
|
+ List<RealExamFault> listREF = realExamFaultService.listAllType2LoopReadStateByExamId(re.getExamId());
|
|
|
listREF.forEach(ref -> {
|
|
|
Sim s = simService.selectSimBySimId(re.getSimId());
|
|
|
Fault f = faultService.selectFaultByFaultId(ref.getFaultId());
|
|
@@ -170,7 +170,7 @@ public class CommSendService {
|
|
|
public void scheduledReadSim() {
|
|
|
l.info("scheduledReadSim");
|
|
|
if (isSocketOk()) {
|
|
|
- readAll();
|
|
|
+ readAllAsync();
|
|
|
} else {
|
|
|
scheduledConnect();
|
|
|
}
|
|
@@ -314,6 +314,7 @@ public class CommSendService {
|
|
|
* @param f
|
|
|
*/
|
|
|
public void clearOneFault(Sim s, RealExamFault reF, Fault f) {
|
|
|
+ l.info("故障清除:getSimId = {},fault.getName = {}", s.getSimId(), f.getName());
|
|
|
// check todo:
|
|
|
|
|
|
//
|
|
@@ -336,6 +337,7 @@ public class CommSendService {
|
|
|
|
|
|
|
|
|
public void writeOneFault(Sim s, RealExamFault ref, Fault f) {
|
|
|
+ l.info("下发故障:getSimId = {},fault.getName = {}", s.getSimId(), f.getName());
|
|
|
try {
|
|
|
// todo:ref is null.
|
|
|
|
|
@@ -362,7 +364,7 @@ public class CommSendService {
|
|
|
|
|
|
//
|
|
|
{
|
|
|
- boolean allWritten = realExamFaultService.isAllType2YesStateEqualWritten(f1.getExamId());
|
|
|
+ boolean allWritten = realExamFaultService.isAllType2StateXiaFa(f1.getExamId());
|
|
|
if (allWritten) {
|
|
|
// 如果全部下发完毕 修改RealExam状态
|
|
|
l.info("allWritten id = {}", f1.getExamId());
|
|
@@ -382,7 +384,7 @@ public class CommSendService {
|
|
|
l.info("readOneFaultResistance");
|
|
|
try {
|
|
|
SimMsg sm = new SimMsg();
|
|
|
- String sendMsg = buildSendMsgReadFaultResistance(s.getSimNum(), "03");
|
|
|
+ String sendMsg = buildSendMsgReadFaultResistance(s.getSimNum(), f.getBindHardwareMsg());
|
|
|
sm.setSendMsg(sendMsg);
|
|
|
String receiveMsg = send(sendMsg, s);
|
|
|
sm.setReceiveMsg(receiveMsg);
|
|
@@ -493,7 +495,16 @@ public class CommSendService {
|
|
|
* @return
|
|
|
*/
|
|
|
public synchronized String send(final String sendMsg, final Sim s) throws IOException {
|
|
|
- l.info("sendMsg = " + sendMsg);
|
|
|
+ l.info("********sendMsg == [{}]", sendMsg);
|
|
|
+ //
|
|
|
+ {
|
|
|
+ try {
|
|
|
+ Thread.currentThread().sleep(1000L);
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //
|
|
|
String receiveMsg = null;
|
|
|
if (!isSocketOk()) {
|
|
|
openSocket();
|
|
@@ -513,7 +524,7 @@ public class CommSendService {
|
|
|
sbHex.append(String.format("%02X", buffer[i]));
|
|
|
}
|
|
|
receiveMsg = sbHex.toString();
|
|
|
- l.info("receiveMsg = {}", receiveMsg);
|
|
|
+ l.info("********receiveMsg = [{}]", receiveMsg);
|
|
|
if (!checkReceiveMsg(receiveMsg)) {
|
|
|
// todo:
|
|
|
l.warn("checkReceiveMsg fail receiveMsg = {}", receiveMsg);
|