片仔癀UDI货位卡,条码追溯,剥离erp获取

master
anthonywj 4 years ago
parent 7ebc1b6e11
commit b5f2d41e6d

@ -1,15 +1,22 @@
package com.glxp.api.admin.constant;
public class UdiInfoImportStatus {
/**
*
*/
public class BasicProcessStatus {
public static final int UDIINFO_IMPORT_UNPROCESS = 0;
public static final int UDIINFO_IMPORT_PROCESS = 1;
public static final int UDIINFO_IMPORT_FAIL = 2;
public static final int UDIINFO_IMPORT_SUCCESS = 3;
public static final int UDIINFO_IMPORT_CODE_UNPROCESS = 0;
public static final int UDIINFO_IMPORT_CODE_SUCESS = 2;
public static final int UDIINFO_IMPORT_CODE_FAIL = 1;
public static final int EXPORT_EXCEL = 1;
public static final int EXPORT_SMP = 2;
}

@ -1,5 +1,8 @@
package com.glxp.api.admin.constant;
/**
*
*/
public class ConstantStatus {
//订单状态

@ -1,5 +1,8 @@
package com.glxp.api.admin.constant;
/**
*
*/
public class IncodeStatus {
public static final Integer PROCESS = 0; //处理中

@ -1,27 +1,19 @@
package com.glxp.api.admin.controller.basic;
import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.constant.UdiInfoImportStatus;
import com.glxp.api.admin.constant.BasicProcessStatus;
import com.glxp.api.admin.entity.basic.BasicUnitMaintainEntity;
import com.glxp.api.admin.entity.basic.CorpExportLogEntity;
import com.glxp.api.admin.entity.basic.UdiInfoExportLogEntity;
import com.glxp.api.admin.entity.info.SystemParamConfigEntity;
import com.glxp.api.admin.req.basic.*;
import com.glxp.api.admin.req.inout.DeleteRequest;
import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.res.basic.UdiRelevanceResponse;
import com.glxp.api.admin.service.basic.BasicUnitMaintainService;
import com.glxp.api.admin.service.basic.CorpExportLogService;
import com.glxp.api.admin.service.basic.UdiInfoExportLogService;
import com.glxp.api.admin.service.basic.UdiRelevanceService;
import com.glxp.api.admin.thread.BasicGenExcelService;
import com.glxp.api.admin.util.CustomUtil;
import com.glxp.api.admin.util.ExcelUtil;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -32,7 +24,6 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.*;
@ -114,12 +105,28 @@ public class CorpExportLogController {
public BaseResponse excelDownload(@RequestBody CorpsExportRequest corpsExportRequest) {
String fileName = "D:\\udiwms\\exportFile\\" + "往来单位信息导出" + System.currentTimeMillis() + ".xls";
CorpExportLogEntity corpExportLogEntity = new CorpExportLogEntity();
corpExportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_PROCESS);
corpExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_PROCESS);
String genKey = CustomUtil.getId();
corpExportLogEntity.setGenKey(genKey);
corpExportLogEntity.setFilePath(fileName);
corpExportLogEntity.setUpdateTime(new Date());
corpExportLogEntity.setDlCount(0);
corpExportLogEntity.setType(BasicProcessStatus.EXPORT_EXCEL);
corpExportLogService.insertCorpExportLog(corpExportLogEntity);
basicGenExcelService.exportCorp(genKey, corpsExportRequest);
return ResultVOUtils.success("后台正在导出生成excel文件请稍后刷新查看!");
}
//往来单位上传SMP并创建生成记录
@PostMapping("/udiwms/corps/importLog/uploadSmp")
public BaseResponse uploadSmp(@RequestBody CorpsExportRequest corpsExportRequest) {
CorpExportLogEntity corpExportLogEntity = new CorpExportLogEntity();
corpExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_PROCESS);
String genKey = CustomUtil.getId();
corpExportLogEntity.setGenKey(genKey);
corpExportLogEntity.setUpdateTime(new Date());
corpExportLogEntity.setDlCount(0);
corpExportLogEntity.setType(BasicProcessStatus.EXPORT_SMP);
corpExportLogService.insertCorpExportLog(corpExportLogEntity);
basicGenExcelService.exportCorp(genKey, corpsExportRequest);
return ResultVOUtils.success("后台正在导出生成excel文件请稍后刷新查看!");

@ -1,15 +1,12 @@
package com.glxp.api.admin.controller.basic;
import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.constant.UdiInfoImportStatus;
import com.glxp.api.admin.constant.BasicProcessStatus;
import com.glxp.api.admin.entity.basic.BasicThirdSysEntity;
import com.glxp.api.admin.entity.basic.CorpImportDetailEntity;
import com.glxp.api.admin.entity.basic.CorpImportLogEntity;
import com.glxp.api.admin.entity.basic.UdiInfoImportDetailEntity;
import com.glxp.api.admin.entity.info.ThirdSysApiEntity;
import com.glxp.api.admin.req.basic.FilterUdiIpLogRequest;
import com.glxp.api.admin.req.basic.PostCorpsRequest;
import com.glxp.api.admin.req.basic.PostUdiInfoRequest;
import com.glxp.api.admin.req.inout.DeleteRequest;
import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.service.basic.BasicThirdSysService;
@ -147,7 +144,7 @@ public class CorpImportLogController {
String genKey = CustomUtil.getId();
corpImportLogEntity.setGenKey(genKey);
corpImportLogEntity.setFromType("文件导入");
corpImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_UNPROCESS);
corpImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS);
corpImportLogEntity.setUpdateTime(new Date(System.currentTimeMillis()));
corpImportLogService.insertImportLog(corpImportLogEntity);
List<CorpImportDetailEntity> corpImportDetailEntities = new ArrayList<>();
@ -300,13 +297,13 @@ public class CorpImportLogController {
corpImportDetailEntity.setGenKeyFk(genKey);
corpImportDetailEntity.setImportStatus(UdiInfoImportStatus.UDIINFO_IMPORT_CODE_UNPROCESS);
corpImportDetailEntity.setImportStatus(BasicProcessStatus.UDIINFO_IMPORT_CODE_UNPROCESS);
corpImportDetailEntity.setUpdateTime(new Date(System.currentTimeMillis()));
corpImportDetailEntities.add(corpImportDetailEntity);
}
}
corpImportDetailService.insertCorpImports(corpImportDetailEntities);
corpImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_UNPROCESS);
corpImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS);
corpImportLogService.updateImportLog(corpImportLogEntity);
workbook.close();
basicCorpImportService.importCorps(genKey);
@ -319,7 +316,7 @@ public class CorpImportLogController {
//往来单位信息接口上传
@PostMapping("/udiwms/corps/importLog/post")
@PostMapping("/udiwms/basic/corps/upload")
public BaseResponse postUdiInfo(@RequestBody PostCorpsRequest postCorpsRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
@ -335,7 +332,7 @@ public class CorpImportLogController {
if (corpImportDetailEntities != null) {
for (CorpImportDetailEntity corpImportDetailEntity : corpImportDetailEntities) {
corpImportDetailEntity.setGenKeyFk(genKey);
corpImportDetailEntity.setImportStatus(UdiInfoImportStatus.UDIINFO_IMPORT_CODE_UNPROCESS);
corpImportDetailEntity.setImportStatus(BasicProcessStatus.UDIINFO_IMPORT_CODE_UNPROCESS);
corpImportDetailEntity.setUpdateTime(new java.util.Date());
corpImportDetailService.insertCorpImport(corpImportDetailEntity);
}
@ -344,11 +341,11 @@ public class CorpImportLogController {
corpImportLogEntity = new CorpImportLogEntity();
corpImportLogEntity.setGenKey(genKey);
corpImportLogEntity.setFromType("接口上传");
corpImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_UNPROCESS);
corpImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS);
corpImportLogEntity.setUpdateTime(new Date(System.currentTimeMillis()));
corpImportLogService.insertImportLog(corpImportLogEntity);
} else {
corpImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_UNPROCESS);
corpImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS);
corpImportLogService.updateImportLog(corpImportLogEntity);
}
basicCorpImportService.importCorps(genKey);

