|  |  |  | 
|---|
|  |  |  | import javax.servlet.http.HttpServletRequest; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.slcf.pojo.*; | 
|---|
|  |  |  | import com.slcf.service.*; | 
|---|
|  |  |  | 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.service.LocDetailService; | 
|---|
|  |  |  | import com.slcf.service.LocationService; | 
|---|
|  |  |  | import com.slcf.service.WaitCheckService; | 
|---|
|  |  |  | import com.slcf.service.WaitPakInService; | 
|---|
|  |  |  | import com.slcf.service.WaitPakOutService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import net.sf.json.JSONArray; | 
|---|
|  |  |  | import net.sf.json.JSONObject; | 
|---|
|  |  |  | 
|---|
|  |  |  | LocationService locationService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | LocDetailService locDetailService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | MatCodeService matCodeService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | WorkFileService workFileService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Logger logger=Logger.getLogger(AsrsController.class); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 库位信息返回接口 | 
|---|
|  |  |  | * @param requestBody | 
|---|
|  |  |  | * @param request | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ResponseBody | 
|---|
|  |  |  | @RequestMapping(value="/queryWrkDetl.action",method={ RequestMethod.GET, RequestMethod.POST }) | 
|---|
|  |  |  | public JSONObject queryWrkDetl(@RequestBody String requestBody,HttpServletRequest request){ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | JSONObject map = new JSONObject(); | 
|---|
|  |  |  | logger.info("工作明细返回接口调用:" + requestBody); | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | JSONArray result = new JSONArray(); | 
|---|
|  |  |  | JSONObject json = JSONObject.fromObject(requestBody); | 
|---|
|  |  |  | String zpallet = json.get("zpallet").toString(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<WorkDetailBean> detls = workFileService.getWorkDetlList(zpallet); | 
|---|
|  |  |  | for (WorkDetailBean detl : detls) { | 
|---|
|  |  |  | WaitPakOutBean wrapper = new WaitPakOutBean(); | 
|---|
|  |  |  | wrapper.setLgnum(detl.getLgnum()); | 
|---|
|  |  |  | wrapper.setTanum(detl.getTbnum()); | 
|---|
|  |  |  | wrapper.setTapos(detl.getTbpos()); | 
|---|
|  |  |  | WaitPakOutBean waitPakout = waitPakOutService.queryWaitPakOutByNum(wrapper); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | JSONObject detlJSON = new JSONObject(); | 
|---|
|  |  |  | detlJSON.put("LGNUM", detl.getLgnum()); | 
|---|
|  |  |  | detlJSON.put("TANUM", detl.getTbnum()); | 
|---|
|  |  |  | detlJSON.put("BDATU", detl.getModi_time()); | 
|---|
|  |  |  | detlJSON.put("BZEIT", detl.getModi_time()); | 
|---|
|  |  |  | detlJSON.put("TRART", ""); | 
|---|
|  |  |  | detlJSON.put("TAPOS", detl.getTbpos()); | 
|---|
|  |  |  | detlJSON.put("MATNR", detl.getMatnr()); | 
|---|
|  |  |  | detlJSON.put("MAKTX", detl.getMaktx()); | 
|---|
|  |  |  | detlJSON.put("WERKS", detl.getWerks()); | 
|---|
|  |  |  | detlJSON.put("LGORT", ""); | 
|---|
|  |  |  | detlJSON.put("MEINS", detl.getAltme()); | 
|---|
|  |  |  | detlJSON.put("VLTYP", waitPakout == null ? "" : waitPakout.getVltyp().toString()); | 
|---|
|  |  |  | detlJSON.put("NLTYP", waitPakout == null ? "" : waitPakout.getNltyp()); | 
|---|
|  |  |  | detlJSON.put("NLBER", ""); | 
|---|
|  |  |  | detlJSON.put("NLPLA", waitPakout == null ? "" : waitPakout.getNlpla()); | 
|---|
|  |  |  | detlJSON.put("VSOLM", detl.getAnfme()); | 
|---|
|  |  |  | detlJSON.put("BNAME", detl.getBname().toString()); | 
|---|
|  |  |  | result.add(detlJSON); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (result.size() == 0){ | 
|---|
|  |  |  | map.put("item", result); | 
|---|
|  |  |  | map.put("zstatus", "E"); | 
|---|
|  |  |  | map.put("message", "查询不到该托盘码的工作明细"); | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | map.put("item", result); | 
|---|
|  |  |  | map.put("zstatus", "S"); | 
|---|
|  |  |  | map.put("message", "返回明细信息成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | map.put("item", ""); | 
|---|
|  |  |  | map.put("zstatus", "E"); | 
|---|
|  |  |  | map.put("message", "返回明细信息失败" + e.getMessage()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return map; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 入库完成,调用sap接口上传完成信息 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public static void sendPakInStatus(String httpUrl) { | 
|---|