| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import com.slcf.pojo.*; |
| | | import org.apache.log4j.Logger; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import com.slcf.erp.ErpBean; |
| | | import com.slcf.pojo.LocDetailBean; |
| | | import com.slcf.pojo.LocationBean; |
| | | import com.slcf.pojo.WaitCheckBean; |
| | | import com.slcf.pojo.WaitPakInBean; |
| | | import com.slcf.pojo.WaitPakOutBean; |
| | | import com.slcf.service.LocDetailService; |
| | | import com.slcf.service.LocationService; |
| | | import com.slcf.service.WaitCheckService; |
| | |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value="/waitPakOut.action",method={ RequestMethod.GET, RequestMethod.POST }) |
| | | public JSONObject getWaitPakOut(@RequestBody String requestBody,HttpServletRequest request){ |
| | | public synchronized JSONObject getWaitPakOut(@RequestBody String requestBody,HttpServletRequest request){ |
| | | JSONObject map = new JSONObject(); |
| | | logger.error("SAP Retrieve Interface Data22-----" + requestBody); |
| | | String lgnum="0"; |
| | |
| | | arrRet.add(jsonRet); |
| | | logger.error("SAP Retrieve Interface Error-----下架指令接收失败" + sloc_no + "库存数量小于下架数量--" + vsolm); |
| | | continue; |
| | | } |
| | | // (库存数量-出库通知档数量) < 下架数量 |
| | | List<WaitPakOutBean> waitPakOutBeanList = waitPakOutService.queryWaitOutPak(locDetailBean.getLoc_no(), locDetailBean.getMatnr()); |
| | | if (waitPakOutBeanList.size() > 0) { |
| | | Double realAnfme = new Double(locDetailBean.getAnfme() - waitPakOutBeanList.get(0).getVsolm()); |
| | | if (realAnfme < vsolm) { |
| | | jsonRet.put("lgnum", job.get("lgnum").toString()); |
| | | jsonRet.put("tanum", job.get("tanum").toString().equals("")?0:Integer.parseInt(job.get("tanum").toString())); |
| | | jsonRet.put("tapos", job.get("tapos").toString().equals("")?0:Integer.parseInt(job.get("tapos").toString())); |
| | | jsonRet.put("zstatus", "E"); |
| | | jsonRet.put("message", "下架指令接收失败," + sloc_no + "库存数量小于下架数量--" + vsolm); |
| | | arrRet.add(jsonRet); |
| | | logger.error("SAP Retrieve Interface Error-----下架指令接收失败" + sloc_no + "库存数量小于下架数量--" + vsolm); |
| | | continue; |
| | | } |
| | | } |
| | | String nltyp=job.get("vlpla").toString(); |
| | | String dloc_no=job.get("nlpla").toString(); |
| | |
| | | |
| | | String loc_no=job.get("lgpla").toString(); |
| | | LocationBean locBean = locationService.queryLocationById(loc_no); |
| | | if(locBean==null || !locBean.getLoc_sts().equals("F")) { |
| | | WaitCheckBean waitCheckBean = waitCheckService.getWaitCheckByLoc(loc_no); |
| | | if(locBean==null || (!locBean.getLoc_sts().equals("F") && null == waitCheckBean)) { |
| | | jsonRet.put("lgnum", job.get("lgnum").toString()); |
| | | jsonRet.put("ivnum", job.get("ivnum").toString()); |
| | | jsonRet.put("ivpos", job.get("ivpos").toString()); |
| | |
| | | waitCheck.setLgtyp(job.get("lgtyp").toString()); |
| | | waitCheck.setLgpla(job.get("lgpla").toString()); |
| | | |
| | | int result = waitCheckService.insertWaitCheck(waitCheck); |
| | | // if(null == waitCheckBean) { |
| | | int result = waitCheckService.insertWaitCheck(waitCheck); |
| | | // } |
| | | |
| | | jsonRet.put("lgnum", job.get("lgnum").toString()); |
| | | jsonRet.put("ivnum", job.get("ivnum").toString()); |