@ -1,7 +1,7 @@
package com.glxp.api.admin.controller.basic;
import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.constant.UdiInfoImportStatus;
import com.glxp.api.admin.constant.BasicProcessStatus;
import com.glxp.api.admin.entity.basic.UdiInfoExportLogEntity;
import com.glxp.api.admin.req.basic.FilterUdiEpLogRequest;
import com.glxp.api.admin.req.basic.FilterUdiInfoRequest;
@ -13,11 +13,9 @@ import com.glxp.api.admin.service.basic.UdiInfoExportLogService;
import com.glxp.api.admin.service.basic.UdiRelevanceService;
import com.glxp.api.admin.thread.BasicGenExcelService;
import com.glxp.api.admin.util.CustomUtil;
import com.glxp.api.admin.util.ExcelUtil;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -28,9 +26,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -118,18 +114,37 @@ public class UdiInfoExportLogController {
String fileName = "D:\\udiwms\\exportFile\\" + "产品信息导出" + System.currentTimeMillis() + ".xls";
UdiInfoExportLogEntity udiInfoExportLogEntity = new UdiInfoExportLogEntity();
udiInfoExportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_PROCESS);
udiInfoExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_PROCESS);
String genKey = CustomUtil.getId();
udiInfoExportLogEntity.setGenKey(genKey);
udiInfoExportLogEntity.setFilePath(fileName);
udiInfoExportLogEntity.setUpdateTime(new Date());
udiInfoExportLogEntity.setDlCount(0);
udiInfoExportLogEntity.setType(BasicProcessStatus.EXPORT_EXCEL);
udiInfoExportLogService.insertUdiInfoExportLog(udiInfoExportLogEntity);
basicGenExcelService.exportUdiInfo(genKey, udiInfoExportRequest);
return ResultVOUtils.success("后台正在导出生成excel文件请稍后刷新查看!");
}
//产品信息导出生成Excel并创建生成记录
@PostMapping("/udiwms/products/importLog/uploadSmp")
public BaseResponse uploadSmp(@RequestBody UdiInfoExportRequest udiInfoExportRequest) {
UdiInfoExportLogEntity udiInfoExportLogEntity = new UdiInfoExportLogEntity();
udiInfoExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_PROCESS);
String genKey = CustomUtil.getId();
udiInfoExportLogEntity.setGenKey(genKey);
udiInfoExportLogEntity.setUpdateTime(new Date());
udiInfoExportLogEntity.setType(BasicProcessStatus.EXPORT_SMP);
udiInfoExportLogEntity.setDlCount(0);
udiInfoExportLogService.insertUdiInfoExportLog(udiInfoExportLogEntity);
basicGenExcelService.uploadProductsSmp(genKey, udiInfoExportRequest);
return ResultVOUtils.success("后台正在导出生成excel文件请稍后刷新查看!");
}
//产品信息接口下载(第三方使用)
@GetMapping("/udiwms/basic/products/download")
public BaseResponse downloadProducts(FilterUdiInfoRequest filterUdiInfoRequest,

@ -1,7 +1,7 @@
package com.glxp.api.admin.controller.basic;
import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.constant.UdiInfoImportStatus;
import com.glxp.api.admin.constant.BasicProcessStatus;
import com.glxp.api.admin.entity.basic.UdiInfoImportDetailEntity;
import com.glxp.api.admin.entity.basic.UdiInfoImportLogEntity;
import com.glxp.api.admin.req.basic.FilterUdiIpLogRequest;
@ -143,7 +143,7 @@ public class UdiInfoImportLogController {
String genKey = CustomUtil.getId();
udiInfoImportLogEntity.setGenKey(genKey);
udiInfoImportLogEntity.setFromType("文件导入");
udiInfoImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_UNPROCESS);
udiInfoImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS);
udiInfoImportLogEntity.setUpdateTime(new Date(System.currentTimeMillis()));
udiInfoImportLogService.insertImportLog(udiInfoImportLogEntity);
List<UdiInfoImportDetailEntity> udiInfoImportEntities = new ArrayList<>();
@ -212,7 +212,7 @@ public class UdiInfoImportLogController {
}
}
udiInfoImportService.insertUdiInfoImports(udiInfoImportEntities);
udiInfoImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_UNPROCESS);
udiInfoImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS);
udiInfoImportLogService.updateImportLog(udiInfoImportLogEntity);
workbook.close();
basicUdiInfoImportService.importUdiInfo(genKey);
@ -225,7 +225,7 @@ public class UdiInfoImportLogController {
//产品信息接口上传
@PostMapping("/udiwms/products/importLog/post")
@PostMapping("/udiwms/basic/products/upload")
public BaseResponse postUdiInfo(@RequestBody PostUdiInfoRequest postUdiInfoRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
@ -240,7 +240,7 @@ public class UdiInfoImportLogController {
if(udiInfoImportEntities!=null){
for(UdiInfoImportDetailEntity udiInfoImportEntity:udiInfoImportEntities){
udiInfoImportEntity.setGenKeyFk(genKey);
udiInfoImportEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_CODE_UNPROCESS);
udiInfoImportEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_CODE_UNPROCESS);
udiInfoImportEntity.setUpdateTime(new java.util.Date());
udiInfoImportService.insertUdiInfoImport(udiInfoImportEntity);
}
@ -249,11 +249,11 @@ public class UdiInfoImportLogController {
udiInfoImportLogEntity = new UdiInfoImportLogEntity();
udiInfoImportLogEntity.setGenKey(genKey);
udiInfoImportLogEntity.setFromType("接口导入");
udiInfoImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_UNPROCESS);
udiInfoImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS);
udiInfoImportLogEntity.setUpdateTime(new Date(System.currentTimeMillis()));
udiInfoImportLogService.insertImportLog(udiInfoImportLogEntity);
}else {
udiInfoImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_UNPROCESS);
udiInfoImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS);
udiInfoImportLogService.updateImportLog(udiInfoImportLogEntity);
}
basicUdiInfoImportService.importUdiInfo(genKey);

@ -1,7 +1,7 @@
package com.glxp.api.admin.controller.thrsys;
import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.constant.UdiInfoImportStatus;
import com.glxp.api.admin.constant.BasicProcessStatus;
import com.glxp.api.admin.entity.basic.BasicThirdSysDetailEntity;
import com.glxp.api.admin.entity.thrsys.*;
import com.glxp.api.admin.entity.thrsys.ThrCorpExportLogEntity;
@ -12,14 +12,11 @@ import com.glxp.api.admin.req.inout.DeleteRequest;
import com.glxp.api.admin.req.thrsys.*;
import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.res.basic.ErpUnitsResponse;
import com.glxp.api.admin.res.basic.UdiRelevanceResponse;
import com.glxp.api.admin.service.basic.BasicThirdSysDetailService;
import com.glxp.api.admin.service.thrsys.ThrCorpExportLogService;
import com.glxp.api.admin.service.thrsys.ThrCorpService;
import com.glxp.api.admin.service.thrsys.ThrOrderExportLogService;
import com.glxp.api.admin.thread.ThrCorpsDlService;
import com.glxp.api.admin.util.CustomUtil;
import com.glxp.api.admin.util.ExcelUtil;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
@ -36,7 +33,6 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@ -134,7 +130,7 @@ public class ThrCorpExportLogController {
}
}
ThrCorpExportLogEntity thrCorpExportLogEntity = new ThrCorpExportLogEntity();
thrCorpExportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_PROCESS);
thrCorpExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_PROCESS);
String genKey = CustomUtil.getId();
thrCorpExportLogEntity.setGenKey(genKey);
thrCorpExportLogEntity.setFilePath(fileName);

@ -1,21 +1,16 @@
package com.glxp.api.admin.controller.thrsys;
import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.constant.UdiInfoImportStatus;
import com.glxp.api.admin.entity.inventory.StockPrintEntity;
import com.glxp.api.admin.constant.BasicProcessStatus;
import com.glxp.api.admin.entity.thrsys.*;
import com.glxp.api.admin.req.basic.FilterStockprintRequest;
import com.glxp.api.admin.req.inout.DeleteRequest;
import com.glxp.api.admin.req.thrsys.FilterThrCorpRequest;
import com.glxp.api.admin.req.thrsys.FilterThrProductsRequest;
import com.glxp.api.admin.req.thrsys.PostThrCorpRequest;
import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.res.basic.ErpUnitsResponse;
import com.glxp.api.admin.res.inout.WarehouseResponse;
import com.glxp.api.admin.service.thrsys.ThrCorpImportDetailService;
import com.glxp.api.admin.service.thrsys.ThrCorpImportLogService;
import com.glxp.api.admin.service.thrsys.ThrCorpService;
import com.glxp.api.admin.service.thrsys.ThrOrderImportLogService;
import com.glxp.api.admin.thread.ThrCorpsDlService;
import com.glxp.api.admin.util.Constant;
import com.glxp.api.admin.util.CustomUtil;
@ -23,14 +18,12 @@ import com.glxp.api.admin.util.RedisUtil;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@RestController
public class ThrCorpsController {
@ -101,7 +94,7 @@ public class ThrCorpsController {
thrCorpImportLogEntity.setFromType(postThrCorpRequest.getUploadType());
} else
thrCorpImportLogEntity.setFromType("第三方系统上传");
thrCorpImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_PROCESS);
thrCorpImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_PROCESS);
thrCorpImportLogEntity.setUpdateTime(new Date());
thrCorpImportLogEntity.setThirdSysFk(postThrCorpRequest.getThirdSys());
thrCorpImportLogService.insertImportLog(thrCorpImportLogEntity);
@ -127,7 +120,7 @@ public class ThrCorpsController {
String genKey = CustomUtil.getId();
thrCorpImportLogEntity.setGenKey(genKey);
thrCorpImportLogEntity.setFromType("第三方系统获取");
thrCorpImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_PROCESS);
thrCorpImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_PROCESS);
thrCorpImportLogEntity.setUpdateTime(new Date());
thrCorpImportLogEntity.setThirdSysFk(filterThrProductsRequest.getThirdSysFk());
thrCorpImportLogService.insertImportLog(thrCorpImportLogEntity);

