|
@@ -1,8 +1,10 @@
|
|
package com.dgtly.order.controller;
|
|
package com.dgtly.order.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.dgtly.common.core.domain.AjaxResult;
|
|
import com.dgtly.common.exception.base.BaseException;
|
|
import com.dgtly.common.exception.base.BaseException;
|
|
import com.dgtly.common.utils.MapDataUtil;
|
|
import com.dgtly.common.utils.MapDataUtil;
|
|
|
|
+import com.dgtly.common.utils.poi.ExcelUtil;
|
|
import com.dgtly.order.domain.MetaHanaSalesOrder;
|
|
import com.dgtly.order.domain.MetaHanaSalesOrder;
|
|
import com.dgtly.order.domain.OrderDetailModel;
|
|
import com.dgtly.order.domain.OrderDetailModel;
|
|
import com.dgtly.order.service.IMetaHanaSalesOrderService;
|
|
import com.dgtly.order.service.IMetaHanaSalesOrderService;
|
|
@@ -92,6 +94,48 @@ public class OrderBaseController extends BaseController {
|
|
|
|
|
|
return prefix + "/edit";
|
|
return prefix + "/edit";
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @RequiresPermissions("order:orderbase:export")
|
|
|
|
+ @PostMapping("/export")
|
|
|
|
+ @ResponseBody
|
|
|
|
+ public AjaxResult export(MetaHanaSalesOrder order)
|
|
|
|
+ {
|
|
|
|
+ List<MetaHanaSalesOrder> list = metaHanaSalesOrderService.selectDistinctMetaHanaSalesOrder(order);
|
|
|
|
+ if(list.size() >= 10000){
|
|
|
|
+ return new AjaxResult(301,"数据大于 10000 条Excel将无法打开,请过滤查询条件");
|
|
|
|
+ }
|
|
|
|
+ ExcelUtil<MetaHanaSalesOrder> util = new ExcelUtil<MetaHanaSalesOrder>(MetaHanaSalesOrder.class);
|
|
|
|
+ return util.exportExcel(list, "订单数据");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 批量刷新确认期望到货时间
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @RequiresPermissions("order:orderbase:refreshArrivalTime")
|
|
|
|
+ @GetMapping("/refreshArrivalTime")
|
|
|
|
+ @ResponseBody
|
|
|
|
+ public AjaxResult refreshArrivalTime()
|
|
|
|
+ {
|
|
|
|
+ AjaxResult rest = new AjaxResult();
|
|
|
|
+ String url = cloudPath + "order"+"/order/meta-hana-sales-order/dealHistoryData";
|
|
|
|
+ String str= "";
|
|
|
|
+ try{
|
|
|
|
+ str = restTemplate.getForObject(url, String.class);
|
|
|
|
+ JSONObject json = JSONObject.parseObject(str);
|
|
|
|
+ if(json.getInteger("code")==200){
|
|
|
|
+ rest.setCode(0);
|
|
|
|
+ rest.setMsg("刷新成功");
|
|
|
|
+ } else {
|
|
|
|
+ rest.setCode(-1);
|
|
|
|
+ rest.setMsg("刷新失败");
|
|
|
|
+ }
|
|
|
|
+ }catch(Exception e){
|
|
|
|
+ logger.error("批量刷新确认期望到货时间"+url,e);
|
|
|
|
+ throw e;
|
|
|
|
+ }
|
|
|
|
+ return rest;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|