| | |
| | | public synchronized R pakoutOrderCreate(@RequestHeader(required = false) String appkey, |
| | | @RequestBody OpenOrderPakoutParam param, |
| | | HttpServletRequest request) { |
| | | auth(appkey, param, request); |
| | | // auth(appkey, param, request); |
| | | if (Cools.isEmpty(param)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | |
| | | public synchronized R againOut(@RequestHeader(required = false) String appkey, |
| | | @RequestBody PackParam param, |
| | | HttpServletRequest request) { |
| | | auth(appkey, param, request); |
| | | // auth(appkey, param, request); |
| | | if (Cools.isEmpty(param)||Cools.isEmpty(param.getBarcode())) { |
| | | return R.error("托盘码为空,请检查"); |
| | | } |
| | |
| | | /** |
| | | * 轮询获取入库订单 |
| | | */ |
| | | @Scheduled(cron = "0/10 * * * * ? ") |
| | | private void execute() { |
| | | @Scheduled(cron = "0/30 * * * * ? ") |
| | | private synchronized void execute() { |
| | | // 获取当前日期时间 |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | |
| | |
| | | // 格式化日期时间 |
| | | String formattedDateTime = oneMonthAgo.format(formatter); |
| | | |
| | | HashMap<String ,Object> hashMap=new HashMap<>(); |
| | | |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("orgNo", 0);//组织编号 |
| | | |
| | | map.put("orgNo", "2");//组织编号 |
| | | // map.put("docNo",0); |
| | | map.put("startTime", formattedDateTime);//开始时间 |
| | | |
| | | String format = now.format(formatter); |
| | | map.put("endTime", format);//结束时间 |
| | | |
| | | hashMap.put("condition",map); |
| | | |
| | | //查询订单 |
| | | String response = ""; |
| | |
| | | response = new HttpHandler.Builder() |
| | | .setUri(URL) |
| | | .setPath(inaddress) |
| | | .setJson(JSON.toJSONString(map)) |
| | | .setJson(JSON.toJSONString(hashMap)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("status") == 200) { |
| | | JSONArray response1 = JSON.parseArray(jsonObject.get("response").toString()); |
| | | for (int j = 0; j < response1.size(); j++) { |
| | | OrderResult orderResult = response1.getObject(0, OrderResult.class); |
| | | OrderResult orderResult = response1.getObject(j, OrderResult.class); |
| | | Order order = orderService.selectByNo(orderResult.getDocNo());//单据编号 |
| | | if (Cools.isEmpty(order)) { |
| | | Date now1 = new Date(); |
| | |
| | | now1, // 修改时间 |
| | | null // 备注 |
| | | ); |
| | | if (!orderService.insert(order)) { |
| | | throw new CoolException("生成单据失败,请联系管理员"); |
| | | } |
| | | } |
| | | //物料编码 |
| | | Mat mat = matService.selectByMatnr(orderResult.getItemNo()); |
| | | if (Cools.isEmpty(mat)) { |
| | | throw new CoolException(orderResult.getItemNo() + "编号商品检索失败,请先添加商品"); |
| | | Mat mat1=new Mat(); |
| | | mat1.setTagId(1L); |
| | | mat1.setMatnr(orderResult.getItemNo()); |
| | | mat1.setMaktx(orderResult.getItemName()); |
| | | mat1.setSpecs(orderResult.getItemSpec()); |
| | | matService.insert(mat1); |
| | | // throw new CoolException(orderResult.getItemNo() + "编号商品检索失败,请先添加商品"); |
| | | } |
| | | OrderDetl orderDetl1 = orderDetlService.selectOne(new EntityWrapper<OrderDetl>() |
| | | .eq("order_no", orderResult.getDocNo()) |
| | | .eq("matnr", orderResult.getItemNo()) |
| | | .eq("batch", orderResult.getDocLotNo()));//批号 |
| | | if(Cools.isEmpty(orderResult.getDocLotNo())){ |
| | | orderDetl1 = orderDetlService.selectOne(new EntityWrapper<OrderDetl>() |
| | | .eq("order_no", orderResult.getDocNo()) |
| | | .eq("matnr", orderResult.getItemNo())); |
| | | } |
| | | |
| | | if (!Cools.isEmpty(orderDetl1)) { |
| | | continue; |
| | | } |
| | | DocType docType = docTypeService.selectById(orderResult.getDocType()); |
| | | OrderDetl orderDetl = new OrderDetl(); |
| | | orderDetl.sync(mat); |
| | | orderDetl.setMatnr(orderResult.getItemNo()); |
| | | orderDetl.setMaktx(orderResult.getItemName()); |
| | | orderDetl.setSpecs(orderResult.getItemSpec()); |
| | | orderDetl.setBatch(orderResult.getDocLotNo()); |
| | | orderDetl.setAnfme(orderResult.getApplyQty()); |
| | | orderDetl.setOrderId(order.getId()); |
| | |
| | | |
| | | @Value("${erp.address.URL}") |
| | | private String URL; |
| | | @Value("${erp.address.outaddress}") |
| | | private String outAddress; |
| | | @Value("${erp.address.outReportAddress}") |
| | | private String outReportAddress; |
| | | @Value("${erp.address.inReportAddress}") |
| | | private String inReportAddress; |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | @Autowired |
| | |
| | | * 单个任务上报erp |
| | | */ |
| | | @Scheduled(cron = "0/10 * * * * ? ") |
| | | private void execute() { |
| | | private synchronized void execute() { |
| | | //查找所有任务档任务状态为40ERP上报中的任务 |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wrk_sts", 40)); |
| | | |
| | |
| | | map.put("itemNo",orderDetl.getMatnr()); |
| | | map.put("qty",wrkDetl.getAnfme()); |
| | | map.put("unitNo",orderDetl.getUnit()); |
| | | map.put("warehouseNo",orderDetl.getColor()); |
| | | map.put("warehouseNo","02201"); |
| | | map.put("cellNo",orderDetl.getBrand()); |
| | | map.put("combinationLotNo",String.valueOf(orderDetl.getBatch())); |
| | | map.put("barcode",wrkDetl.getZpallet()); |
| | | map.put("barcode",wrkDetl.getMatnr()); |
| | | datas.add(map); |
| | | } |
| | | |
| | | String path= ""; |
| | | String work= ""; |
| | | if(wrkMast.getIoType()<100){ |
| | | path=inReportAddress; |
| | | work="入库"; |
| | | }else{ |
| | | path=outReportAddress; |
| | | work="出库"; |
| | | } |
| | | path=outReportAddress; |
| | | HashMap<String,Object> map=new HashMap<>(); |
| | | map.put("data",datas); |
| | | //上报ERP |
| | |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(URL) |
| | | .setPath(outAddress) |
| | | .setPath(path) |
| | | .setJson(JSON.toJSONString(map)) |
| | | .build() |
| | | .doPost(); |
| | |
| | | }else{ |
| | | wrkMast.setWrkSts(18L);//出库转历史档 |
| | | } |
| | | wrkMastService.updateById(wrkMast); |
| | | } else { |
| | | log.error("任务号={},上报失败",wrkMast.getWrkNo()); |
| | | } |
| | |
| | | try { |
| | | // 保存接口日志 |
| | | apiLogService.save( |
| | | "上报任务结果给ERP", |
| | | URL + outAddress, |
| | | "上报"+work+"任务结果给ERP", |
| | | URL + path, |
| | | null, |
| | | "127.0.0.1", |
| | | map.toString(), |
| | |
| | | server: |
| | | port: 8080 |
| | | port: 8082 |
| | | servlet: |
| | | context-path: /@pom.build.finalName@ |
| | | compression: |
| | |
| | | enabled: false |
| | | datasource: |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | url: jdbc:sqlserver://127.0.0.1:1433;databasename=bfasrs |
| | | url: jdbc:sqlserver://10.10.10.100:1433;databasename=bfasrs2 |
| | | # url: jdbc:sqlserver://192.168.4.15:1433;databasename=bfasrs |
| | | username: sa |
| | | # password: Zoneyung@zy56$ |
| | |
| | | erp: |
| | | #地址 |
| | | address: |
| | | URL: http://192.168.3.102:16001 |
| | | URL: http://192.168.118.36:18180 |
| | | #入库单据 |
| | | inaddress: K3CLOUD/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.ExecuteBillQuery.common.kdsvc |
| | | #结果上报(审核)单地址 |
| | | outaddress: K3CLOUD/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Audit.common.kdsvc |
| | | |
| | | inaddress: dapilc/restful/service/ilcwmsplus/IKWebService/cusInventoryTaskInfo |
| | | #出库结果上报 |
| | | outReportAddress: dapilc/restful/service/ilcwmsplus/IKWebService/cusOutboundCompletionReport |
| | | #入库结果上报 |
| | | inReportAddress: dapilc/restful/service/ilcwmsplus/IKWebService/cusInventoryCompletionReport |
| | |
| | | {field: 'matnr', align: 'center',title: '商品编号', sort:true, width: 200} |
| | | ,{field: 'specs', align: 'center',title: '规格', width: 200} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称', sort:true, width: 150} |
| | | ,{field: 'order_no', align: 'center',title: '单据编号', hide: false} |
| | | ,{field: 'orderNo', align: 'center',title: '单据编号', hide: false} |
| | | ,{field: 'batch', align: 'center',title: '批号', sort:true, hide: false} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码'} |