@ -1,19 +1,14 @@
package com.glxp.api.admin.controller.thrsys;
import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.constant.UdiInfoImportStatus;
import com.glxp.api.admin.entity.thrsys.ThrCorpImportLogEntity;
import com.glxp.api.admin.constant.BasicProcessStatus;
import com.glxp.api.admin.entity.thrsys.ThrInvProductsEntity;
import com.glxp.api.admin.entity.thrsys.ThrInvProductsImportLogEntity;
import com.glxp.api.admin.req.inout.DeleteRequest;
import com.glxp.api.admin.req.thrsys.FilterThrInvProductsRequest;
import com.glxp.api.admin.req.thrsys.FilterThrProductsRequest;
import com.glxp.api.admin.req.thrsys.PostThrCorpRequest;
import com.glxp.api.admin.req.thrsys.PostThrInvProductsRequest;
import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.res.basic.ErpUnitsResponse;
import com.glxp.api.admin.res.inventory.ErpInvProductResponse;
import com.glxp.api.admin.res.inventory.ErpOnHandResponse;
import com.glxp.api.admin.service.thrsys.ThrInvProductsImportLogService;
import com.glxp.api.admin.service.thrsys.ThrInvProductsService;
import com.glxp.api.admin.thread.ThrInvProductsDlService;
@ -23,14 +18,12 @@ import com.glxp.api.admin.util.RedisUtil;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@RestController
public class ThrInvProductsController {
@ -85,7 +78,7 @@ public class ThrInvProductsController {
thrInvProductsImportLogEntity.setFromType(postThrInvProductsRequest.getUploadType());
} else
thrInvProductsImportLogEntity.setFromType("第三方系统上传");
thrInvProductsImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_PROCESS);
thrInvProductsImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_PROCESS);
thrInvProductsImportLogEntity.setUpdateTime(new Date());
thrInvProductsImportLogEntity.setThirdSysFk(postThrInvProductsRequest.getThirdSys());
thrInvProductsImportLogService.insertImportLog(thrInvProductsImportLogEntity);
@ -94,7 +87,7 @@ public class ThrInvProductsController {
thrInvProductsDlService.insertInvProducts(genKey, postThrInvProductsRequest.getThirdSys(), erpOnHandResponses);
return ResultVOUtils.success("库存产品信息上传成功,后台正在处理,请稍后重试!");
}
thrInvProductsImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_FAIL);
thrInvProductsImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrInvProductsImportLogEntity.setUpdateTime(new Date());
thrInvProductsImportLogEntity.setRemark("上传数据为空");
thrInvProductsImportLogService.updateImportLog(thrInvProductsImportLogEntity);

@ -1,9 +1,8 @@
package com.glxp.api.admin.controller.thrsys;
import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.constant.UdiInfoImportStatus;
import com.glxp.api.admin.constant.BasicProcessStatus;
import com.glxp.api.admin.entity.basic.BasicThirdSysDetailEntity;
import com.glxp.api.admin.entity.basic.UdiEntity;
import com.glxp.api.admin.entity.thrsys.ThrInvProductsEntity;
import com.glxp.api.admin.entity.thrsys.ThrInvProductsExportLogEntity;
import com.glxp.api.admin.httpclient.ErpInvClient;
@ -13,14 +12,12 @@ import com.glxp.api.admin.req.inventory.ErpOnhandRequest;
import com.glxp.api.admin.req.thrsys.FilterThrInvProductsRequest;
import com.glxp.api.admin.req.thrsys.ThrInvProductsExportRequest;
import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.res.basic.UdiRelevanceResponse;
import com.glxp.api.admin.res.inventory.ErpInvProductResponse;
import com.glxp.api.admin.service.basic.BasicThirdSysDetailService;
import com.glxp.api.admin.service.thrsys.ThrInvProductsExportLogService;
import com.glxp.api.admin.service.thrsys.ThrInvProductsService;
import com.glxp.api.admin.thread.ThrInvProductsDlService;
import com.glxp.api.admin.util.CustomUtil;
import com.glxp.api.admin.util.FilterUdiUtils;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
@ -130,7 +127,7 @@ public class ThrInvProductsExportLogController {
}
}
ThrInvProductsExportLogEntity udiInfoExportLogEntity = new ThrInvProductsExportLogEntity();
udiInfoExportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_PROCESS);
udiInfoExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_PROCESS);
String genKey = CustomUtil.getId();
udiInfoExportLogEntity.setGenKey(genKey);
udiInfoExportLogEntity.setFilePath(fileName);

@ -3,8 +3,7 @@ package com.glxp.api.admin.controller.thrsys;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.constant.UdiInfoImportStatus;
import com.glxp.api.admin.entity.basic.UdiInfoImportLogEntity;
import com.glxp.api.admin.constant.BasicProcessStatus;
import com.glxp.api.admin.entity.info.SystemParamConfigEntity;
import com.glxp.api.admin.entity.thrsys.ThrOrderDetailEntity;
import com.glxp.api.admin.entity.thrsys.ThrOrderEntity;
@ -101,7 +100,7 @@ public class ThrOrderController {
if (thrOrderImportLogEntity == null) {
thrOrderImportLogEntity.setGenKey(genKey);
thrOrderImportLogEntity.setFromType("第三方系统上传");
thrOrderImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_PROCESS);
thrOrderImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_PROCESS);
thrOrderImportLogEntity.setUpdateTime(new Date());
thrOrderImportLogEntity.setThirdSysFk(postThrOrderRequest.getThirdSys());
thrOrderImportLogService.insertImportLog(thrOrderImportLogEntity);
@ -137,7 +136,7 @@ public class ThrOrderController {
thrOrderService.insertThrOrders(thrOrderEntities);
return ResultVOUtils.success("单据上传成功!");
}
thrOrderImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_SUCCESS);
thrOrderImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
thrOrderImportLogEntity.setUpdateTime(new Date());
thrOrderImportLogService.updateImportLog(thrOrderImportLogEntity);
return ResultVOUtils.error(500, "上传数据为空");
@ -180,7 +179,7 @@ public class ThrOrderController {
String genKey = CustomUtil.getId();
thrOrderImportLogEntity.setGenKey(genKey);
thrOrderImportLogEntity.setFromType("第三方系统获取");
thrOrderImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_PROCESS);
thrOrderImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_PROCESS);
thrOrderImportLogEntity.setUpdateTime(new Date());
thrOrderImportLogEntity.setThirdSysFk(filterThrProductsRequest.getThirdSysFk());
thrOrderImportLogService.insertImportLog(thrOrderImportLogEntity);

