Просмотр исходного кода

四医大短信功能测试修改

liubo лет назад: 3
Родитель
Сommit
ea9fbb52b5

+ 4 - 4
zd-api/zd-api-system/src/main/java/com/zd/system/api/chemical/RemoteStockService.java

@@ -35,10 +35,10 @@ public interface RemoteStockService {
     public void queryUplinkResult();
 
     @GetMapping(value = "/hxpStock/sendSydSms")
-    public R sendSydSms(@RequestParam(value = "content", required = true) String content,
-                        @RequestParam(value = "purpose", required = true) Integer purpose,
-                        @RequestParam(value = "lockApplyId") Long lockApplyId,
-                        @RequestParam(value = "phones", required = true) @NotNull String... phones);
+    public R sendSydSms(@RequestParam(value = "content") String content,
+                        @RequestParam(value = "purpose") Integer purpose,
+                        @RequestParam(value = "lockApplyId", required = false) Long lockApplyId,
+                        @RequestParam(value = "phones") @NotNull String... phones);
 
     /**
      * 四医大短信告警方案阶梯式通知流程

+ 7 - 6
zd-modules/zd-chemical/src/main/java/com/zd/chemical/controller/HxpStockController.java

@@ -231,16 +231,17 @@ public class HxpStockController extends BaseController {
      * @return 发送结果
      */
     @GetMapping(value = "/sendSydSms")
-    public R sendSydSms(@RequestParam(value = "content", required = true) String content,
-                        @RequestParam(value = "purpose", required = true) Integer purpose,
-                        @RequestParam(value = "lockApplyId") Long lockApplyId,
-                        @RequestParam(value = "phones", required = true) @NotNull String... phones){
+    public R sendSydSms(@RequestParam(value = "content") String content,
+                        @RequestParam(value = "purpose") Integer purpose,
+                        @RequestParam(value = "lockApplyId", required = false) Long lockApplyId,
+                        @RequestParam(value = "phones") @NotNull String... phones){
 
         try {
             return smsSydUtil.sendSydSms(content, purpose, lockApplyId, phones);
         } catch (Exception e) {
-            logger.error("四医大短信调用发生异常!");
-           return R.fail("调用发生异常");
+            e.printStackTrace();
+            logger.error("四医大短信调用发生异常!" + e.getMessage());
+           return R.fail("短信发送失败:" + e.getMessage());
         }
     }
 }

+ 1 - 1
zd-modules/zd-chemical/src/main/java/com/zd/chemical/service/impl/HxpStockServiceImpl.java

@@ -309,7 +309,7 @@ public class HxpStockServiceImpl implements IHxpStockService {
      * @return
      */
     @Override
-    public boolean RFIDCheck(InventoryTag tag) {
+    public synchronized boolean RFIDCheck(InventoryTag tag) {
         String rfidCode = tag.getEpc();
         if(StringUtils.isBlank(rfidCode)){
             return false;

+ 7 - 7
zd-modules/zd-chemical/src/main/java/com/zd/chemical/util/SmsSydUtil.java

@@ -26,7 +26,7 @@ import java.util.stream.Stream;
 @Component
 public class SmsSydUtil {
 
-    private static MTPack mtPack;
+    private MTPack mtPack;
 
     // 证号 djjx
     // 登录密码 6B1aQety
@@ -64,14 +64,14 @@ public class SmsSydUtil {
 
     }
 
-    private static MTPack buildDefaultSMSPack() {
-        if(SmsSydUtil.mtPack == null){
-            MTPack mtPack = new MTPack();
+    private MTPack buildDefaultSMSPack() {
+        if(this.mtPack == null){
+            this.mtPack = new MTPack();
             mtPack.setSendType(MTPack.SendType.MASS);
             mtPack.setMsgType(MTPack.MsgType.SMS);
             mtPack.setBizType(1);
         }
-        return SmsSydUtil.mtPack;
+        return this.mtPack;
     }
 
     /**
@@ -114,14 +114,14 @@ public class SmsSydUtil {
     /**
      * 短信下发范例 每个话单,一个扩展码
      */
-    private synchronized static R singleTicketMsgId(@NotNull String content, UUID uuid, @NotNull String... phones) throws Exception {
+    private synchronized R singleTicketMsgId(@NotNull String content, UUID uuid, @NotNull String... phones) throws Exception {
 
         MTPack pack = buildDefaultSMSPack();
 
         // 批次号
         pack.setBatchID(uuid);
 
-        log.info("四医大短信下发参数:UUID," + pack.getBatchID() + "手机号:" + phones.toString() + "内容:" + content);
+        log.info("四医大短信下发参数:UUID," + pack.getBatchID() + "手机号:" + JSONUtil.toJsonStr(phones) + ",内容:" + content);
 
         List<MessageData> msgs = new ArrayList<>();
         for (String phone : phones) {

+ 3 - 1
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/socket/runner/TCPServer.java

@@ -227,7 +227,9 @@ public class TCPServer implements Runnable {
 //
 //        System.out.println(TCPServer.byte2hex(b));
 
-        TransmissionVo transmissionVo = new TransmissionVo("fe dc 01 6b 55 65 61 6a 67 00 00 1f a0 03 00 10 00 00 01 2d 00 00 02 3a 00 01 88 08 00 00 00 00 00");
+        String str = "fe dc 01 78 99 4c 6c 61 88 00 02 64 30 03 00 34 00 00 00 00 00 00 00 00 00 00 01 2d 00 00 01 55 00 01 88 f6 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00";
+
+        TransmissionVo transmissionVo = new TransmissionVo(str);
 
         System.out.println(JSONUtil.toJsonStr(transmissionVo));
     }