Prechádzať zdrojové kódy

【次元EIS接口,接口增加再次转UTF-8,错误代码判断调整】

xiaost 1 týždeň pred
rodič
commit
1dfd47ee41

+ 6 - 2
src/main/java/com/uas/eis/controller/StepWorkController.java

@@ -82,7 +82,9 @@ public class StepWorkController {
      * @param data
      * @return
      */
-    @RequestMapping(value="/mes-product/public/station/center/test", method = RequestMethod.POST)
+    @RequestMapping(value="/mes-product/public/station/center/test", method = RequestMethod.POST,
+            consumes = "application/json;charset=UTF-8",
+            produces = "application/json;charset=UTF-8")
     public StepWorkApiResult<Map<String,Object>> test(HttpServletRequest request, @RequestBody String data){
         if(!StringUtil.hasText(data) || !StringUtil.hasText(data) ){
             throw new ApiStepWorkException(new StepWorkApiResult(ErrorMessage.BUSINESS_DATAILLEGAL));
@@ -102,7 +104,9 @@ public class StepWorkController {
      * }
      * @return
      */
-    @RequestMapping(value="/mes-product/public/station/center/over/station", method = RequestMethod.POST)
+    @RequestMapping(value="/mes-product/public/station/center/over/station", method = RequestMethod.POST,
+            consumes = "application/json;charset=UTF-8",
+            produces = "application/json;charset=UTF-8")
     public StepWorkApiResult<Map<String,Object>> station(HttpServletRequest request, @RequestBody String data){
         if(!StringUtil.hasText(data) || !StringUtil.hasText(data) ){
             throw new ApiStepWorkException(new StepWorkApiResult(ErrorMessage.BUSINESS_DATAILLEGAL));

+ 1 - 1
src/main/java/com/uas/eis/serviceImpl/StepWorkServiceImpl.java

@@ -323,7 +323,7 @@ public class StepWorkServiceImpl implements StepWorkService {
                 return StepWorkApiResponse.failRsp(400,"测试结果为不合格,不良代码(failureCode)值必填!");
             }
         }
-        if(StringUtil.hasText("failureCode")) {
+        if(StringUtil.hasText(failureCode)) {
             String bccode = baseDao.getJdbcTemplate().queryForObject("select max(bc_code) from badcode where bc_code=?", String.class, failureCode);//oErrMessage = "不良代码"+BadCode[i]+"不存在";
             if (null == bccode) {
                 throw new ApiStepWorkException(new StepWorkApiResult(false, 400, "测试不良代码:" + failureCode + "在MES系统不存在!"));