@ -1,7 +1,7 @@
package com.glxp.api.admin.controller.thrsys;
import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.constant.UdiInfoImportStatus;
import com.glxp.api.admin.constant.BasicProcessStatus;
import com.glxp.api.admin.entity.basic.BasicThirdSysDetailEntity;
import com.glxp.api.admin.entity.thrsys.ThrOrderDetailEntity;
import com.glxp.api.admin.entity.thrsys.ThrOrderEntity;
@ -15,14 +15,12 @@ import com.glxp.api.admin.req.thrsys.FilterThrOrderRequest;
import com.glxp.api.admin.req.thrsys.ThrOrderExportRequest;
import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.res.inout.ErpOrderResponse;
import com.glxp.api.admin.service.basic.BasicThirdSysDetailService;
import com.glxp.api.admin.service.basic.BussinessTypeService;
import com.glxp.api.admin.service.thrsys.ThrOrderDetailService;
import com.glxp.api.admin.service.thrsys.ThrOrderExportLogService;
import com.glxp.api.admin.service.thrsys.ThrOrderService;
import com.glxp.api.admin.thread.ThrOrdersDlService;
import com.glxp.api.admin.util.CustomUtil;
import com.glxp.api.admin.util.ExcelUtil;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
@ -135,11 +133,12 @@ public class ThrOrderExportLogController {
}
}
ThrOrderExportLogEntity udiInfoExportLogEntity = new ThrOrderExportLogEntity();
udiInfoExportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_PROCESS);
udiInfoExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_PROCESS);
String genKey = CustomUtil.getId();
udiInfoExportLogEntity.setGenKey(genKey);
udiInfoExportLogEntity.setFilePath(fileName);
udiInfoExportLogEntity.setUpdateTime(new Date());
udiInfoExportLogEntity.setType(BasicProcessStatus.EXPORT_EXCEL);
udiInfoExportLogEntity.setDlCount(0);
thrOrderExportLogService.insertThrOrderExportLog(udiInfoExportLogEntity);
thrOrdersDlService.genExcel(genKey, thrOrderExportRequest);
@ -147,6 +146,24 @@ public class ThrOrderExportLogController {
}
//业务单据上传SMP并创建生成记录
@PostMapping("/udiwms/thrOrder/importLog/uploadSmp")
public BaseResponse uploadSmp(@RequestBody ThrOrderExportRequest thrOrderExportRequest) {
ThrOrderExportLogEntity udiInfoExportLogEntity = new ThrOrderExportLogEntity();
udiInfoExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_PROCESS);
String genKey = CustomUtil.getId();
udiInfoExportLogEntity.setGenKey(genKey);
udiInfoExportLogEntity.setUpdateTime(new Date());
udiInfoExportLogEntity.setType(BasicProcessStatus.EXPORT_SMP);
udiInfoExportLogEntity.setDlCount(0);
thrOrderExportLogService.insertThrOrderExportLog(udiInfoExportLogEntity);
thrOrdersDlService.uploadSmp(genKey, thrOrderExportRequest);
return ResultVOUtils.success("后台正在导出生成excel文件请稍后刷新查看!");
}
//第三方业务单据接口下载(第三方使用)
@GetMapping("/udiwms/thrsys/thrOrder/download")
public BaseResponse downloadThrOrders(FilterOrderRequest filterErpOrderRequest,

@ -2,20 +2,16 @@ package com.glxp.api.admin.controller.thrsys;
import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.constant.UdiInfoImportStatus;
import com.glxp.api.admin.entity.basic.BasicThirdSysEntity;
import com.glxp.api.admin.constant.BasicProcessStatus;
import com.glxp.api.admin.entity.basic.BussinessTypeEntity;
import com.glxp.api.admin.entity.thrsys.ThrOrderImportDetailEntity;
import com.glxp.api.admin.entity.thrsys.ThrOrderImportLogEntity;
import com.glxp.api.admin.req.basic.FilterUdiIpLogRequest;
import com.glxp.api.admin.req.basic.PostCorpsRequest;
import com.glxp.api.admin.req.inout.DeleteRequest;
import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.service.basic.*;
import com.glxp.api.admin.service.thrsys.ThrOrderDetailService;
import com.glxp.api.admin.service.thrsys.ThrOrderImportDetailService;
import com.glxp.api.admin.service.thrsys.ThrOrderImportLogService;
import com.glxp.api.admin.service.thrsys.ThrOrderService;
import com.glxp.api.admin.thread.ThrOrderImportService;
import com.glxp.api.admin.util.CustomUtil;
import com.glxp.api.common.enums.ResultEnum;
@ -148,7 +144,7 @@ public class ThrOrderImportLogController {
thrOrderImportLogEntity.setGenKey(genKey);
thrOrderImportLogEntity.setThirdSysFk(thirdSys);
thrOrderImportLogEntity.setFromType("文件导入");
thrOrderImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_UNPROCESS);
thrOrderImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS);
thrOrderImportLogEntity.setUpdateTime(new Date(System.currentTimeMillis()));
thrOrderImportLogService.insertImportLog(thrOrderImportLogEntity);
List<ThrOrderImportDetailEntity> corpImportDetailEntities = new ArrayList<>();
@ -238,13 +234,13 @@ public class ThrOrderImportLogController {
corpImportDetailEntity.setThirdSysFk(thirdSys);
corpImportDetailEntity.setGenKeyFk(genKey);
corpImportDetailEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_CODE_UNPROCESS);
corpImportDetailEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_CODE_UNPROCESS);
corpImportDetailEntity.setUpdateTime(new Date(System.currentTimeMillis()));
corpImportDetailEntities.add(corpImportDetailEntity);
}
}
thrOrderImportDetailService.insertOrderImportDetails(corpImportDetailEntities);
thrOrderImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_UNPROCESS);
thrOrderImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS);
thrOrderImportLogService.updateImportLog(thrOrderImportLogEntity);
workbook.close();
thrOrderImportService.importThrOrder(genKey);

@ -1,8 +1,7 @@
package com.glxp.api.admin.controller.thrsys;
import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.constant.UdiInfoImportStatus;
import com.glxp.api.admin.entity.thrsys.ThrInvProductsImportLogEntity;
import com.glxp.api.admin.constant.BasicProcessStatus;
import com.glxp.api.admin.entity.thrsys.ThrProductsEntity;
import com.glxp.api.admin.entity.thrsys.ThrProductsImportLogEntity;
import com.glxp.api.admin.req.inout.DeleteRequest;
@ -19,14 +18,12 @@ import com.glxp.api.admin.util.RedisUtil;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@RestController
public class ThrProductsController {
@ -98,7 +95,7 @@ public class ThrProductsController {
thrProductsImportLogEntity.setFromType(postThrProductsRequest.getUploadType());
} else
thrProductsImportLogEntity.setFromType("第三方系统上传");
thrProductsImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_PROCESS);
thrProductsImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_PROCESS);
thrProductsImportLogEntity.setUpdateTime(new Date());
thrProductsImportLogEntity.setThirdSysFk(postThrProductsRequest.getThirdSys());
thrProductsImportLogService.insertImportLog(thrProductsImportLogEntity);
@ -108,7 +105,7 @@ public class ThrProductsController {
thrProductsDlService.insertData(genKey, erpProductsResponses, postThrProductsRequest.getThirdSys());
return ResultVOUtils.success("产品信息上传成功!");
}
thrProductsImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_FAIL);
thrProductsImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrProductsImportLogEntity.setUpdateTime(new Date());
thrProductsImportLogEntity.setRemark("上传数据为空");
thrProductsImportLogService.updateImportLog(thrProductsImportLogEntity);
@ -130,7 +127,7 @@ public class ThrProductsController {
String genKey = CustomUtil.getId();
thrProductsImportLogEntity.setGenKey(genKey);
thrProductsImportLogEntity.setFromType("第三方系统下载");
thrProductsImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_PROCESS);
thrProductsImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_PROCESS);
thrProductsImportLogEntity.setUpdateTime(new Date());
thrProductsImportLogEntity.setThirdSysFk(filterThrProductsRequest.getThirdSysFk());
thrProductsImportLogService.insertImportLog(thrProductsImportLogEntity);

@ -1,10 +1,8 @@
package com.glxp.api.admin.controller.thrsys;
import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.constant.UdiInfoImportStatus;
import com.glxp.api.admin.constant.BasicProcessStatus;
import com.glxp.api.admin.entity.basic.BasicThirdSysDetailEntity;
import com.glxp.api.admin.entity.basic.UdiRelevanceEntity;
import com.glxp.api.admin.entity.thrsys.ThrInvProductsEntity;
import com.glxp.api.admin.entity.thrsys.ThrProductsEntity;
import com.glxp.api.admin.entity.thrsys.ThrProductsExportLogEntity;
import com.glxp.api.admin.httpclient.ErpBasicClient;
@ -20,7 +18,6 @@ import com.glxp.api.admin.service.thrsys.ThrProductsExportLogService;
import com.glxp.api.admin.service.thrsys.ThrProductsService;
import com.glxp.api.admin.thread.ThrProductsDlService;
import com.glxp.api.admin.util.CustomUtil;
import com.glxp.api.admin.util.ExcelUtil;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
@ -37,7 +34,6 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -131,12 +127,13 @@ public class ThrProductsExportLogController {
}
}
ThrProductsExportLogEntity thrProductsExportLogEntity = new ThrProductsExportLogEntity();
thrProductsExportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_PROCESS);
thrProductsExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_PROCESS);
String genKey = CustomUtil.getId();
thrProductsExportLogEntity.setGenKey(genKey);
thrProductsExportLogEntity.setFilePath(fileName);
thrProductsExportLogEntity.setUpdateTime(new Date());
thrProductsExportLogEntity.setDlCount(0);
thrProductsExportLogEntity.setType(BasicProcessStatus.EXPORT_EXCEL);
thrProductsExportLogService.insertThrProductsExportLog(thrProductsExportLogEntity);
thrProductsDlService.genExcel(genKey, thrProductsExportRequest);
return ResultVOUtils.success("后台正在导出生成excel文件请稍后刷新查看!");
@ -144,28 +141,19 @@ public class ThrProductsExportLogController {
}
//产品信息导出生成Excel,并创建生成记录
//产品信息上传供应商管理平台,并创建生成记录
@PostMapping("/udiwms/thrProducts/importLog/uploadSmp")
public BaseResponse uploadSmp(@RequestBody ThrProductsExportRequest thrProductsExportRequest) {
String fileName = "D:\\udiwms\\exportFile\\" + "产品信息导出" + System.currentTimeMillis() + ".xls";
File file = new File(fileName);
if (!file.exists()) {
try {
file.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
}
ThrProductsExportLogEntity thrProductsExportLogEntity = new ThrProductsExportLogEntity();
thrProductsExportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_PROCESS);
thrProductsExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_PROCESS);
String genKey = CustomUtil.getId();
thrProductsExportLogEntity.setGenKey(genKey);
thrProductsExportLogEntity.setFilePath(fileName);
thrProductsExportLogEntity.setUpdateTime(new Date());
thrProductsExportLogEntity.setDlCount(0);
thrProductsExportLogEntity.setType(BasicProcessStatus.EXPORT_SMP);
thrProductsExportLogService.insertThrProductsExportLog(thrProductsExportLogEntity);
thrProductsDlService.genExcel(genKey, thrProductsExportRequest);
thrProductsDlService.uploadSmp(genKey, thrProductsExportRequest);
return ResultVOUtils.success("后台正在导出生成excel文件请稍后刷新查看!");
}

