diff --git a/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java b/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java index edc0b5f0..13a52857 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java @@ -1111,7 +1111,7 @@ public class IoCodeTempController extends BaseController { } } if (codeTempEntity.getMyCount() <= 0) { - return ResultVOUtils.error(500, "数量不能小于0"); + return ResultVOUtils.error(500, "数量需要大于0"); } codeTempEntity.setReCount(codeTempEntity.getMyCount() * udiCalCountUtil.getActCount(codeTempEntity.getNameCode())); int b = codeTempService.updateById(codeTempEntity); diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderController.java index 500d45cd..8559a64e 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderController.java @@ -40,6 +40,7 @@ import javax.annotation.Resource; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; +import java.util.Date; import java.util.List; @@ -137,15 +138,15 @@ public class IoOrderController extends BaseController { List list = orderService.getfilterList(filterOrderRequest); for (IoOrderResponse ioOrderResponse : list) { - if(ioOrderResponse.getCheckStatus() == null){ - ioOrderResponse.setCheckStatus(0+""); + if (ioOrderResponse.getCheckStatus() == null) { + ioOrderResponse.setCheckStatus(0 + ""); } FilterOrderDetailCodeRequest filterOrderDetailCodeRequest = new FilterOrderDetailCodeRequest(); filterOrderDetailCodeRequest.setOrderIdFk(ioOrderResponse.getBillNo()); List ioOrderDetailCodeResponses = orderDetailBizService.getfilterList(filterOrderDetailCodeRequest); - BigDecimal amount=new BigDecimal(0.00); + BigDecimal amount = new BigDecimal(0.00); for (IoOrderDetailCodeResponse ioOrderDetailCodeRespons : ioOrderDetailCodeResponses) { - if(ioOrderDetailCodeRespons.getCount() != 0 && ioOrderDetailCodeRespons.getPrice()!=null) { + if (ioOrderDetailCodeRespons.getCount() != 0 && ioOrderDetailCodeRespons.getPrice() != null) { amount = amount.add(new BigDecimal(ioOrderDetailCodeRespons.getCount()).multiply(ioOrderDetailCodeRespons.getPrice())); } } @@ -632,6 +633,7 @@ public class IoOrderController extends BaseController { @PostMapping("/udiwms/inout/order/updateOrder") @Log(title = "单据管理", businessType = BusinessType.UPDATE) public BaseResponse updateOrder(@RequestBody IoOrderEntity ioOrderEntity) { + ioOrderEntity.setUpdateTime(new Date()); orderService.updateByBillNo(ioOrderEntity); return ResultVOUtils.success(); } diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java index 9eca7837..e253e8c2 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java @@ -603,7 +603,7 @@ public class IoOrderDetailBizController extends BaseController { @PostMapping("/udiwms/inout/biz/insertInvoice") @Log(title = "发票管理", businessType = BusinessType.INSERT) public BaseResponse insertInvoice(@RequestBody IoOrderInvoiceEntity ioOrderInvoice) { - + String billNo = null; for (IoOrderDetailBizEntity ioOrderDetailBizEntity : ioOrderInvoice.getList()) { IoOrderInvoiceEntity ioOrderInvoiceEntity = new IoOrderInvoiceEntity(); ioOrderInvoiceEntity.setOrderIdFk(ioOrderDetailBizEntity.getOrderIdFk()); @@ -623,17 +623,26 @@ public class IoOrderDetailBizController extends BaseController { ioOrderInvoiceEntity.setRemark(ioOrderInvoice.getRemark()); ioOrderInvoiceEntity.setLicenseUrl(ioOrderInvoice.getLicenseUrl()); boolean b = ioOrderInvoiceService.insertInvoice(ioOrderInvoiceEntity); + billNo = ioOrderDetailBizEntity.getOrderIdFk(); } + IoOrderEntity orderEntity = orderService.findByBillNo(billNo); + orderEntity.setUpdateTime(new Date()); + orderService.update(orderEntity); return ResultVOUtils.success("成功"); } @PostMapping("/udiwms/inout/biz/updateorderBiz") public BaseResponse updateorderBiz(@RequestBody List list) { + String billNo = null; for (IoOrderDetailCodeEntity ioOrderDetailBizEntity : list) { ioOrderDetailBizEntity.setRegStatus(true); orderDetailCodeService.updateOrderDetailBiz(ioOrderDetailBizEntity); + billNo = ioOrderDetailBizEntity.getOrderIdFk(); } + IoOrderEntity orderEntity = orderService.findByBillNo(billNo); + orderEntity.setUpdateTime(new Date()); + orderService.update(orderEntity); return ResultVOUtils.success("成功"); } diff --git a/src/main/java/com/glxp/api/controller/inv/InvPreProductController.java b/src/main/java/com/glxp/api/controller/inv/InvPreProductController.java index 034bfa12..b6e3d10d 100644 --- a/src/main/java/com/glxp/api/controller/inv/InvPreProductController.java +++ b/src/main/java/com/glxp/api/controller/inv/InvPreProductController.java @@ -94,6 +94,9 @@ public class InvPreProductController extends BaseController { */ @GetMapping("/spms/inv/pre/product/filterDetail") public BaseResponse filterInvPreProductDetail(FilterInvPreProductDetailRequest detailRequest) { + if(!"".equals(detailRequest.getOrderBy())){ + detailRequest.setOrderBy("updateTime"); + } List invPreProductDetailEntities = invPreProductDetailService.filterPreProductDetailList(detailRequest); PageInfo pageInfo = new PageInfo<>(invPreProductDetailEntities); diff --git a/src/main/java/com/glxp/api/controller/inv/InvPreinProductController.java b/src/main/java/com/glxp/api/controller/inv/InvPreinProductController.java index e0b713c4..e0b39c1f 100644 --- a/src/main/java/com/glxp/api/controller/inv/InvPreinProductController.java +++ b/src/main/java/com/glxp/api/controller/inv/InvPreinProductController.java @@ -89,6 +89,9 @@ public class InvPreinProductController extends BaseController { */ @GetMapping("/spms/inv/pre/in/product/filterDetail") public BaseResponse filterInvPreProductDetail(FilterInvPreProductDetailRequest detailRequest) { + if(!"".equals(detailRequest.getOrderBy())){ + detailRequest.setOrderBy("updateTime"); + } List invPreProductDetailEntities = invPreinProductDetailService.filterPreProductDetailList(detailRequest); PageInfo pageInfo = new PageInfo<>(invPreProductDetailEntities); diff --git a/src/main/java/com/glxp/api/controller/inv/InvProductController.java b/src/main/java/com/glxp/api/controller/inv/InvProductController.java index 6a71ee6f..178b31e8 100644 --- a/src/main/java/com/glxp/api/controller/inv/InvProductController.java +++ b/src/main/java/com/glxp/api/controller/inv/InvProductController.java @@ -129,6 +129,9 @@ public class InvProductController extends BaseController { */ @GetMapping("/spms/inv/product/filterDetail") public BaseResponse filterInvProductDetail(FilterInvProductDetailRequest filterInvProductDetailRequest) { + if(!"".equals(filterInvProductDetailRequest.getOrderBy())){ + filterInvProductDetailRequest.setOrderBy("updateTime"); + } List invProductDetailEntities = invProductDetailService.filterInvProductDetailList(filterInvProductDetailRequest); PageInfo pageInfo = new PageInfo<>(invProductDetailEntities); diff --git a/src/main/java/com/glxp/api/idc/service/IdcService.java b/src/main/java/com/glxp/api/idc/service/IdcService.java index 61c981d0..67ebe23a 100644 --- a/src/main/java/com/glxp/api/idc/service/IdcService.java +++ b/src/main/java/com/glxp/api/idc/service/IdcService.java @@ -38,5 +38,5 @@ public interface IdcService { void downloadFile(String fileName,HttpServletResponse response) ; BaseResponse onceSync(String tableName,boolean isUpload); - boolean signleDownloadFile(String syncIp, String fileFullName); + boolean signleDownloadFile(String syncIp, String fileName); } diff --git a/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java b/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java index 63f28029..887fe1b1 100644 --- a/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java +++ b/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java @@ -629,8 +629,8 @@ public class IdcServiceImpl implements IdcService { public void downloadFile(String fileName, HttpServletResponse response) { OutputStream os; String filePathSlash = filePath.substring(filePath.length() - 1).equals("/") ? "" : fileName.substring(0, 1).equals("/") ? "" : "/"; -// String sourceFileName = filePath +filePathSlash+imagePath +fileName; - String sourceFileName = fileName; + String sourceFileName = filePath +filePathSlash+imagePath +fileName; +// String sourceFileName = fileName; try { if (FileUtils.isFileExist(sourceFileName)) { byte[] bytes = FileUtils.readFileByBytes(sourceFileName); @@ -1163,129 +1163,129 @@ public class IdcServiceImpl implements IdcService { return success; } -// @Override -// public boolean signleDownloadFile(String syncIp, String fileName) { -// String filePathSlash = filePath.substring(filePath.length() - 1).equals("/") ? "" : "/"; -// if(!FileUtils.makeDirectory(filePath + filePathSlash + imagePath)) -// IDCUtils.createDirectory(filePath + filePathSlash + imagePath); -// OkHttpClient client = new OkHttpClient().newBuilder() -// .build(); -// ; -// MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded"); -// -// RequestBody body = RequestBody.create(mediaType, "fileName=" + fileName); -// -// Request request = new Request.Builder() -// .url(syncIp + "/spssync/common/downloadFile") -// .post(body) -// .addHeader("Content-Type", "application/x-www-form-urlencoded") -// .build(); -// int total=0; -// try { -// Response result = client.newCall(request).execute(); -// String msg = result!=null ? result.message().length()>200 ? result.message().substring(0,200) : result.message() : ""; -// -// if (result!=null&&result.isSuccessful()&&MediaType.parse("application/force-download").equals(result.body().contentType())) { -// try (InputStream inputStream = result.body().byteStream()) { -// -// -// -// FileOutputStream outputStream = new FileOutputStream(filePath + filePathSlash + imagePath+fileName); -// -// byte b[] = new byte[1024]; -// -// int len = 0; -// while ((len = inputStream.read(b)) != -1) { -// total += len; -// outputStream.write(b, 0, len); -// -// } -// -// outputStream.flush(); -// outputStream.close(); -// if(!(total>0)) { -// new File(filePath + filePathSlash + imagePath+fileName).delete(); -// executeSql("delete from idc_file where filePath='"+fileName+"'"); -// } -// -// } catch (Exception e) { -// -// -// } -// } -// if(!(total>0)) { -// String sql = "replace idc_file (filePath,createTime,msg) values ('"+fileName+"',now(),'"+msg+"')"; -// executeSql(sql); -// } -// -// } catch (IOException e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// } -// -// return (total>0); -// } -@Override -public boolean signleDownloadFile(String syncIp, String fileFullName) { - OkHttpClient client = new OkHttpClient().newBuilder() - .build(); - ; - MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded"); + @Override + public boolean signleDownloadFile(String syncIp, String fileName) { + String filePathSlash = filePath.substring(filePath.length() - 1).equals("/") ? "" : "/"; + if(!FileUtils.makeDirectory(filePath + filePathSlash + imagePath)) + IDCUtils.createDirectory(filePath + filePathSlash + imagePath); + OkHttpClient client = new OkHttpClient().newBuilder() + .build(); + ; + MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded"); - RequestBody body = RequestBody.create(mediaType, "fileName=" + fileFullName); + RequestBody body = RequestBody.create(mediaType, "fileName=" + fileName); - Request request = new Request.Builder() - .url(syncIp + "/spssync/common/downloadFile") - .post(body) - .addHeader("Content-Type", "application/x-www-form-urlencoded") - .build(); - int total = 0; - try { - Response result = client.newCall(request).execute(); - String msg = result!=null ? result.message().length()>200 ? result.message().substring(0,200) : result.message() : ""; + Request request = new Request.Builder() + .url(syncIp + "/spssync/common/downloadFile") + .post(body) + .addHeader("Content-Type", "application/x-www-form-urlencoded") + .build(); + int total=0; + try { + Response result = client.newCall(request).execute(); + String msg = result!=null ? result.message().length()>200 ? result.message().substring(0,200) : result.message() : ""; - if (result!=null&&result.isSuccessful()&&MediaType.parse("application/force-download").equals(result.body().contentType())) { - try (InputStream inputStream = result.body().byteStream()) { + if (result!=null&&result.isSuccessful()&&MediaType.parse("application/force-download").equals(result.body().contentType())) { + try (InputStream inputStream = result.body().byteStream()) { - String path = fileFullName.substring(0,fileFullName.lastIndexOf("/")); - if(!FileUtils.makeDirectory(path)) - IDCUtils.createDirectory(path); - FileOutputStream outputStream = new FileOutputStream(fileFullName); + FileOutputStream outputStream = new FileOutputStream(filePath + filePathSlash + imagePath+fileName); - byte b[] = new byte[1024]; + byte b[] = new byte[1024]; - int len = 0; - while ((len = inputStream.read(b)) != -1) { - total += len; - outputStream.write(b, 0, len); + int len = 0; + while ((len = inputStream.read(b)) != -1) { + total += len; + outputStream.write(b, 0, len); - } + } - outputStream.flush(); - outputStream.close(); - if(!(total>0)) { - new File(fileFullName).delete(); - executeSql("delete from idc_file where filePath='"+fileFullName+"'"); - } + outputStream.flush(); + outputStream.close(); + if(!(total>0)) { + new File(filePath + filePathSlash + imagePath+fileName).delete(); + executeSql("delete from idc_file where filePath='"+fileName+"'"); + } - } catch (Exception e) { + } catch (Exception e) { + } } - } - if(!(total>0)) { - String sql = "replace idc_file (filePath,createTime,msg) values ('"+fileFullName+"',now(),'"+msg+"')"; - executeSql(sql); + if(!(total>0)) { + String sql = "replace idc_file (filePath,createTime,msg) values ('"+fileName+"',now(),'"+msg+"')"; + executeSql(sql); + } + + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); } - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + return (total>0); } - return (total>0); -} +//@Override +//public boolean signleDownloadFile(String syncIp, String fileFullName) { +// OkHttpClient client = new OkHttpClient().newBuilder() +// .build(); +// ; +// MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded"); +// +// RequestBody body = RequestBody.create(mediaType, "fileName=" + fileFullName); +// +// Request request = new Request.Builder() +// .url(syncIp + "/spssync/common/downloadFile") +// .post(body) +// .addHeader("Content-Type", "application/x-www-form-urlencoded") +// .build(); +// int total = 0; +// try { +// Response result = client.newCall(request).execute(); +// String msg = result!=null ? result.message().length()>200 ? result.message().substring(0,200) : result.message() : ""; +// +// if (result!=null&&result.isSuccessful()&&MediaType.parse("application/force-download").equals(result.body().contentType())) { +// try (InputStream inputStream = result.body().byteStream()) { +// +// String path = fileFullName.substring(0,fileFullName.lastIndexOf("/")); +// if(!FileUtils.makeDirectory(path)) +// IDCUtils.createDirectory(path); +// +// +// FileOutputStream outputStream = new FileOutputStream(fileFullName); +// +// byte b[] = new byte[1024]; +// +// int len = 0; +// while ((len = inputStream.read(b)) != -1) { +// total += len; +// outputStream.write(b, 0, len); +// +// } +// +// outputStream.flush(); +// outputStream.close(); +// if(!(total>0)) { +// new File(fileFullName).delete(); +// executeSql("delete from idc_file where filePath='"+fileFullName+"'"); +// } +// +// } catch (Exception e) { +// +// +// } +// } +// if(!(total>0)) { +// String sql = "replace idc_file (filePath,createTime,msg) values ('"+fileFullName+"',now(),'"+msg+"')"; +// executeSql(sql); +// } +// +// } catch (IOException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// return (total>0); +//} /*获取转发服务地址,当前值允许单向,只使用参数upper_server_ip*/ private String getNextHost() { diff --git a/src/main/java/com/glxp/api/service/inv/impl/InvProductDetailServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/InvProductDetailServiceImpl.java index fe299fa0..96f13c11 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/InvProductDetailServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/InvProductDetailServiceImpl.java @@ -150,6 +150,7 @@ public class InvProductDetailServiceImpl implements InvProductDetailService { //设置单据类型名称 BasicBussinessTypeEntity busType = bussinessTypeDao.selectOne(new QueryWrapper().select("name").eq("action", response.getAction())); + if(busType!=null) response.setActionName(busType.getName()); //设置单据日期 IoOrderEntity order = orderDao.selectOne(new QueryWrapper().select("createTime").eq("billNo", response.getOrderId()));