|
@@ -1,13 +1,17 @@
|
|
package com.dgtly.order.controller;
|
|
package com.dgtly.order.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.dgtly.common.annotation.Log;
|
|
import com.dgtly.common.core.domain.AjaxResult;
|
|
import com.dgtly.common.core.domain.AjaxResult;
|
|
|
|
+import com.dgtly.common.enums.BusinessType;
|
|
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.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;
|
|
|
|
+import com.dgtly.system.domain.SysBatchSignInfo;
|
|
|
|
+import com.dgtly.system.service.ISysBatchSignForService;
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -24,6 +28,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import com.dgtly.common.core.controller.BaseController;
|
|
import com.dgtly.common.core.controller.BaseController;
|
|
import org.springframework.web.client.RestTemplate;
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -48,6 +53,8 @@ public class OrderBaseController extends BaseController {
|
|
|
|
|
|
@Value(value = "${ruoyi.cloudPath}")
|
|
@Value(value = "${ruoyi.cloudPath}")
|
|
private String cloudPath;
|
|
private String cloudPath;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ISysBatchSignForService sysBatchSignForService;
|
|
|
|
|
|
|
|
|
|
@RequiresPermissions("order:orderbase:view")
|
|
@RequiresPermissions("order:orderbase:view")
|
|
@@ -64,7 +71,7 @@ public class OrderBaseController extends BaseController {
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public Object list(MetaHanaSalesOrder order) {
|
|
public Object list(MetaHanaSalesOrder order) {
|
|
startPage();
|
|
startPage();
|
|
- List<MetaHanaSalesOrder> list= metaHanaSalesOrderService.selectDistinctMetaHanaSalesOrder(order);
|
|
|
|
|
|
+ List<MetaHanaSalesOrder> list = metaHanaSalesOrderService.selectDistinctMetaHanaSalesOrder(order);
|
|
|
|
|
|
return getDataTable(list);
|
|
return getDataTable(list);
|
|
}
|
|
}
|
|
@@ -75,20 +82,20 @@ public class OrderBaseController extends BaseController {
|
|
*/
|
|
*/
|
|
@GetMapping("/edit/{id}")
|
|
@GetMapping("/edit/{id}")
|
|
public String edit(@PathVariable("id") String id, ModelMap mmap) {
|
|
public String edit(@PathVariable("id") String id, ModelMap mmap) {
|
|
- String url = cloudPath + "order"+"/order/meta-hana-sales-order/orderLineDetail?orderNumber=" + id;
|
|
|
|
|
|
+ String url = cloudPath + "order" + "/order/meta-hana-sales-order/orderLineDetail?orderNumber=" + id;
|
|
//String url = "http://10.32.2.212:8000/" + "order"+"/order/meta-hana-sales-order/orderLineDetail?orderNumber=" + id;
|
|
//String url = "http://10.32.2.212:8000/" + "order"+"/order/meta-hana-sales-order/orderLineDetail?orderNumber=" + id;
|
|
- String str= "";
|
|
|
|
- try{
|
|
|
|
|
|
+ String str = "";
|
|
|
|
+ try {
|
|
str = restTemplate.getForObject(url, String.class);
|
|
str = restTemplate.getForObject(url, String.class);
|
|
JSONObject json = JSONObject.parseObject(str);
|
|
JSONObject json = JSONObject.parseObject(str);
|
|
- if(json.getInteger("code")==200){
|
|
|
|
- OrderDetailModel order = json.getObject("data",OrderDetailModel.class);
|
|
|
|
- mmap.put("orderBase",order);
|
|
|
|
- }else{
|
|
|
|
- throw new BaseException("order",json.getString("message"));
|
|
|
|
|
|
+ if (json.getInteger("code") == 200) {
|
|
|
|
+ OrderDetailModel order = json.getObject("data", OrderDetailModel.class);
|
|
|
|
+ mmap.put("orderBase", order);
|
|
|
|
+ } else {
|
|
|
|
+ throw new BaseException("order", json.getString("message"));
|
|
}
|
|
}
|
|
- }catch(Exception e){
|
|
|
|
- logger.error("查询基础订单详情报错"+url,e);
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ logger.error("查询基础订单详情报错" + url, e);
|
|
throw e;
|
|
throw e;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -98,11 +105,10 @@ public class OrderBaseController extends BaseController {
|
|
@RequiresPermissions("order:orderbase:export")
|
|
@RequiresPermissions("order:orderbase:export")
|
|
@PostMapping("/export")
|
|
@PostMapping("/export")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
- public AjaxResult export(MetaHanaSalesOrder order)
|
|
|
|
- {
|
|
|
|
|
|
+ public AjaxResult export(MetaHanaSalesOrder order) {
|
|
List<MetaHanaSalesOrder> list = metaHanaSalesOrderService.selectDistinctMetaHanaSalesOrder(order);
|
|
List<MetaHanaSalesOrder> list = metaHanaSalesOrderService.selectDistinctMetaHanaSalesOrder(order);
|
|
- if(list.size() >= 10000){
|
|
|
|
- return new AjaxResult(301,"数据大于 10000 条Excel将无法打开,请过滤查询条件");
|
|
|
|
|
|
+ if (list.size() >= 10000) {
|
|
|
|
+ return new AjaxResult(301, "数据大于 10000 条Excel将无法打开,请过滤查询条件");
|
|
}
|
|
}
|
|
ExcelUtil<MetaHanaSalesOrder> util = new ExcelUtil<MetaHanaSalesOrder>(MetaHanaSalesOrder.class);
|
|
ExcelUtil<MetaHanaSalesOrder> util = new ExcelUtil<MetaHanaSalesOrder>(MetaHanaSalesOrder.class);
|
|
return util.exportExcel(list, "订单数据");
|
|
return util.exportExcel(list, "订单数据");
|
|
@@ -110,32 +116,53 @@ public class OrderBaseController extends BaseController {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 批量刷新确认期望到货时间
|
|
* 批量刷新确认期望到货时间
|
|
|
|
+ *
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@RequiresPermissions("order:orderbase:refreshArrivalTime")
|
|
@RequiresPermissions("order:orderbase:refreshArrivalTime")
|
|
@GetMapping("/refreshArrivalTime")
|
|
@GetMapping("/refreshArrivalTime")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
- public AjaxResult refreshArrivalTime()
|
|
|
|
- {
|
|
|
|
|
|
+ public AjaxResult refreshArrivalTime() {
|
|
AjaxResult rest = new AjaxResult();
|
|
AjaxResult rest = new AjaxResult();
|
|
- String url = cloudPath + "order"+"/order/meta-hana-sales-order/dealHistoryData";
|
|
|
|
- String str= "";
|
|
|
|
- try{
|
|
|
|
|
|
+ String url = cloudPath + "order" + "/order/meta-hana-sales-order/dealHistoryData";
|
|
|
|
+ String str = "";
|
|
|
|
+ try {
|
|
str = restTemplate.getForObject(url, String.class);
|
|
str = restTemplate.getForObject(url, String.class);
|
|
JSONObject json = JSONObject.parseObject(str);
|
|
JSONObject json = JSONObject.parseObject(str);
|
|
- if(json.getInteger("code")==200){
|
|
|
|
|
|
+ if (json.getInteger("code") == 200) {
|
|
rest.setCode(0);
|
|
rest.setCode(0);
|
|
rest.setMsg("刷新成功");
|
|
rest.setMsg("刷新成功");
|
|
} else {
|
|
} else {
|
|
rest.setCode(-1);
|
|
rest.setCode(-1);
|
|
rest.setMsg("刷新失败");
|
|
rest.setMsg("刷新失败");
|
|
}
|
|
}
|
|
- }catch(Exception e){
|
|
|
|
- logger.error("批量刷新确认期望到货时间"+url,e);
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ logger.error("批量刷新确认期望到货时间" + url, e);
|
|
throw e;
|
|
throw e;
|
|
}
|
|
}
|
|
return rest;
|
|
return rest;
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 批量导入
|
|
|
|
+ */
|
|
|
|
+ @Log(title = "批量签收", businessType = BusinessType.IMPORT)
|
|
|
|
+ @PostMapping("/importData")
|
|
|
|
+ @ResponseBody
|
|
|
|
+ public AjaxResult importData(MultipartFile file) throws Exception {
|
|
|
|
+ ExcelUtil<SysBatchSignInfo> util = new ExcelUtil<>(SysBatchSignInfo.class);
|
|
|
|
+ List<SysBatchSignInfo> list = util.importExcel(file.getInputStream());
|
|
|
|
+ if (list != null && list.size() > 0) {
|
|
|
|
+ int num = sysBatchSignForService.updateData(list);
|
|
|
|
+ if (num == 1) {
|
|
|
|
+ return AjaxResult.success("导入成功");
|
|
|
|
+ } else {
|
|
|
|
+ return AjaxResult.error("导入失败");
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ return AjaxResult.success("Excel没有数据");
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|