@ -13,4 +13,5 @@ public class CorpExportLogEntity {
private String remark;
private Integer dlCount;
private String filePath;
private Integer type;
}

@ -13,6 +13,6 @@ public class UdiInfoExportLogEntity {
private String remark;
private Integer dlCount;
private String filePath;
private Integer type;
}

@ -14,4 +14,5 @@ public class ThrOrderExportLogEntity {
private String remark;
private Integer dlCount;
private String filePath;
private Integer type;
}

@ -13,4 +13,5 @@ public class ThrProductsExportLogEntity {
private String remark;
private Integer dlCount;
private String filePath;
private Integer type;
}

@ -1,6 +1,6 @@
package com.glxp.api.admin.thread;
import com.glxp.api.admin.constant.UdiInfoImportStatus;
import com.glxp.api.admin.constant.BasicProcessStatus;
import com.glxp.api.admin.entity.basic.BasicUnitMaintainEntity;
import com.glxp.api.admin.entity.basic.CorpImportDetailEntity;
import com.glxp.api.admin.entity.basic.CorpImportLogEntity;
@ -29,7 +29,7 @@ public class BasicCorpImportService {
public void importCorps(String genKey) {
CorpImportLogEntity corpImportLogEntity = corpImportLogService.selectByGenKey(genKey);
if(corpImportLogEntity!=null && corpImportLogEntity.getStatus() == UdiInfoImportStatus.UDIINFO_IMPORT_UNPROCESS){
if(corpImportLogEntity!=null && corpImportLogEntity.getStatus() == BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS){
FilterUdiIpLogRequest filterUdiIpLogRequest = new FilterUdiIpLogRequest();
filterUdiIpLogRequest.setGenKey(genKey);
List<CorpImportDetailEntity> corpImportDetailEntities
@ -39,11 +39,11 @@ public class BasicCorpImportService {
BasicUnitMaintainEntity basicUnitMaintainEntity = new BasicUnitMaintainEntity();
BeanUtils.copyProperties(corpImportDetailEntity, basicUnitMaintainEntity);
basicUnitMaintainService.insertBasicUnitMaintain(basicUnitMaintainEntity);
corpImportDetailEntity.setImportStatus(UdiInfoImportStatus.UDIINFO_IMPORT_CODE_SUCESS);
corpImportDetailEntity.setImportStatus(BasicProcessStatus.UDIINFO_IMPORT_CODE_SUCESS);
corpImportDetailService.updateCorpImport(corpImportDetailEntity);
}
}
corpImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_SUCCESS);
corpImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
corpImportLogService.updateImportLog(corpImportLogEntity);
}

@ -1,13 +1,11 @@
package com.glxp.api.admin.thread;
import com.glxp.api.admin.constant.UdiInfoImportStatus;
import com.glxp.api.admin.constant.BasicProcessStatus;
import com.glxp.api.admin.entity.basic.BasicUnitMaintainEntity;
import com.glxp.api.admin.entity.basic.CorpExportLogEntity;
import com.glxp.api.admin.entity.basic.UdiInfoExportLogEntity;
import com.glxp.api.admin.req.basic.BasicUnitMaintainFilterRequest;
import com.glxp.api.admin.req.basic.CorpsExportRequest;
import com.glxp.api.admin.req.basic.FilterUdiInfoRequest;
import com.glxp.api.admin.req.basic.UdiInfoExportRequest;
import com.glxp.api.admin.entity.basic.UdiInfoImportDetailEntity;
import com.glxp.api.admin.req.basic.*;
import com.glxp.api.admin.res.basic.UdiRelevanceResponse;
import com.glxp.api.admin.service.basic.BasicUnitMaintainService;
import com.glxp.api.admin.service.basic.CorpExportLogService;
@ -93,7 +91,7 @@ public class BasicGenExcelService {
}
}
new ExcelUtil().exportExcel(excelData, sheetName, corpExportLogEntity.getFilePath(), 20);
corpExportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_SUCCESS);
corpExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
corpExportLogService.updateCorpExportLog(corpExportLogEntity);
}
@ -143,11 +141,37 @@ public class BasicGenExcelService {
}
}
new ExcelUtil().exportExcel(excelData, sheetName, udiInfoExportLogEntity.getFilePath(), 20);
udiInfoExportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_SUCCESS);
udiInfoExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
udiInfoExportLogService.updateUdiInfoExportLog(udiInfoExportLogEntity);
}
@Async
public void uploadProductsSmp(String genKey, UdiInfoExportRequest udiInfoExportRequest) {
UdiInfoExportLogEntity udiInfoExportLogEntity = udiInfoExportLogService.selectByGenKey(genKey);
PostUdiInfoRequest postUdiInfoRequest = new PostUdiInfoRequest();
//选中导出
if (udiInfoExportRequest.getUuids() != null && udiInfoExportRequest.getUuids().size() > 0) {
List<String> uuids = udiInfoExportRequest.getUuids();
for (String uuid : uuids) {
FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest();
filterUdiInfoRequest.setUuid(uuid);
List<UdiInfoImportDetailEntity> genDatas = genSmpData(filterUdiInfoRequest);
postUdiInfoRequest.setDatas(genDatas);
}
} else {//一键导出
FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest();
BeanUtils.copyProperties(udiInfoExportRequest, filterUdiInfoRequest);
List<UdiInfoImportDetailEntity> genDatas = genSmpData(filterUdiInfoRequest);
postUdiInfoRequest.setDatas(genDatas);
}
//todo 上传smp
udiInfoExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
udiInfoExportLogService.updateUdiInfoExportLog(udiInfoExportLogEntity);
}
public List<List<String>> genExcelData(BasicUnitMaintainFilterRequest filterUdiInfoRequest) {
List<List<String>> excelData = new ArrayList<>();
@ -196,4 +220,22 @@ public class BasicGenExcelService {
}
return excelData;
}
public List<UdiInfoImportDetailEntity> genSmpData(FilterUdiInfoRequest filterUdiInfoRequest) {
List<UdiInfoImportDetailEntity> udiInfoImportDetailEntities = new ArrayList<>();
List<UdiRelevanceResponse> udiRelevanceResponses = udiRelevanceService.filterUdiRelevance(filterUdiInfoRequest);
for (UdiRelevanceResponse udiRelevanceResponse : udiRelevanceResponses) {
UdiInfoImportDetailEntity udiInfoImportDetailEntity = new UdiInfoImportDetailEntity();
udiInfoImportDetailEntity.setUdiCode(udiRelevanceResponse.getNameCode());
udiInfoImportDetailEntity.setYbbm(udiRelevanceResponse.getYbbm());
udiInfoImportDetailEntity.setSptm(udiRelevanceResponse.getSptm());
udiInfoImportDetailEntity.setThirdId(udiRelevanceResponse.getThirdId());
udiInfoImportDetailEntity.setThirdId1(udiRelevanceResponse.getThirdId1());
udiInfoImportDetailEntity.setThirdId2(udiRelevanceResponse.getThirdId2());
udiInfoImportDetailEntity.setThirdId3(udiRelevanceResponse.getThirdId3());
udiInfoImportDetailEntity.setThirdId4(udiRelevanceResponse.getThirdId4());
udiInfoImportDetailEntities.add(udiInfoImportDetailEntity);
}
return udiInfoImportDetailEntities;
}
}

