王佳豪
2021-07-14 34718ece041e3ca5f424951439a8c4662aa58401
src/main/java/com/slcf/controller/WaitPakOutController.java
@@ -12,11 +12,10 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import com.slcf.controller.param.SetEmsParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import com.slcf.pojo.UserBean;
import com.slcf.bean.WaitPakOutCondition;
@@ -159,6 +158,34 @@
   }
   /**
    * 出库通知档设置任务为紧急状态
    * @return
    */
   @ResponseBody
   @RequestMapping(value = "/waitPakOutSetEms.action", produces = "text/html; charset=UTF-8")
   public String syncStocksFromSap(@RequestBody List<SetEmsParam> list) throws Exception {
      Integer i = 0;
      String errorTxt = "";
      if (list.size() > 0) {
         // 判断紧急任务数量是否已经超过3个,超出3个不允许继续新增紧急任务
         Integer emsNum = waitPakOutService.countEmsNum();
         if (emsNum < 3) {
            // 设置任务为紧急状态
            for (SetEmsParam item : list) {
               if (waitPakOutService.waitPakOutSetEms(item) > 0) {
                  i++;
               }
            }
         } else {
            errorTxt = "紧急任务已超出3个,请耐心等待任务完成";
         }
      } else {
         throw new Error("数据异常");
      }
      return (i == 0) ? errorTxt : i.toString();
   }
   /**
    * 验证物料编号是否存在
    * @param did
    * @return