hjg
2024-07-09 30304784e82d4bba24121328da8eb8490aec4f4f
JavaSource/com/mandi/webservice/service/impl/InvoiceService.java
@@ -276,18 +276,22 @@
//      Fileoperation.AppendContentToFile(Fileoperation.gettestFileName(), "参数yktkh::::"+RequestParam.getString(r, "yktkh"));
      String cardID="";
      boolean needRecord=true;
      Map<String, Object> mm=new HashMap<String, Object>();
      try {
         JsonParser jp=new JsonParser();
         JsonObject jo=jp.parse(jsonParam).getAsJsonObject();
         cardID=JSONobj.getstring(jo, "yktkh");
         if(jo.has("needRecord")) {
            needRecord = JSONobj.getbool(jo, "needRecord");
         }
      } catch (Exception e) {
         mm.put("respcode", 999);
         mm.put("respmsg", "数据解析出错!");
         String str=Jacksonmethod.tojson(mm, false);
         return str;
      }
      ObjectResult<Map<String, Object>> prs=fdser.getcInfo(cardID);
      ObjectResult<Map<String, Object>> prs=fdser.getcInfo(cardID,needRecord);
      if(prs.getCode() == 1) {
         log.info("卡号:" + cardID + "---- 错误:"+ prs.getErrmsg());
      }
@@ -370,18 +374,19 @@
   @Override
   public String receiveCurrWeight(HttpServletRequest r, String jsonParam) { // 获取业务单号 一次称重 二次称重
      JsonParser jp=new JsonParser();
      JsonObject jo=jp.parse(jsonParam).getAsJsonObject();
      JsonParser jp = new JsonParser();
      JsonObject jo = jp.parse(jsonParam).getAsJsonObject();
      String businessNo = JSONobj.getstring(jo, "businessNo");
      boolean firstWeighing = JSONobj.getbool(jo, "firstWeighing");
      boolean secondWeighing = JSONobj.getbool(jo, "secondWeighing");
      boolean isJc = JSONobj.getbool(jo, "isJc");
      String sdepartNo = JSONobj.getstring(jo, "sdepartNo");
      if(StringUtils.isBlank(businessNo) || businessNo.indexOf("XS")!=0 || StringUtils.isBlank(sdepartNo)
      if (StringUtils.isBlank(businessNo) || businessNo.indexOf("XS") != 0 || StringUtils.isBlank(sdepartNo)
      ) {
         return null;
      }
      // 刷新
      if(firstWeighing || secondWeighing) { // 称重需要刷新一下
      if (firstWeighing || secondWeighing) { // 称重需要刷新一下
         if ("06".equals(sdepartNo)) { // 明晟
            synchronized (FdXSTDService.refreshMsLedLock) {
               if (FdXSTDService.refreshMsLedLock) { // 系统繁忙
@@ -398,7 +403,10 @@
                  FdXSTDService.refreshMsLedLock = false;
               }
            }
         }else if ("08".equals(sdepartNo)) { // 义瑞
         }
      }
      if (firstWeighing || secondWeighing || isJc) { // 称重需要刷新一下
         if ("08".equals(sdepartNo)) { // 义瑞
            synchronized (FdXSTDService.refreshYrLedLock) {
               if (FdXSTDService.refreshYrLedLock) { // 系统繁忙
                  return null;
@@ -409,12 +417,29 @@
                  FdXSTDService.refreshYrLedLock = true;
               }
               fdser.sendToYrLed(null);
            }finally {
            } finally {
               synchronized (FdXSTDService.refreshYrLedLock) {
                  FdXSTDService.refreshYrLedLock = false;
               }
            }
         }
         if ("04".equals(sdepartNo)) { // 科技
            synchronized (FdXSTDService.refreshYrLedLock) {
               if (FdXSTDService.refreshKjLedLock) { // 系统繁忙
                  return null;
               }
            }
            try {
               synchronized (FdXSTDService.refreshKjLedLock) {
                  FdXSTDService.refreshKjLedLock = true;
               }
               fdser.sendToKjLed(null);
            } finally {
               synchronized (FdXSTDService.refreshKjLedLock) {
                  FdXSTDService.refreshKjLedLock = false;
               }
            }
         }
      }
      return null;
   }