@ -1,6 +1,6 @@
package com.glxp.api.admin.thread;
import com.glxp.api.admin.constant.UdiInfoImportStatus;
import com.glxp.api.admin.constant.BasicProcessStatus;
import com.glxp.api.admin.entity.basic.UdiInfoEntity;
import com.glxp.api.admin.entity.basic.UdiInfoImportDetailEntity;
import com.glxp.api.admin.entity.basic.UdiInfoImportLogEntity;
@ -42,7 +42,7 @@ public class BasicUdiInfoImportService {
public void importUdiInfo(String genKey) {
UdiInfoImportLogEntity udiInfoImportLogEntity = udiInfoImportLogService.selectByGenKey(genKey);
if (udiInfoImportLogEntity.getStatus() == UdiInfoImportStatus.UDIINFO_IMPORT_CODE_UNPROCESS) {
if (udiInfoImportLogEntity.getStatus() == BasicProcessStatus.UDIINFO_IMPORT_CODE_UNPROCESS) {
FilterUdiIpLogRequest filterUdiIpLogRequest = new FilterUdiIpLogRequest();
filterUdiIpLogRequest.setGenKey(genKey);
List<UdiInfoImportDetailEntity> udiInfoImportEntities
@ -71,27 +71,27 @@ public class BasicUdiInfoImportService {
udiRelevanceEntity.setManufactory(thrProductsEntity.getManufactory());
udiRelevanceEntity.setMeasname(thrProductsEntity.getMeasname());
udiInfoService.insertUdiInfos(froms);
udiInfoImportDetailEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_CODE_SUCESS);
udiInfoImportDetailEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_CODE_SUCESS);
udiRelevanceService.insertUdiRelevance(udiRelevanceEntity);
}else {
udiInfoImportDetailEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_CODE_FAIL);
udiInfoImportDetailEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_CODE_FAIL);
udiInfoImportDetailEntity.setRemark("未查询到系统产品信息!");
udiInfoImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_FAIL);
udiInfoImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
}
}
} else {
udiInfoImportDetailEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_CODE_FAIL);
udiInfoImportDetailEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_CODE_FAIL);
udiInfoImportDetailEntity.setRemark("未查询到UDI产品信息");
udiInfoImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_FAIL);
udiInfoImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
}
}else {
udiInfoImportDetailEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_CODE_SUCESS);
udiInfoImportDetailEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_CODE_SUCESS);
}
udiInfoImportService.updateUdiInfoImport(udiInfoImportDetailEntity);
}
udiInfoImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_SUCCESS);
udiInfoImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
udiInfoImportLogService.updateImportLog(udiInfoImportLogEntity);
}
}

@ -1,29 +1,25 @@
package com.glxp.api.admin.thread;
import com.glxp.api.admin.config.WebSocketServer;
import com.glxp.api.admin.constant.UdiInfoImportStatus;
import com.glxp.api.admin.constant.BasicProcessStatus;
import com.glxp.api.admin.entity.basic.BasicThirdSysDetailEntity;
import com.glxp.api.admin.entity.thrsys.*;
import com.glxp.api.admin.httpclient.ErpBasicClient;
import com.glxp.api.admin.req.basic.BasicUnitMaintainFilterRequest;
import com.glxp.api.admin.req.basic.FilterErpGoodsRequest;
import com.glxp.api.admin.req.basic.FilterUdiIpLogRequest;
import com.glxp.api.admin.req.thrsys.FilterThrCorpRequest;
import com.glxp.api.admin.req.thrsys.ThrCorpExportRequest;
import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.res.basic.ErpProductsResponse;
import com.glxp.api.admin.res.basic.ErpUnitsResponse;
import com.glxp.api.admin.service.basic.BasicThirdSysDetailService;
import com.glxp.api.admin.service.thrsys.*;
import com.glxp.api.admin.util.Constant;
import com.glxp.api.admin.util.CustomUtil;
import com.glxp.api.admin.util.ExcelUtil;
import com.glxp.api.admin.util.RedisUtil;
import com.glxp.api.common.res.BaseResponse;
import org.springframework.beans.BeanUtils;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.ArrayList;
@ -111,14 +107,14 @@ public class ThrCorpsDlService {
//判断是否启用实时获取
BasicThirdSysDetailEntity basicThirdSysDetailEntity = basicThirdSysDetailService.selectByKey("corpUrl", thrCorpExportRequest.getThirdSys());
if (basicThirdSysDetailEntity == null || basicThirdSysDetailEntity.getValue() == null) {
thrCorpExportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_FAIL);
thrCorpExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrCorpExportLogEntity.setRemark("往来单位接口地址未定义");
thrCorpExportLogService.updateThrCorpExportLog(thrCorpExportLogEntity);
return;
}
if(!basicThirdSysDetailEntity.getEnabled()){
thrCorpExportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_FAIL);
thrCorpExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrCorpExportLogEntity.setRemark("第三方往来单位服务未启用");
thrCorpExportLogService.updateThrCorpExportLog(thrCorpExportLogEntity);
return;
@ -141,7 +137,7 @@ public class ThrCorpsDlService {
}
String sheetName = "往来单位信息";
new ExcelUtil().exportExcel(excelData, sheetName, thrCorpExportLogEntity.getFilePath(), 20);
thrCorpExportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_SUCCESS);
thrCorpExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
thrCorpExportLogService.updateThrCorpExportLog(thrCorpExportLogEntity);
}
@ -177,7 +173,7 @@ public class ThrCorpsDlService {
}
).collect(Collectors.toList());
thrCorpService.insertThrCorpss(thrCorpEntities);
thrCorpImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_SUCCESS);
thrCorpImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
thrCorpImportLogEntity.setUpdateTime(new Date());
thrCorpImportLogService.updateImportLog(thrCorpImportLogEntity);
}
@ -190,7 +186,7 @@ public class ThrCorpsDlService {
BaseResponse<PageSimpleResponse<ErpUnitsResponse>> erpCrops = new ErpBasicClient().getErpCrop(basicUnitMaintainFilterRequest, corpUrl);
if (erpCrops == null || erpCrops.getCode() != 20000) {
thrCorpImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_FAIL);
thrCorpImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrCorpImportLogEntity.setRemark(erpCrops.getMessage());
thrCorpImportLogService.updateImportLog(thrCorpImportLogEntity);
return -1;
@ -219,7 +215,7 @@ public class ThrCorpsDlService {
return page;
}
}
thrCorpImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_SUCCESS);
thrCorpImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
thrCorpImportLogService.updateImportLog(thrCorpImportLogEntity);
return -1;
}

@ -1,19 +1,15 @@
package com.glxp.api.admin.thread;
import com.glxp.api.admin.config.WebSocketServer;
import com.glxp.api.admin.constant.UdiInfoImportStatus;
import com.glxp.api.admin.constant.BasicProcessStatus;
import com.glxp.api.admin.entity.basic.BasicThirdSysDetailEntity;
import com.glxp.api.admin.entity.thrsys.*;
import com.glxp.api.admin.httpclient.ErpBasicClient;
import com.glxp.api.admin.httpclient.ErpInvClient;
import com.glxp.api.admin.req.basic.FilterErpGoodsRequest;
import com.glxp.api.admin.req.basic.FilterUdiIpLogRequest;
import com.glxp.api.admin.req.inventory.ErpOnhandRequest;
import com.glxp.api.admin.req.thrsys.FilterThrInvProductsRequest;
import com.glxp.api.admin.req.thrsys.ThrCorpExportRequest;
import com.glxp.api.admin.req.thrsys.ThrInvProductsExportRequest;
import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.res.basic.ErpProductsResponse;
import com.glxp.api.admin.res.inventory.ErpInvProductResponse;
import com.glxp.api.admin.service.basic.BasicThirdSysDetailService;
import com.glxp.api.admin.service.thrsys.*;
@ -59,7 +55,7 @@ public class ThrInvProductsDlService {
String genKey = CustomUtil.getId();
thrInvProductsImportLogEntity.setGenKey(genKey);
thrInvProductsImportLogEntity.setFromType("第三方系统获取");
thrInvProductsImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_PROCESS);
thrInvProductsImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_PROCESS);
thrInvProductsImportLogEntity.setUpdateTime(new Date());
thrInvProductsImportLogEntity.setThirdSysFk(thirdSys);
thrInvProductsImportLogService.insertImportLog(thrInvProductsImportLogEntity);
@ -105,13 +101,13 @@ public class ThrInvProductsDlService {
//判断是否启用实时获取
BasicThirdSysDetailEntity basicThirdSysDetailEntity = basicThirdSysDetailService.selectByKey("invPiUrl", thrInvProductsExportRequest.getThirdSysFk());
if (basicThirdSysDetailEntity == null || basicThirdSysDetailEntity.getValue() == null) {
thrInvProductsExportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_FAIL);
thrInvProductsExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrInvProductsExportLogEntity.setRemark("库存产品信息接口地址未定义");
thrInvProductsExportLogService.updateThrInvProductsExportLog(thrInvProductsExportLogEntity);
return;
}
if (!basicThirdSysDetailEntity.getEnabled()) {
thrInvProductsExportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_FAIL);
thrInvProductsExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrInvProductsExportLogEntity.setRemark("第三方库存产品信息接口服务未启用");
thrInvProductsExportLogService.updateThrInvProductsExportLog(thrInvProductsExportLogEntity);
return;
@ -134,7 +130,7 @@ public class ThrInvProductsDlService {
}
String sheetName = "库存产品信息";
new ExcelUtil().exportExcel(excelData, sheetName, thrInvProductsExportLogEntity.getFilePath(), 20);
thrInvProductsExportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_SUCCESS);
thrInvProductsExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
thrInvProductsExportLogService.updateThrInvProductsExportLog(thrInvProductsExportLogEntity);
}
@ -168,7 +164,7 @@ public class ThrInvProductsDlService {
).collect(Collectors.toList());
thrInvProductsService.insertThrInvProducts(thrInvProductsEntities);
thrInvProductsImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_SUCCESS);
thrInvProductsImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
thrInvProductsImportLogEntity.setUpdateTime(new Date());
thrInvProductsImportLogService.updateImportLog(thrInvProductsImportLogEntity);
}
@ -183,7 +179,7 @@ public class ThrInvProductsDlService {
BaseResponse<PageSimpleResponse<ErpInvProductResponse>> responseBaseResponse = new ErpInvClient().getInvPrdoductResponse(erpOnhandRequest, productUrl);
if (responseBaseResponse.getCode() != 20000) {
thrInvProductsImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_FAIL);
thrInvProductsImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrInvProductsImportLogEntity.setRemark(responseBaseResponse.getMessage());
thrInvProductsImportLogService.updateImportLog(thrInvProductsImportLogEntity);
return -1;
@ -209,7 +205,7 @@ public class ThrInvProductsDlService {
return page;
}
}
thrInvProductsImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_SUCCESS);
thrInvProductsImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
thrInvProductsImportLogService.updateImportLog(thrInvProductsImportLogEntity);
return -1;
}

