代码备份。单据自动生成以及bug修改

master
anthonyywj2 3 years ago
parent a6990442d8
commit bff708d598

@ -3,18 +3,22 @@ package com.glxp.sale.admin.controller.basic;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.github.pagehelper.PageInfo;
import com.glxp.sale.admin.constant.BasicProcessStatus;
import com.glxp.sale.admin.entity.basic.BasicExportStatusEntity;
import com.glxp.sale.admin.entity.basic.BasicExportStatusTimeEntity;
import com.glxp.sale.admin.entity.inout.StockOrderEntity;
import com.glxp.sale.admin.req.basic.BasicExportStatusRequest;
import com.glxp.sale.admin.req.basic.BasicExportTimeRequest;
import com.glxp.sale.admin.req.info.DeleteRequest;
import com.glxp.sale.admin.res.PageSimpleResponse;
import com.glxp.sale.admin.res.basic.BasicUnitMaintainExportResponse;
import com.glxp.sale.admin.res.basic.SpsSyncDataResponse;
import com.glxp.sale.admin.res.basic.UdiRelevanceExportJsonResponse;
import com.glxp.sale.admin.res.inventory.InvWarehouseExportResponse;
import com.glxp.sale.admin.service.basic.BasicExportService;
import com.glxp.sale.admin.service.basic.BasicExportTimeService;
import com.glxp.sale.admin.util.CustomUtil;
import com.glxp.sale.admin.util.RedisUtil;
import com.glxp.sale.common.res.BaseResponse;
import com.glxp.sale.common.util.ResultVOUtils;
@ -45,6 +49,18 @@ public class SpsSyncExportStatusController {
return ResultVOUtils.success(basicExportStatusEntities);
}
@GetMapping("/spssync/basic/udiinfo/filter")
public BaseResponse filterStatus(BasicExportStatusRequest basicExportStatusRequest) {
List<BasicExportStatusEntity> basicExportStatusEntities = basicExportService.filterExportStatus(basicExportStatusRequest);
PageInfo<BasicExportStatusEntity> pageInfo;
pageInfo = new PageInfo<>(basicExportStatusEntities);
PageSimpleResponse<BasicExportStatusEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(basicExportStatusEntities);
return ResultVOUtils.success(pageSimpleResponse);
}
@PostMapping("/spssync/basic/udiinfo/deleteByStatus")
public BaseResponse deleteByStatus(@RequestBody DeleteRequest deleteRequest) {
@ -88,4 +104,82 @@ public class SpsSyncExportStatusController {
else
return ResultVOUtils.error(500, "更新失败!");
}
@PostMapping("/spssync/basic/schedule/create")
public BaseResponse createSchedule(@RequestBody BasicExportStatusRequest basicExportStatusRequest) {
if (basicExportStatusRequest.getCreateType() == 1) {
//自动创建要求被下载已完成单据任务
BasicExportStatusEntity basicExportStatusEntity1 = basicExportService.findByData("AutoDownloadOrder", 0);
if (basicExportStatusEntity1 == null) {
BasicExportStatusEntity orderStatusEntity = new BasicExportStatusEntity();
orderStatusEntity.setId(CustomUtil.getId());
orderStatusEntity.setIdDatas("AutoDownloadOrder");
orderStatusEntity.setType(BasicProcessStatus.NEW_ALL_ORDER);
orderStatusEntity.setUpdateTime(new Date());
orderStatusEntity.setStatus(0);
orderStatusEntity.setStartTime(new Date());
orderStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL);
basicExportService.insertExportStatus(orderStatusEntity);
}else {
return ResultVOUtils.error(501,"任务已存在!");
}
} else if (basicExportStatusRequest.getCreateType() == 2) {
//自动创建要求被下载单据类型任务
BasicExportStatusEntity basicExportStatusEntity2 = basicExportService.findByData("AutoDownloadBusType", 0);
if (basicExportStatusEntity2 == null) {
BasicExportStatusEntity busTypetatusEntity = new BasicExportStatusEntity();
busTypetatusEntity.setId(CustomUtil.getId());
busTypetatusEntity.setIdDatas("AutoDownloadBusType");
busTypetatusEntity.setType(BasicProcessStatus.NEW_ALL_BUS);
busTypetatusEntity.setUpdateTime(new Date());
busTypetatusEntity.setStatus(0);
busTypetatusEntity.setStartTime(new Date());
busTypetatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL);
basicExportService.insertExportStatus(busTypetatusEntity);
}else {
return ResultVOUtils.error(501,"任务已存在!");
}
} else if (basicExportStatusRequest.getCreateType() == 3) {
//自动创建要求被下载基础信息任务
BasicExportStatusEntity basicExportStatusEntity3 = basicExportService.findByData("AutoDownloadAllData", 0);
if (basicExportStatusEntity3 == null) {
BasicExportStatusEntity basicExportStatusEntity = new BasicExportStatusEntity();
basicExportStatusEntity.setId(CustomUtil.getId());
basicExportStatusEntity.setIdDatas("AutoDownloadAllData");
basicExportStatusEntity.setType(BasicProcessStatus.NEW_ALL_DATA);
basicExportStatusEntity.setUpdateTime(new Date());
basicExportStatusEntity.setStatus(0);
basicExportStatusEntity.setStartTime(new Date());
basicExportStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL);
basicExportService.insertExportStatus(basicExportStatusEntity);
}else {
return ResultVOUtils.error(501,"任务已存在!");
}
} else if (basicExportStatusRequest.getCreateType() == 4) {
//自动创建要求被下载同步库DI信息
BasicExportStatusEntity basicExportStatusEntity4 = basicExportService.findByData("AutoDownloadDiProducts", 0);
if (basicExportStatusEntity4 == null) {
BasicExportStatusEntity basicExportStatusEntity = new BasicExportStatusEntity();
basicExportStatusEntity.setId(CustomUtil.getId());
basicExportStatusEntity.setIdDatas("AutoDownloadDiProducts");
basicExportStatusEntity.setType(BasicProcessStatus.NEW_ALL_DI);
basicExportStatusEntity.setUpdateTime(new Date());
basicExportStatusEntity.setStatus(0);
basicExportStatusEntity.setStartTime(new Date());
basicExportStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL);
basicExportService.insertExportStatus(basicExportStatusEntity);
}else {
return ResultVOUtils.error(501,"任务已存在!");
}
}
return ResultVOUtils.success("创建成功!");
}
}

@ -10,4 +10,5 @@ public class BasicExportStatusRequest extends ListPageRequest {
private Integer type;
private Integer scheduleType;
private String idDatas;
public Integer createType;
}

@ -82,8 +82,7 @@
basic_bustype_local.name localName,basic_bussiness_type.checkEnable, basic_bustype_local.advanceType,
basic_bustype_local.changeEnable,basic_bussiness_type.genUnit,basic_bussiness_type.innerOrder,defaultUnit,
basic_bustype_local.spUse,basic_bussiness_type.storageCode,basic_bussiness_type.expireTip,
basic_bustype_local.prefix localPrefix
localPrefix from
basic_bustype_local.prefix localPrefix from
basic_bussiness_type LEFT JOIN
basic_third_sys on basic_bussiness_type.thirdSysFk =
basic_third_sys.thirdId LEFT JOIN basic_bustype_local on basic_bussiness_type.localAction =

Loading…
Cancel
Save