|
@@ -24,11 +24,13 @@ import com.google.gson.GsonBuilder;
|
|
|
import org.apache.poi.ss.usermodel.*;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFFormulaEvaluator;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
+import org.jeecg.common.constant.CommonConstant;
|
|
|
import org.jeecg.common.exception.JeecgBootException;
|
|
|
import org.jeecg.common.system.api.ISysBaseAPI;
|
|
|
import org.jeecg.common.system.util.JwtUtil;
|
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
+import org.jeecg.common.util.RedisUtil;
|
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
|
import org.jeecg.modules.documents.orderData.entity.SyOrderData;
|
|
|
import org.jeecg.modules.documents.orderData.entity.SyOrderDataItem;
|
|
@@ -45,6 +47,8 @@ import org.jeecg.modules.splt.entity.SyPackingListTailoring;
|
|
|
import org.jeecg.modules.splt.entity.SyPackingListTailoringItem;
|
|
|
import org.jeecg.modules.splt.service.ISyPackingListTailoringService;
|
|
|
import org.jeecg.modules.system.controller.CommonController;
|
|
|
+import org.jeecg.modules.system.entity.SysUser;
|
|
|
+import org.jeecg.modules.system.mapper.SysUserMapper;
|
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
@@ -152,6 +156,9 @@ public class SyPackingListFabricController {
|
|
|
return result.OK(pageList);
|
|
|
}
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private RedisUtil redisUtil;//redisUtill
|
|
|
+
|
|
|
@AutoLog(value = "参照发运明细")
|
|
|
@ApiOperation(value="参照发运明细", notes="参照发运明细")
|
|
|
@GetMapping(value = "/getShippingDetails")
|
|
@@ -171,6 +178,7 @@ public class SyPackingListFabricController {
|
|
|
HttpServletRequest req) {
|
|
|
//只有成衣才能被选中,筛选为成衣的订单,需要加个条件
|
|
|
Result<IPage<SyShippingDetailsVo>> result = new Result<IPage<SyShippingDetailsVo>>();
|
|
|
+ String token = req.getHeader("X-Access-Token");//获取token
|
|
|
QueryWrapper<SyShippingDetailsVo> queryWrapper = new QueryWrapper<>();
|
|
|
if(oConvertUtils.isNotEmpty(documentNo)) {//单据号
|
|
|
queryWrapper.like("t.documentNo", documentNo);//单据号
|
|
@@ -246,7 +254,8 @@ public class SyPackingListFabricController {
|
|
|
@AutoLog(value = "装箱单-面辅料-添加")
|
|
|
@ApiOperation(value="装箱单-面辅料-添加", notes="装箱单-面辅料-添加")
|
|
|
@PostMapping(value = "/add")
|
|
|
- public Result<SyPackingListFabric> add(@RequestBody SyPackingListFabric syPackingListFabric) {
|
|
|
+ public Result<SyPackingListFabric> add(@RequestBody SyPackingListFabric syPackingListFabric,HttpServletRequest req) {
|
|
|
+ String token = req.getHeader("X-Access-Token");//获取token
|
|
|
Result<SyPackingListFabric> result=new Result<>();
|
|
|
if(oConvertUtils.isEmpty(syPackingListFabric)){
|
|
|
result.setSuccess(false);
|
|
@@ -254,7 +263,7 @@ public class SyPackingListFabricController {
|
|
|
result.setResult(null);
|
|
|
return result;
|
|
|
}
|
|
|
- syPackingListFabricService.saveMain(syPackingListFabric);
|
|
|
+ syPackingListFabricService.saveMain(syPackingListFabric,token);
|
|
|
result.setSuccess(true);
|
|
|
result.setMessage("添加成功");
|
|
|
result.setResult(syPackingListFabric);
|
|
@@ -499,13 +508,14 @@ public class SyPackingListFabricController {
|
|
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
|
|
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
|
|
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
|
|
+ String token = request.getHeader("X-Access-Token");//获取token
|
|
|
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()){
|
|
|
try {
|
|
|
MultipartFile file = entity.getValue();// 获取上传文件对象
|
|
|
InputStream inputStream=file.getInputStream();
|
|
|
Workbook workbook=new XSSFWorkbook(inputStream);
|
|
|
Map<String,SyPackingListFabric> maps=refreshSheet(workbook);
|
|
|
- boolean bool= syPackingListFabricService.excelAdd(maps);//循环
|
|
|
+ boolean bool= syPackingListFabricService.excelAdd(maps,token);//循环
|
|
|
if(bool==false){
|
|
|
return Result.error("文件导入失败");
|
|
|
}
|