@ -1,13 +1,11 @@
package com.glxp.api.admin.thread;
import com.glxp.api.admin.constant.UdiInfoImportStatus;
import com.glxp.api.admin.entity.basic.UdiInfoImportLogEntity;
import com.glxp.api.admin.constant.BasicProcessStatus;
import com.glxp.api.admin.entity.thrsys.ThrOrderDetailEntity;
import com.glxp.api.admin.entity.thrsys.ThrOrderEntity;
import com.glxp.api.admin.entity.thrsys.ThrOrderImportDetailEntity;
import com.glxp.api.admin.entity.thrsys.ThrOrderImportLogEntity;
import com.glxp.api.admin.req.basic.FilterUdiIpLogRequest;
import com.glxp.api.admin.req.basic.PostSmpUdiInfoRequest;
import com.glxp.api.admin.service.thrsys.ThrOrderDetailService;
import com.glxp.api.admin.service.thrsys.ThrOrderImportDetailService;
import com.glxp.api.admin.service.thrsys.ThrOrderImportLogService;
@ -36,7 +34,7 @@ public class ThrOrderImportService {
@Async
public void importThrOrder(String genKey) {
ThrOrderImportLogEntity thrOrderImportLogEntity = thrOrderImportLogService.selectByGenKey(genKey);
if (thrOrderImportLogEntity.getStatus() == UdiInfoImportStatus.UDIINFO_IMPORT_UNPROCESS) {
if (thrOrderImportLogEntity.getStatus() == BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS) {
FilterUdiIpLogRequest filterUdiIpLogRequest = new FilterUdiIpLogRequest();
filterUdiIpLogRequest.setGenKey(genKey);
List<ThrOrderImportDetailEntity> thrOrderImportDetailEntities = thrOrderImportDetailService.filterOrderImportDetail(filterUdiIpLogRequest);
@ -60,7 +58,7 @@ public class ThrOrderImportService {
}
thrOrderImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_SUCCESS);
thrOrderImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
thrOrderImportLogService.updateImportLog(thrOrderImportLogEntity);
}

@ -1,29 +1,21 @@
package com.glxp.api.admin.thread;
import com.glxp.api.admin.config.WebSocketServer;
import com.glxp.api.admin.constant.UdiInfoImportStatus;
import com.glxp.api.admin.constant.BasicProcessStatus;
import com.glxp.api.admin.entity.basic.BasicThirdSysDetailEntity;
import com.glxp.api.admin.entity.inout.ErpOrderEntity;
import com.glxp.api.admin.entity.thrsys.*;
import com.glxp.api.admin.httpclient.ErpBasicClient;
import com.glxp.api.admin.httpclient.ErpInvClient;
import com.glxp.api.admin.httpclient.ErpOrderClient;
import com.glxp.api.admin.req.basic.BasicUnitMaintainFilterRequest;
import com.glxp.api.admin.req.inout.FilterOrderRequest;
import com.glxp.api.admin.req.inventory.ErpOnhandRequest;
import com.glxp.api.admin.req.thrsys.FilterThrInvProductsRequest;
import com.glxp.api.admin.req.thrsys.FilterThrOrderDetailRequest;
import com.glxp.api.admin.req.thrsys.FilterThrOrderRequest;
import com.glxp.api.admin.req.thrsys.PostThrOrderRequest;
import com.glxp.api.admin.req.thrsys.ThrOrderExportRequest;
import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.res.basic.ErpUnitsResponse;
import com.glxp.api.admin.res.inout.ErpOrderResponse;
import com.glxp.api.admin.res.inventory.ErpInvProductResponse;
import com.glxp.api.admin.service.basic.BasicThirdSysDetailService;
import com.glxp.api.admin.service.basic.BussinessTypeService;
import com.glxp.api.admin.service.thrsys.*;
import com.glxp.api.admin.util.Constant;
import com.glxp.api.admin.util.CustomUtil;
import com.glxp.api.admin.util.ExcelUtil;
import com.glxp.api.admin.util.RedisUtil;
import com.glxp.api.common.res.BaseResponse;
@ -33,9 +25,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@Service
public class ThrOrdersDlService {
@ -73,7 +63,7 @@ public class ThrOrdersDlService {
}
redisUtil.set(Constant.dlThrProducts, "false");
WebSocketServer.sendInfo("业务单据信息下载已完成,请刷新查看!", "sid");
// thrOrderImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_SUCCESS);
// thrOrderImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
// thrOrderImportLogService.updateImportLog(thrOrderImportLogEntity);
}
@ -126,13 +116,13 @@ public class ThrOrdersDlService {
BasicThirdSysDetailEntity basicThirdSysDetailEntity = basicThirdSysDetailService.selectByKey("orderQueryUrl", thrOrderExportRequest.getThirdSysFk());
if (basicThirdSysDetailEntity == null || basicThirdSysDetailEntity.getValue() == null) {
thrOrderExportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_FAIL);
thrOrderExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrOrderExportLogEntity.setRemark("往来单位接口地址未定义");
thrOrderExportLogService.updateThrOrderExportLog(thrOrderExportLogEntity);
return;
}
if (!basicThirdSysDetailEntity.getEnabled() ) {
thrOrderExportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_FAIL);
if (!basicThirdSysDetailEntity.getEnabled()) {
thrOrderExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrOrderExportLogEntity.setRemark("第三方往来单位服务未启用");
thrOrderExportLogService.updateThrOrderExportLog(thrOrderExportLogEntity);
return;
@ -155,10 +145,73 @@ public class ThrOrdersDlService {
}
String sheetName = "业务单据";
new ExcelUtil().exportExcel(excelData, sheetName, thrOrderExportLogEntity.getFilePath(), 20);
thrOrderExportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_SUCCESS);
thrOrderExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
thrOrderExportLogService.updateThrOrderExportLog(thrOrderExportLogEntity);
}
@Async
public void uploadSmp(String genKey, ThrOrderExportRequest thrOrderExportRequest) {
ThrOrderExportLogEntity thrOrderExportLogEntity = thrOrderExportLogService.selectByGenKey(genKey);
PostThrOrderRequest postThrOrderRequest = new PostThrOrderRequest();
//选中导出
if (thrOrderExportRequest.getErpOrderResponses() != null && thrOrderExportRequest.getErpOrderResponses().size() > 0) {
List<ErpOrderResponse> erpOrderResponses = thrOrderExportRequest.getErpOrderResponses();
postThrOrderRequest.setDatas(erpOrderResponses);
} else {//一键导出
List<ErpOrderResponse> erpOrderResponses =new ArrayList<>();
BasicThirdSysDetailEntity basicThirdSysDetailEntity = basicThirdSysDetailService.selectByKey("orderQueryUrl", thrOrderExportRequest.getThirdSysFk());
if (basicThirdSysDetailEntity == null || basicThirdSysDetailEntity.getValue() == null) {
thrOrderExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrOrderExportLogEntity.setRemark("往来单位接口地址未定义");
thrOrderExportLogService.updateThrOrderExportLog(thrOrderExportLogEntity);
return;
}
if (!basicThirdSysDetailEntity.getEnabled()) {
thrOrderExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrOrderExportLogEntity.setRemark("第三方往来单位服务未启用");
thrOrderExportLogService.updateThrOrderExportLog(thrOrderExportLogEntity);
return;
}
if (basicThirdSysDetailEntity.getFromType() == 0 && !basicThirdSysDetailEntity.getItrCache()) {
FilterThrOrderRequest filterThrOrderRequest = new FilterThrOrderRequest();
BeanUtils.copyProperties(thrOrderExportRequest, filterThrOrderRequest);
List<ErpOrderResponse> datas = getThrOrders(filterThrOrderRequest);
erpOrderResponses.addAll(datas);
} else {
FilterThrOrderRequest filterThrOrderRequest = new FilterThrOrderRequest();
BeanUtils.copyProperties(thrOrderExportRequest, filterThrOrderRequest);
List<List<String>> excelData = new ArrayList<>();
List<ThrOrderEntity> thrOrderEntities = thrOrderService.filterThrOrder(filterThrOrderRequest);
for (ThrOrderEntity thrOrderEntity : thrOrderEntities) {
ErpOrderResponse erpOrderResponse = new ErpOrderResponse();
BeanUtils.copyProperties(thrOrderEntity,erpOrderResponse);
FilterThrOrderDetailRequest filterThrOrderDetailRequest = new FilterThrOrderDetailRequest();
filterThrOrderDetailRequest.setOrderIdFk(thrOrderEntity.getId() + "");
List<ThrOrderDetailEntity> thrOrderDetailEntities = thrOrderDetailService.filterThrOrderDetailDetail(filterThrOrderDetailRequest);
if (thrOrderDetailEntities != null) {
List<ErpOrderResponse.SubErpOrder > subErpOrders = new ArrayList<>();
for (ThrOrderDetailEntity thrOrderDetailEntity : thrOrderDetailEntities) {
ErpOrderResponse.SubErpOrder subErpOrder = new ErpOrderResponse.SubErpOrder();
BeanUtils.copyProperties(thrOrderDetailEntity,subErpOrder);
subErpOrders.add(subErpOrder);
}
erpOrderResponse.setSubErpOrders(subErpOrders);
}
erpOrderResponses.add(erpOrderResponse);
}
}
}
//toDo 上傳SMP
postThrOrderRequest.setGenKey(genKey);
postThrOrderRequest.setThirdSys(thrOrderExportRequest.getThirdSysFk());
thrOrderExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
thrOrderExportLogService.updateThrOrderExportLog(thrOrderExportLogEntity);
}
public int getOrders(int page, int limit, String orderUrl, String thirdSys, ThrOrderImportLogEntity thrOrderImportLogEntity, String action) {
FilterOrderRequest filterOrderRequest = new FilterOrderRequest();
filterOrderRequest.setPage(page);
@ -189,7 +242,7 @@ public class ThrOrdersDlService {
}
}
} else {
thrOrderImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_FAIL);
thrOrderImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
if (responseBaseResponse != null) {
thrOrderImportLogEntity.setRemark(responseBaseResponse.getMessage());
} else {
@ -198,7 +251,7 @@ public class ThrOrdersDlService {
thrOrderImportLogService.updateImportLog(thrOrderImportLogEntity);
return -1;
}
thrOrderImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_SUCCESS);
thrOrderImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
thrOrderImportLogService.updateImportLog(thrOrderImportLogEntity);
return -1;
}
@ -243,6 +296,26 @@ public class ThrOrdersDlService {
return excelData;
}
public List<ErpOrderResponse> getThrOrders(FilterThrOrderRequest filterThrOrderRequest) {
BasicThirdSysDetailEntity basicThirdSysDetailEntity = basicThirdSysDetailService.selectByKey("orderQueryUrl", filterThrOrderRequest.getThirdSysFk());
int page = 1;
int limit = 100;
List<ErpOrderResponse> erpOrderResponseList = new ArrayList<>();
while (true) {
List<ErpOrderResponse> datas = getThrOrders(page, limit, basicThirdSysDetailEntity.getValue(), filterThrOrderRequest);
if (datas != null && datas.size() >= limit) {
erpOrderResponseList.addAll(datas);
page++;
} else {
if (datas != null) {
erpOrderResponseList.addAll(datas);
}
break;
}
}
return erpOrderResponseList;
}
public List<ErpOrderResponse> getThrOrders(int page, int limit, String orderQueryUrl, FilterThrOrderRequest filterThrOrderRequest) {
FilterOrderRequest filterOrderRequest = new FilterOrderRequest();
BeanUtils.copyProperties(filterThrOrderRequest, filterOrderRequest);

@ -1,7 +1,7 @@
package com.glxp.api.admin.thread;
import com.glxp.api.admin.config.WebSocketServer;
import com.glxp.api.admin.constant.UdiInfoImportStatus;
import com.glxp.api.admin.constant.BasicProcessStatus;
import com.glxp.api.admin.entity.basic.BasicThirdSysDetailEntity;
import com.glxp.api.admin.entity.thrsys.*;
import com.glxp.api.admin.httpclient.ErpBasicClient;
@ -18,7 +18,6 @@ import com.glxp.api.admin.service.thrsys.ThrProductsImportDetailService;
import com.glxp.api.admin.service.thrsys.ThrProductsImportLogService;
import com.glxp.api.admin.service.thrsys.ThrProductsService;
import com.glxp.api.admin.util.Constant;
import com.glxp.api.admin.util.CustomUtil;
import com.glxp.api.admin.util.ExcelUtil;
import com.glxp.api.admin.util.RedisUtil;
import com.glxp.api.common.res.BaseResponse;
@ -54,7 +53,7 @@ public class ThrProductsDlService {
ThrProductsImportLogEntity thrProductsImportLogEntity = thrProductsImportLogService.selectByGenKey(genKey);
BasicThirdSysDetailEntity piDetailEntity = basicThirdSysDetailService.selectByKey("piQueryUrl", thirdSys);
if (piDetailEntity == null || piDetailEntity.getValue() == null) {
thrProductsImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_FAIL);
thrProductsImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrProductsImportLogEntity.setRemark("产品信息接口未设置");
thrProductsImportLogService.updateImportLog(thrProductsImportLogEntity);
WebSocketServer.sendInfo("产品信息接口未设置!", "sid");
@ -80,7 +79,7 @@ public class ThrProductsDlService {
thrProductsService.insertThrProductss(thrProductsEntities);
redisUtil.set(Constant.dlThrProducts, "false");
thrProductsImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_SUCCESS);
thrProductsImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
thrProductsImportLogService.updateImportLog(thrProductsImportLogEntity);
WebSocketServer.sendInfo("产品信息下载已完成,请刷新查看!", "sid");
}
@ -109,14 +108,14 @@ public class ThrProductsDlService {
BasicThirdSysDetailEntity basicThirdSysDetailEntity = basicThirdSysDetailService.selectByKey("piQueryUrl", thrProductsExportRequest.getThirdSys());
if (basicThirdSysDetailEntity == null || basicThirdSysDetailEntity.getValue() == null) {
thrProductsExportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_FAIL);
thrProductsExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrProductsExportLogEntity.setRemark("产品信息接口未定义!");
thrProductsExportLogService.updateThrProductsExportLog(thrProductsExportLogEntity);
return;
}
if (!basicThirdSysDetailEntity.getEnabled()) {
thrProductsExportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_FAIL);
thrProductsExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrProductsExportLogEntity.setRemark("第三方产品信息服务未启用!");
thrProductsExportLogService.updateThrProductsExportLog(thrProductsExportLogEntity);
return;
@ -139,7 +138,7 @@ public class ThrProductsDlService {
}
String sheetName = "产品信息";
new ExcelUtil().exportExcel(excelData, sheetName, thrProductsExportLogEntity.getFilePath(), 20);
thrProductsExportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_SUCCESS);
thrProductsExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
thrProductsExportLogService.updateThrProductsExportLog(thrProductsExportLogEntity);
}
@ -174,14 +173,14 @@ public class ThrProductsDlService {
BasicThirdSysDetailEntity basicThirdSysDetailEntity = basicThirdSysDetailService.selectByKey("piQueryUrl", thrProductsExportRequest.getThirdSys());
if (basicThirdSysDetailEntity == null || basicThirdSysDetailEntity.getValue() == null) {
thrProductsExportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_FAIL);
thrProductsExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrProductsExportLogEntity.setRemark("产品信息接口未定义!");
thrProductsExportLogService.updateThrProductsExportLog(thrProductsExportLogEntity);
return;
}
if (!basicThirdSysDetailEntity.getEnabled()) {
thrProductsExportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_FAIL);
thrProductsExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrProductsExportLogEntity.setRemark("第三方产品信息服务未启用!");
thrProductsExportLogService.updateThrProductsExportLog(thrProductsExportLogEntity);
return;
@ -209,9 +208,9 @@ public class ThrProductsDlService {
postThrProductsRequest.setThirdSys(thrProductsExportRequest.getThirdSys());
postThrProductsRequest.setUploadType("接口上传");
}
//Todo 接口上传SMP
thrProductsExportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_SUCCESS);
thrProductsExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
thrProductsExportLogService.updateThrProductsExportLog(thrProductsExportLogEntity);
}
@ -243,7 +242,7 @@ public class ThrProductsDlService {
}
).collect(Collectors.toList());
thrProductsService.insertThrProductss(thrProductsEntities);
thrProductsImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_SUCCESS);
thrProductsImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
thrProductsImportLogEntity.setUpdateTime(new Date());
thrProductsImportLogService.updateImportLog(thrProductsImportLogEntity);
}
@ -279,7 +278,7 @@ public class ThrProductsDlService {
}
} else {
thrProductsImportLogEntity.setRemark(erpProducts.getMessage());
thrProductsImportLogEntity.setStatus(UdiInfoImportStatus.UDIINFO_IMPORT_FAIL);
thrProductsImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrProductsImportLogService.updateImportLog(thrProductsImportLogEntity);
return -1;
}

Loading…
Cancel
Save