仓库字段新增,根据当前仓库,用户等查询扫码单据,业务单据;

中继服务同步功能
master
anthonyywj2 3 years ago
parent 49dc552120
commit 2afe0d9c23

@ -22,6 +22,16 @@ public class BasicProcessStatus {
public static final int BASIC_UDI = 1; //耗材字典
public static final int BASIC_INV = 2; //仓库字典
public static final int BASIC_CORP = 3; //往来单位
public static final int BASIC_THIRD_PRODUCTS = 4; //往来单位
public static final int BASIC_THIRD_CORP = 5; //往来单位
public static final int BASIC_THIRD_ORDER = 6; //往来单位
public static final int NEW_ALL_DATA = 7;
public static final int NEW_ALL_BUS = 8;
public static final int NEW_ALL_ORDER = 9;
public static final int SCHEDULE_NORMAL = 1; //常规任务
public static final int SCHEDULE_TRANSFER = 2; //需要传递任务
}

@ -9,6 +9,7 @@ public class ConstantStatus {
public static final Integer ORDER_STATUS_FAIL = 3; //重码校验失败
public static final Integer ORDER_STATUS_SUCCESS = 4; //已校验
public static final Integer ORDER_STATUS_ADDITIONAL = 5; //补录单据
public static final Integer ORDER_STATUS_DOING = 6;
//ERP校验状态
public static final Integer ORDER_CHECK_SUCCESS = 2; //校验成功

@ -36,6 +36,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@RestController
@ -209,6 +210,7 @@ public class BussinessLocalTypeController {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (bussinessTypeEntity != null) {
bussinessTypeEntity.setUpdateTime(new Date());
bussinessLocalTypeService.updateBusLocalType(bussinessTypeEntity);
} else {
ResultVOUtils.error(999, "参数错误");
@ -230,6 +232,7 @@ public class BussinessLocalTypeController {
if (bussinessLocalTypeEntity != null) {
ResultVOUtils.error(999, "业务类型已存在!");
} else {
bussinessTypeEntity.setUpdateTime(new Date());
bussinessLocalTypeService.insertBussinessType(bussinessTypeEntity);
}

@ -36,6 +36,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.InputStream;
import java.util.Date;
import java.util.List;
/**
@ -193,6 +194,7 @@ public class BussinessTypeController {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (bussinessTypeEntity != null) {
bussinessTypeEntity.setUpdateTime(new Date());
bussinessTypeService.updateBussinessType(bussinessTypeEntity);
} else {
ResultVOUtils.error(999, "参数错误");
@ -210,6 +212,7 @@ public class BussinessTypeController {
if (bussinessTypeEntity != null) {
bussinessTypeEntity.setAction("SC" + CustomUtil.getId());
bussinessTypeEntity.setUpdateTime(new Date());
bussinessTypeService.insertBussinessType(bussinessTypeEntity);
} else {
ResultVOUtils.error(999, "参数错误");

@ -0,0 +1,212 @@
package com.glxp.sale.admin.controller.basic;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.db.sql.Order;
import com.glxp.sale.admin.constant.ConstantStatus;
import com.glxp.sale.admin.dao.basic.UdiInfoDao;
import com.glxp.sale.admin.entity.basic.*;
import com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity;
import com.glxp.sale.admin.entity.inout.ErpOrderEntity;
import com.glxp.sale.admin.entity.inout.OrderEntity;
import com.glxp.sale.admin.entity.inout.WarehouseEntity;
import com.glxp.sale.admin.entity.inventory.InvWarehouseEntity;
import com.glxp.sale.admin.entity.thrsys.*;
import com.glxp.sale.admin.req.basic.*;
import com.glxp.sale.admin.req.info.FilterCompanyProductRelevanceRequest;
import com.glxp.sale.admin.req.inout.OrderFilterRequest;
import com.glxp.sale.admin.req.inventory.FilterInvWarehouseRequest;
import com.glxp.sale.admin.req.receipt.ProductInfoFilterRequest;
import com.glxp.sale.admin.req.thrsys.*;
import com.glxp.sale.admin.res.basic.SpsSyncBusResponse;
import com.glxp.sale.admin.res.basic.SpsSyncDataResponse;
import com.glxp.sale.admin.res.basic.SpsSyncOrderResponse;
import com.glxp.sale.admin.res.inout.DlOrderResponse;
import com.glxp.sale.admin.res.inout.ErpOrderResponse;
import com.glxp.sale.admin.service.basic.*;
import com.glxp.sale.admin.service.info.CompanyProductRelevanceService;
import com.glxp.sale.admin.service.inout.CodesService;
import com.glxp.sale.admin.service.inout.OrderDetailService;
import com.glxp.sale.admin.service.inout.OrderService;
import com.glxp.sale.admin.service.inventory.InvWarehouseService;
import com.glxp.sale.admin.service.thrsys.*;
import com.glxp.sale.admin.util.BeanUtils;
import com.glxp.sale.common.res.BaseResponse;
import com.glxp.sale.common.util.ResultVOUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@RestController
public class SpsSyncDownloadController {
//基础信息
@Resource
InvWarehouseService invWarehouseService;
@Resource
UdiRelevanceService udiRelevanceService;
@Resource
UdiInfoDao udiInfoDao;
@Resource
BasicUnitMaintainService basicUnitMaintainService;
@Resource
ThrInvWarehouseService thrInvWarehouseService;
@Resource
ThrCorpService thrCorpService;
@Resource
ThrProductsService thrProductsService;
@Resource
ThrOrderService thrOrderService;
@Resource
ThrOrderDetailService thrOrderDetailService;
@Resource
private CompanyProductRelevanceService companyProductRelevanceService;
@GetMapping("sps/sync/basic")
public BaseResponse findProductInfo(SpsSyncDataRequest spsSyncDataRequest) {
//仓库字典
FilterInvWarehouseRequest filterInvWarehouseRequest = new FilterInvWarehouseRequest();
filterInvWarehouseRequest.setLastUpdateTime(spsSyncDataRequest.getLastUpdateTime());
List<InvWarehouseEntity> invWarehouseEntities = invWarehouseService.filterGroupInvWarehouse(filterInvWarehouseRequest);
//耗材字典
FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest();
filterUdiInfoRequest.setLastUpdateTime(spsSyncDataRequest.getLastUpdateTime());
List<UdiRelevanceEntity> udiRelevanceEntities = udiRelevanceService.filterUdiEntity(filterUdiInfoRequest);
List<String> results = new ArrayList<>();
udiRelevanceEntities.forEach(
item -> {
results.add(item.getUuid() + "");
}
);
List<UdiInfoEntity> udiInfoEntities = new ArrayList<>();
if (results.size() > 0)
udiInfoEntities = udiInfoDao.batchSelectByUuid(results);
//往来单位字典
BasicUnitMaintainFilterRequest basicUnitMaintainFilterRequest = new BasicUnitMaintainFilterRequest();
basicUnitMaintainFilterRequest.setLastUpdateTime(spsSyncDataRequest.getLastUpdateTime());
List<BasicUnitMaintainEntity> basicUnitMaintainEntities = basicUnitMaintainService.filterList(basicUnitMaintainFilterRequest);
//第三方仓库信息
FilterThrInvWarehouseRequest filterThrInvWarehouseRequest = new FilterThrInvWarehouseRequest();
filterThrInvWarehouseRequest.setLastUpdateTime(spsSyncDataRequest.getLastUpdateTime());
List<ThrInvWarehouseEntity> thrInvWarehouseEntities = thrInvWarehouseService.filterThrInvWarehouse(filterThrInvWarehouseRequest);
//第三方往来单位
FilterThrCorpRequest filterThrCorpRequest = new FilterThrCorpRequest();
BeanUtils.copyProperties(spsSyncDataRequest, filterThrCorpRequest);
List<ThrCorpEntity> thrCorpEntities = thrCorpService.filterThrCorps(filterThrCorpRequest);
//第三方产品信息
FilterThrProductsRequest filterThrProductsRequest = new FilterThrProductsRequest();
BeanUtils.copyProperties(spsSyncDataRequest, filterThrProductsRequest);
List<ThrProductsEntity> thrProductsEntities = thrProductsService.filterThrProductsRequest(filterThrProductsRequest);
//第三方业务单据
FilterThrOrderRequest filterThrOrderRequest = new FilterThrOrderRequest();
BeanUtils.copyProperties(spsSyncDataRequest, filterThrOrderRequest);
List<ThrOrderDetailEntity> allOrderDetailEntities = new ArrayList<>();
List<ThrOrderEntity> thrOrderEntities = thrOrderService.filterThrOrder(filterThrOrderRequest);
for (ThrOrderEntity thrOrderEntity : thrOrderEntities) {
FilterThrOrderDetailRequest filterThrOrderDetailRequest = new FilterThrOrderDetailRequest();
filterThrOrderDetailRequest.setOrderIdFk(thrOrderEntity.getId() + "");
List<ThrOrderDetailEntity> thrOrderDetailEntities = thrOrderDetailService.filterThrOrderDetailDetail(filterThrOrderDetailRequest);
if (!thrOrderDetailEntities.isEmpty()) {
allOrderDetailEntities.addAll(thrOrderDetailEntities);
}
}
//供应商产品信息关联表
FilterCompanyProductRelevanceRequest filterCompanyProductRelevanceRequest = new FilterCompanyProductRelevanceRequest();
BeanUtils.copyProperties(spsSyncDataRequest, filterCompanyProductRelevanceRequest);
List<CompanyProductRelevanceEntity> companyProductRelevanceEntities = companyProductRelevanceService.filterCompanyProductRelevance(filterCompanyProductRelevanceRequest);
SpsSyncDataResponse syncDataResponse = new SpsSyncDataResponse();
syncDataResponse.setCompanyProductRelevanceEntities(companyProductRelevanceEntities);
syncDataResponse.setInvWarehouseEntities(invWarehouseEntities);
syncDataResponse.setBasicUnitMaintainEntities(basicUnitMaintainEntities);
syncDataResponse.setThrCorpEntities(thrCorpEntities);
syncDataResponse.setThrInvWarehouseEntities(thrInvWarehouseEntities);
syncDataResponse.setThrOrderDetailEntities(allOrderDetailEntities);
syncDataResponse.setThrOrderEntities(thrOrderEntities);
syncDataResponse.setUdiInfoEntities(udiInfoEntities);
syncDataResponse.setThrProductsEntities(thrProductsEntities);
syncDataResponse.setUdiRelevanceEntities(udiRelevanceEntities);
return ResultVOUtils.success(syncDataResponse);
}
//单据类型
@Resource
BussinessTypeService bussinessTypeService;
@Resource
BussinessLocalTypeService bussinessLocalTypeService;
@Resource
BussinessOriginTypeService bussinessOriginTypeService;
@GetMapping("sps/sync/busType")
public BaseResponse findBusType(SpsSyncDataRequest spsSyncDataRequest) {
BussinessTypeFilterRequest bussinessTypeFilterRequest = new BussinessTypeFilterRequest();
BeanUtils.copyProperties(spsSyncDataRequest,bussinessTypeFilterRequest);
List<BussinessTypeEntity> bussinessTypeEntities = bussinessTypeService.filterAllList(bussinessTypeFilterRequest);
BussinessLocalTypeFilterRequest bussinessLocalTypeFilterRequest = new BussinessLocalTypeFilterRequest();
BeanUtils.copyProperties(spsSyncDataRequest,bussinessLocalTypeFilterRequest);
List<BussinessLocalTypeEntity> bussinessLocalTypeEntities = bussinessLocalTypeService.filterAllList(bussinessLocalTypeFilterRequest);
BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest = new BussinessOriginTypeFilterRequest();
BeanUtils.copyProperties(spsSyncDataRequest,bussinessOriginTypeFilterRequest);
List<BussinessOriginTypeEntity> bussinessOriginTypeEntities = bussinessOriginTypeService.filterList(bussinessOriginTypeFilterRequest);
SpsSyncBusResponse spsSyncBusResponse = new SpsSyncBusResponse();
spsSyncBusResponse.setBussinessTypeEntities(bussinessTypeEntities);
spsSyncBusResponse.setBussinessLocalTypeEntities(bussinessLocalTypeEntities);
spsSyncBusResponse.setBussinessOriginTypeEntities(bussinessOriginTypeEntities);
return ResultVOUtils.success(spsSyncBusResponse);
}
//已完成扫码单据
@Resource
OrderService orderService;
@Resource
CodesService codesService;
@Resource
OrderDetailService orderDetailService;
@GetMapping("sps/sync/order")
public BaseResponse findOrder(SpsSyncDataRequest spsSyncDataRequest) {
OrderFilterRequest orderFilterRequest = new OrderFilterRequest();
BeanUtils.copyProperties(spsSyncDataRequest, orderFilterRequest);
orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS);
// orderFilterRequest.setReceiveStatus(ConstantStatus.RECEIVE_ED);
List<OrderEntity> orderEntities = orderService.findAllByTime(orderFilterRequest);
List<ErpOrderEntity> allOrderDetailEntityList = new ArrayList<>();
List<WarehouseEntity> warehouseEntityList = new ArrayList<>();
if (CollUtil.isNotEmpty(orderEntities)) {
for (OrderEntity orderEntity : orderEntities) {
List<ErpOrderEntity> orderDetailEntityList = orderDetailService.filterAllByOrderIdFk(orderEntity.getId());
if (CollUtil.isNotEmpty(orderDetailEntityList)) {
allOrderDetailEntityList.addAll(orderDetailEntityList);
}
List<WarehouseEntity> codes = codesService.findByReceiptId(orderEntity.getId());
if (CollUtil.isNotEmpty(codes)) {
warehouseEntityList.addAll(codes);
}
}
}
SpsSyncOrderResponse syncOrderResponse = new SpsSyncOrderResponse();
syncOrderResponse.setOrderEntities(orderEntities);
syncOrderResponse.setOrderDetailEntityList(allOrderDetailEntityList);
syncOrderResponse.setWarehouseEntityList(warehouseEntityList);
return ResultVOUtils.success(syncOrderResponse);
}
}

@ -0,0 +1,91 @@
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.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.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.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.RedisUtil;
import com.glxp.sale.common.res.BaseResponse;
import com.glxp.sale.common.util.ResultVOUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
@RestController
public class SpsSyncExportStatusController {
@Resource
BasicExportService basicExportService;
@Resource
BasicExportTimeService basicExportTimeService;
@Resource
RedisUtil redisUtil;
@GetMapping("/spssync/basic/udiinfo/getStatus")
public BaseResponse getStatus(BasicExportStatusRequest basicExportStatusRequest) {
List<BasicExportStatusEntity> basicExportStatusEntities = basicExportService.filterExportStatus(basicExportStatusRequest);
return ResultVOUtils.success(basicExportStatusEntities);
}
@PostMapping("/spssync/basic/udiinfo/deleteByStatus")
public BaseResponse deleteByStatus(@RequestBody DeleteRequest deleteRequest) {
boolean b = basicExportService.deleteById(deleteRequest.getId());
redisUtil.del(deleteRequest.getId());
if (b)
return ResultVOUtils.success("删除成功!");
else
return ResultVOUtils.error(500, "删除失败!");
}
@PostMapping("/spssync/basic/udiinfo/updateStatus")
public BaseResponse updateStatus(@RequestBody BasicExportStatusEntity basicExportStatusEntity) {
basicExportStatusEntity.setEndTime(new Date());
basicExportStatusEntity.setUpdateTime(new Date());
boolean b = basicExportService.updateExportStatus(basicExportStatusEntity);
if (b)
return ResultVOUtils.success("更新成功!");
else
return ResultVOUtils.error(500, "更新成功!");
}
@GetMapping("/spssync/basic/schedule/lastTime")
public BaseResponse getLastUpdateTime(BasicExportTimeRequest basicExportTimeRequest) {
List<BasicExportStatusTimeEntity> basicExportStatusEntities = basicExportTimeService.filterExportStatus(basicExportTimeRequest);
if (CollUtil.isNotEmpty(basicExportStatusEntities)) {
return ResultVOUtils.success(basicExportStatusEntities.get(0).getLastUpdateTime());
} else {
return ResultVOUtils.success("1949-01-01 00:00:00");
}
}
@PostMapping("/spssync/basic/schedule/updateLastTime")
public BaseResponse updateLastTime(@RequestBody BasicExportStatusTimeEntity basicExportStatusTimeEntity) {
boolean b = basicExportTimeService.insertExportStatus(basicExportStatusTimeEntity);
if (b)
return ResultVOUtils.success("更新成功!");
else
return ResultVOUtils.error(500, "更新失败!");
}
}

@ -0,0 +1,290 @@
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.glxp.sale.admin.constant.BasicProcessStatus;
import com.glxp.sale.admin.dao.basic.*;
import com.glxp.sale.admin.dao.info.CompanyProductRelevanceDao;
import com.glxp.sale.admin.dao.inout.CodesDao;
import com.glxp.sale.admin.dao.inout.OrderDao;
import com.glxp.sale.admin.dao.inout.OrderDetailDao;
import com.glxp.sale.admin.dao.thrsys.ThrCorpDao;
import com.glxp.sale.admin.dao.thrsys.ThrOrderDao;
import com.glxp.sale.admin.dao.thrsys.ThrOrderDetailDao;
import com.glxp.sale.admin.dao.thrsys.ThrProductsDao;
import com.glxp.sale.admin.entity.basic.*;
import com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity;
import com.glxp.sale.admin.entity.inout.ErpOrderEntity;
import com.glxp.sale.admin.entity.inout.OrderEntity;
import com.glxp.sale.admin.entity.inout.WarehouseEntity;
import com.glxp.sale.admin.entity.thrsys.ThrCorpEntity;
import com.glxp.sale.admin.entity.thrsys.ThrOrderDetailEntity;
import com.glxp.sale.admin.entity.thrsys.ThrOrderEntity;
import com.glxp.sale.admin.entity.thrsys.ThrProductsEntity;
import com.glxp.sale.admin.req.basic.SpsSyncDataRequest;
import com.glxp.sale.admin.res.basic.SpsSyncBusResponse;
import com.glxp.sale.admin.res.basic.SpsSyncDataResponse;
import com.glxp.sale.admin.res.basic.SpsSyncOrderResponse;
import com.glxp.sale.admin.service.basic.BasicUnitMaintainService;
import com.glxp.sale.admin.service.basic.UdiRelevanceService;
import com.glxp.sale.admin.service.info.CompanyProductRelevanceService;
import com.glxp.sale.admin.service.inout.OrderService;
import com.glxp.sale.admin.service.inventory.InvWarehouseService;
import com.glxp.sale.admin.service.thrsys.*;
import com.glxp.sale.common.res.BaseResponse;
import com.glxp.sale.common.util.ResultVOUtils;
import org.apache.ibatis.session.ExecutorType;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.TransactionIsolationLevel;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
@RestController
public class SpsSyncUploadController {
@Resource
SqlSessionFactory sqlSessionFactory;
@Resource
InvWarehouseService invWarehouseService;
@Resource
OrderService orderService;
@PostMapping("sps/sync/basic/upload")
public BaseResponse findProductInfo(@RequestBody SpsSyncDataResponse syncDataResponse) {
if (syncDataResponse != null) {
dlAllData(syncDataResponse);
}
return ResultVOUtils.success("上传成功!");
}
@PostMapping("sps/sync/busType/upload")
public BaseResponse findBusType(@RequestBody SpsSyncBusResponse syncDataResponse) {
if (syncDataResponse != null) {
dlAllBus(syncDataResponse);
}
return ResultVOUtils.success("上传成功!");
}
@PostMapping("sps/sync/order/upload")
public BaseResponse findOrder(@RequestBody SpsSyncOrderResponse syncDataResponse) {
if (syncDataResponse != null) {
dlAllOrder(syncDataResponse);
}
return ResultVOUtils.success("上传成功!");
}
@PostMapping("sps/sync/schedule/upload")
public BaseResponse dealSchedule(@RequestBody BasicExportStatusEntity basicExportStatusEntity) {
//todo
//处理下游上传过来的任务
return ResultVOUtils.success("上传成功!");
}
public void dlAllData(SpsSyncDataResponse syncDataResponse) {
SqlSession batchSession = sqlSessionFactory.openSession(ExecutorType.BATCH, TransactionIsolationLevel.READ_COMMITTED);
//仓库字典导入
if (CollUtil.isNotEmpty(syncDataResponse.getInvWarehouseEntities())) {
invWarehouseService.importInvWarehouse(syncDataResponse.getInvWarehouseEntities());
}
//关联表导入
if (CollUtil.isNotEmpty(syncDataResponse.getUdiRelevanceEntities())) {
try {
List<UdiRelevanceEntity> corpList = syncDataResponse.getUdiRelevanceEntities();
UdiRelevanceDao mapper = batchSession.getMapper(UdiRelevanceDao.class);
for (UdiRelevanceEntity basicUnitMaintainEntity : corpList) {
mapper.insertUdiRelevance(basicUnitMaintainEntity);
}
batchSession.commit();
} catch (Exception e) {
}
}
//耗材字典导入
if (CollUtil.isNotEmpty(syncDataResponse.getUdiInfoEntities())) {
if (CollUtil.isNotEmpty(syncDataResponse.getUdiInfoEntities())) {
try {
List<UdiInfoEntity> corpList = syncDataResponse.getUdiInfoEntities();
UdiInfoDao mapper = batchSession.getMapper(UdiInfoDao.class);
for (UdiInfoEntity basicUnitMaintainEntity : corpList) {
mapper.insertUdiInfo(basicUnitMaintainEntity);
}
batchSession.commit();
} catch (Exception e) {
}
}
}
//往来单位信息导入
if (CollUtil.isNotEmpty(syncDataResponse.getBasicUnitMaintainEntities())) {
try {
List<BasicUnitMaintainEntity> corpList = syncDataResponse.getBasicUnitMaintainEntities();
BasicUnitMaintainDao mapper = batchSession.getMapper(BasicUnitMaintainDao.class);
for (BasicUnitMaintainEntity basicUnitMaintainEntity : corpList) {
mapper.importBasicUnitMaintain(basicUnitMaintainEntity);
}
batchSession.commit();
} catch (Exception e) {
}
}
//供应商关联表导入
if (CollUtil.isNotEmpty(syncDataResponse.getCompanyProductRelevanceEntities())) {
try {
List<CompanyProductRelevanceEntity> companyProductRelevanceEntities = syncDataResponse.getCompanyProductRelevanceEntities();
CompanyProductRelevanceDao mapper = batchSession.getMapper(CompanyProductRelevanceDao.class);
for (CompanyProductRelevanceEntity companyProductRelevanceEntity : companyProductRelevanceEntities) {
mapper.importCompanyProductRelevance(companyProductRelevanceEntity);
}
batchSession.commit();
} catch (Exception e) {
}
}
//第三方产品信息导入
if (CollUtil.isNotEmpty(syncDataResponse.getThrProductsEntities())) {
try {
List<ThrProductsEntity> thrProductsEntities = syncDataResponse.getThrProductsEntities();
ThrProductsDao mapper = batchSession.getMapper(ThrProductsDao.class);
for (ThrProductsEntity thrProductsEntity : thrProductsEntities) {
mapper.insertThrProducts(thrProductsEntity);
}
batchSession.commit();
} catch (Exception e) {
}
}
//第三方往来单位信息导入
if (CollUtil.isNotEmpty(syncDataResponse.getThrCorpEntities())) {
try {
List<ThrCorpEntity> thrCorpEntities = syncDataResponse.getThrCorpEntities();
ThrCorpDao mapper = batchSession.getMapper(ThrCorpDao.class);
thrCorpEntities.forEach(thrCorpEntity -> {
mapper.importThrCorp(thrCorpEntity);
});
batchSession.commit();
} catch (Exception e) {
}
}
//第三方业务单据导入
if (CollUtil.isNotEmpty(syncDataResponse.getThrOrderEntities())) {
try {
List<ThrOrderEntity> thrOrderEntities = syncDataResponse.getThrOrderEntities();
ThrOrderDao mapper = batchSession.getMapper(ThrOrderDao.class);
thrOrderEntities.forEach(thrCorpEntity -> {
mapper.importThrOrder(thrCorpEntity);
});
batchSession.commit();
} catch (Exception e) {
}
}
//第三方业务单据详情
if (CollUtil.isNotEmpty(syncDataResponse.getThrOrderDetailEntities())) {
try {
List<ThrOrderDetailEntity> thrOrderDetailEntities = syncDataResponse.getThrOrderDetailEntities();
ThrOrderDetailDao mapper = batchSession.getMapper(ThrOrderDetailDao.class);
thrOrderDetailEntities.forEach(thrOrderDetailEntity -> {
mapper.importThrOrderDetail(thrOrderDetailEntity);
});
batchSession.commit();
} catch (Exception e) {
}
}
}
public void dlAllBus(SpsSyncBusResponse syncDataResponse) {
SqlSession batchSession = sqlSessionFactory.openSession(ExecutorType.BATCH, TransactionIsolationLevel.READ_COMMITTED);
if (CollUtil.isNotEmpty(syncDataResponse.getBussinessTypeEntities())) {
try {
List<BussinessTypeEntity> bussinessTypeEntities = syncDataResponse.getBussinessTypeEntities();
BussinessTypeDao mapper = batchSession.getMapper(BussinessTypeDao.class);
for (BussinessTypeEntity bussinessTypeEntity : bussinessTypeEntities) {
mapper.insertBussinessType(bussinessTypeEntity);
}
batchSession.commit();
} catch (Exception e) {
}
}
//业务单据
if (CollUtil.isNotEmpty(syncDataResponse.getBussinessLocalTypeEntities())) {
try {
List<BussinessLocalTypeEntity> bussinessLocalTypeEntities = syncDataResponse.getBussinessLocalTypeEntities();
BussinessLocalTypeDao mapper = batchSession.getMapper(BussinessLocalTypeDao.class);
for (BussinessLocalTypeEntity bussinessTypeEntity : bussinessLocalTypeEntities) {
mapper.insertBussinessType(bussinessTypeEntity);
}
batchSession.commit();
} catch (Exception e) {
}
}
//原始单据
if (CollUtil.isNotEmpty(syncDataResponse.getBussinessOriginTypeEntities())) {
try {
List<BussinessOriginTypeEntity> bussinessTypeEntities = syncDataResponse.getBussinessOriginTypeEntities();
BussinessOriginTypeDao mapper = batchSession.getMapper(BussinessOriginTypeDao.class);
for (BussinessOriginTypeEntity bussinessTypeEntity : bussinessTypeEntities) {
mapper.insertBusOriginType(bussinessTypeEntity);
}
batchSession.commit();
} catch (Exception e) {
}
}
}
public void dlAllOrder(SpsSyncOrderResponse syncDataResponse) {
SqlSession batchSession = sqlSessionFactory.openSession(ExecutorType.BATCH, TransactionIsolationLevel.READ_COMMITTED);
if (CollUtil.isNotEmpty(syncDataResponse.getOrderEntities())) {
try {
List<OrderEntity> orderEntities = syncDataResponse.getOrderEntities();
OrderDao mapper = batchSession.getMapper(OrderDao.class);
for (OrderEntity orderEntity : orderEntities) {
orderService.deleteByOrderId(orderEntity.getId());
mapper.importOrder(orderEntity);
}
batchSession.commit();
} catch (Exception e) {
}
}
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailEntityList())) {
try {
List<ErpOrderEntity> erpOrderEntities = syncDataResponse.getOrderDetailEntityList();
OrderDetailDao mapper = batchSession.getMapper(OrderDetailDao.class);
for (ErpOrderEntity erpOrderEntity : erpOrderEntities) {
mapper.insertErpOrder(erpOrderEntity);
}
batchSession.commit();
} catch (Exception e) {
}
}
if (CollUtil.isNotEmpty(syncDataResponse.getWarehouseEntityList())) {
try {
List<WarehouseEntity> warehouseEntityList = syncDataResponse.getWarehouseEntityList();
CodesDao mapper = batchSession.getMapper(CodesDao.class);
for (WarehouseEntity warehouseEntity : warehouseEntityList) {
mapper.insertWarehouse(warehouseEntity);
}
batchSession.commit();
} catch (Exception e) {
}
}
}
}

@ -1,5 +1,6 @@
package com.glxp.sale.admin.controller.inout;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
@ -11,13 +12,16 @@ import com.glxp.sale.admin.entity.auth.AuthAdmin;
import com.glxp.sale.admin.entity.basic.BussinessTypeEntity;
import com.glxp.sale.admin.entity.info.CompanyEntity;
import com.glxp.sale.admin.entity.inout.*;
import com.glxp.sale.admin.entity.inventory.InvWarehouseEntity;
import com.glxp.sale.admin.entity.udid.UdiEntity;
import com.glxp.sale.admin.req.inout.*;
import com.glxp.sale.admin.req.inventory.FilterInvUserRequest;
import com.glxp.sale.admin.res.PageSimpleResponse;
import com.glxp.sale.admin.service.auth.CustomerService;
import com.glxp.sale.admin.service.basic.BussinessTypeService;
import com.glxp.sale.admin.service.info.CompanyService;
import com.glxp.sale.admin.service.inout.*;
import com.glxp.sale.admin.service.inventory.InvWarehouseService;
import com.glxp.sale.admin.thread.InvProductsTrService;
import com.glxp.sale.admin.thread.IoTransInoutService;
import com.glxp.sale.admin.util.CustomUtil;
@ -36,6 +40,7 @@ import javax.validation.Valid;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@ -63,6 +68,10 @@ public class OrderController {
CompanyService companyService;
@Value("${file_path}")
private String filePath;
@Resource
InvWarehouseService invWarehouseService;
@Resource
WarehouseUserService warehouseUserService;
@Resource
CustomerService customerService;
@ -169,8 +178,23 @@ public class OrderController {
if (StringUtils.isBlank(orderFilterRequest.getCustomerId())) return ResultVOUtils.success();
CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(orderFilterRequest.getCustomerId()));
if (companyEntity.getUnitIdFk().equals("110")) {
Integer userId = customerService.getUserId();
orderFilterRequest.setFromCorpId(null);
orderFilterRequest.setUserId(customerService.getUserId());
orderFilterRequest.setUserId(userId);
if (StrUtil.isNotEmpty(orderFilterRequest.getLocStorageCode())) {
InvWarehouseEntity invWarehouseEntity = invWarehouseService.selectByCode(orderFilterRequest.getLocStorageCode());
FilterInvUserRequest filterInvUserRequest = new FilterInvUserRequest();
filterInvUserRequest.setCode(invWarehouseEntity.getCode());
filterInvUserRequest.setUserid(userId.longValue());
filterInvUserRequest.setIsDirector(true);
List<WarehouseUserEntity> warehouseUserEntities = warehouseUserService.filterWarehouseUsers(filterInvUserRequest);
if (CollUtil.isEmpty(warehouseUserEntities)) {
orderFilterRequest.setUnionUser(userId);
}
} else {
return ResultVOUtils.error(500, "请先选择当前仓库");
}
} else {
orderFilterRequest.setCustomerId(null);
orderFilterRequest.setFromCorpId(companyEntity.getUnitIdFk());
@ -220,7 +244,7 @@ public class OrderController {
orderFilterRequest.setId(null);
OrderEntity orderEntity = orderService.findById(stockOrderEntity.getOrderIdFk());
if(orderEntity.getReceiveStatus() == ConstantStatus.RECEIVE_ED){
if (orderEntity.getReceiveStatus() == ConstantStatus.RECEIVE_ED) {
return ResultVOUtils.error(500, "单据已验收!");
}
@ -256,6 +280,7 @@ public class OrderController {
OrderEntity orderEntity = orderService.findById(updateExportStatusRequest.getOrderId());
orderEntity.setReceiveStatus(1);
orderEntity.setReviewUser(authAdmin.getId().intValue());
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
List<String> erpIds = DataTransUtil.strToErpList(orderEntity.getErpFk());
if (erpIds != null && erpIds.size() > 0) {
@ -340,6 +365,7 @@ public class OrderController {
orderEntity.setExportStatus(ConstantStatus.ORDER_EXPORT_ED);
orderEntity.setExportFilePath(fileName);
orderService.updateOrder(orderEntity);
orderEntity.setUpdateTime(new Date());
postOrders.add(postOrder);
}
@ -416,6 +442,7 @@ public class OrderController {
docidStr = docidStr.substring(1);
}
mainOrderEntity.setErpFk(docidStr);
mainOrderEntity.setUpdateTime(new Date());
orderService.updateOrder(mainOrderEntity);
// ioTransInoutService.transStatus(mainOrderEntity.getId());
} else {
@ -441,6 +468,7 @@ public class OrderController {
List<WarehouseEntity> warehouseEntityList = codesService.findByReceiptId(orderEntity.getId());
codesTempService.insertCodesTemp(warehouseEntityList);
codesService.deleteByOrderId(orderEntity.getId());
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
return ResultVOUtils.success("单据撤回成功!");

@ -471,6 +471,7 @@ public class OrderDetailController {
if (exitErp != null) {
String errMsg = "所选ERP单" + exitErp.getErpOrderId() + "已被其他出入库单" + exitErp.getOrderIdFk() + "绑定";
orderEntity.setRemark(errMsg);
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
return ResultVOUtils.error(500, errMsg);
} else {
@ -525,6 +526,7 @@ public class OrderDetailController {
//未绑定Id,则更改状态,等待校验
orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_UN);
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK);
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
}
}

@ -1,6 +1,8 @@
package com.glxp.sale.admin.controller.inout;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.sale.admin.annotation.AuthRuleAnnotation;
import com.glxp.sale.admin.constant.Constant;
@ -12,9 +14,11 @@ import com.glxp.sale.admin.entity.basic.StockPrintEntity;
import com.glxp.sale.admin.entity.basic.StockPrinttREntity;
import com.glxp.sale.admin.entity.info.CompanyEntity;
import com.glxp.sale.admin.entity.inout.*;
import com.glxp.sale.admin.entity.inventory.InvWarehouseEntity;
import com.glxp.sale.admin.entity.param.SystemParamConfigEntity;
import com.glxp.sale.admin.exception.JsonException;
import com.glxp.sale.admin.req.inout.*;
import com.glxp.sale.admin.req.inventory.FilterInvUserRequest;
import com.glxp.sale.admin.req.inventory.PostStockPrintRequest;
import com.glxp.sale.admin.res.PageSimpleResponse;
import com.glxp.sale.admin.res.basic.UdiRelevanceResponse;
@ -29,6 +33,7 @@ import com.glxp.sale.admin.service.basic.UdiRelevanceService;
import com.glxp.sale.admin.service.info.CompanyService;
import com.glxp.sale.admin.service.inout.*;
import com.glxp.sale.admin.service.inventory.InvStockPrintService;
import com.glxp.sale.admin.service.inventory.InvWarehouseService;
import com.glxp.sale.admin.service.param.SystemParamConfigService;
import com.glxp.sale.admin.util.CustomUtil;
import com.glxp.sale.admin.util.DateUtil;
@ -91,7 +96,10 @@ public class StockOrderController {
OrderService orderService;
@Resource
CustomerService customerService;
@Resource
InvWarehouseService invWarehouseService;
@Resource
WarehouseUserService warehouseUserService;
@AuthRuleAnnotation("")
@GetMapping("/udiwms/stock/order/error")
@ -282,8 +290,22 @@ public class StockOrderController {
if (StringUtils.isNotBlank(stockOrderFilterRequest.getCorpId())) {
CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(stockOrderFilterRequest.getCorpId()));
if (companyEntity.getUnitIdFk().equals("110")) {
Integer userId = customerService.getUserId();
stockOrderFilterRequest.setUnitIdFk(null);
stockOrderFilterRequest.setUserId(customerService.getUserId());
if (StrUtil.isNotEmpty(stockOrderFilterRequest.getLocStorageCode())) {
InvWarehouseEntity invWarehouseEntity = invWarehouseService.selectByCode(stockOrderFilterRequest.getLocStorageCode());
FilterInvUserRequest filterInvUserRequest = new FilterInvUserRequest();
filterInvUserRequest.setCode(invWarehouseEntity.getCode());
filterInvUserRequest.setUserid(userId.longValue());
filterInvUserRequest.setIsDirector(true);
List<WarehouseUserEntity> warehouseUserEntities = warehouseUserService.filterWarehouseUsers(filterInvUserRequest);
if (CollUtil.isEmpty(warehouseUserEntities)) {
stockOrderFilterRequest.setUnionUser(userId);
}
} else {
return ResultVOUtils.error(500, "请先选择当前仓库");
}
} else
stockOrderFilterRequest.setUnitIdFk(companyEntity.getUnitIdFk());
stockOrderFilterRequest.setCorpId(null);
@ -386,6 +408,7 @@ public class StockOrderController {
originOrder.setActDate(DateUtil.formatDate(new Date()));
originOrder.setFromCorp(addStockOrderChangeRequest.getFromCorp());
originOrder.setFromCorpId(addStockOrderChangeRequest.getFromCorpId());
originOrder.setCorpOrderId(CustomUtil.getId() + "x");
originOrder.setMainAction(addStockOrderChangeRequest.getMainAction());
originOrder.setAction(addStockOrderChangeRequest.getAction());
originOrder.setExportStatus(0); //设置导出状态为未导出

@ -55,10 +55,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.*;
import java.util.stream.Collectors;
@RestController
@ -233,6 +230,7 @@ public class WareHouseController {
}
OrderEntity orderEntity = orderService.findById(commitRequest.getOrderId());
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_PROCESS);
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
return ResultVOUtils.success("提交成功");
}
@ -257,6 +255,7 @@ public class WareHouseController {
orderEntity1.setFromCorpId(addOrderRequest.getFromCorpId());
orderEntity1.setLocStorageCode(addOrderRequest.getLocStorageCode());
orderEntity1.setOutChangeEnable(addOrderRequest.isOutChangeEnable());
orderEntity1.setUpdateTime(new Date());
orderService.updateOrder(orderEntity1);
WarehouseEntity warehouseEntity = new WarehouseEntity();
warehouseEntity.setOrderId(addOrderRequest.getOrderId());

@ -23,6 +23,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
@Service
@ -113,6 +114,7 @@ public class CheckOrderUtils {
orderEntity.setRemark("校验成功");
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS);
orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_SUCCESS);
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
//更新业务单据为已校验
@ -148,6 +150,7 @@ public class CheckOrderUtils {
orderEntity.setRemark(errMsg);
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS);
orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_FAIL);
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
}

@ -28,10 +28,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
@Service
public class ContrastErpUtil {
@ -86,6 +83,7 @@ public class ContrastErpUtil {
if (errMsg != null) {
orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_FAIL);
orderEntity.setRemark(errMsg);
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
return;
}
@ -128,7 +126,7 @@ public class ContrastErpUtil {
//
// }
UdiInfoEntity udiInfoEntity = null;
udiInfoEntity = new InoutUtils(udiUrl).getUdiInfoByRlId(udiInfoService, udiRelevanceService, warehouseEntity.getCode(),udiDlHttpClient);
udiInfoEntity = new InoutUtils(udiUrl).getUdiInfoByRlId(udiInfoService, udiRelevanceService, warehouseEntity.getCode(), udiDlHttpClient);
if (warehouseEntity.getCount() > 1) {
udiInfoEntity.setCount(warehouseEntity.getCount());
}
@ -167,9 +165,11 @@ public class ContrastErpUtil {
if (errMsg != null) {
orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_FAIL);
orderEntity.setRemark(errMsg);
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
} else {
orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_SUCCESS);
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
ioTransInoutService.printOrder(orderEntity.getId());
if (orderEntity.getCustomerId().equals(Constant.SYSTEM_CUSTOMER_ID)) {
@ -179,7 +179,7 @@ public class ContrastErpUtil {
}
if (errorData.size() > 0) {
new InoutUtils(udiUrl).generateConstrastDetail(udiInfoService, udiRelevanceService, orderDetailService, errorData,udiDlHttpClient);
new InoutUtils(udiUrl).generateConstrastDetail(udiInfoService, udiRelevanceService, orderDetailService, errorData, udiDlHttpClient);
}
}

@ -57,7 +57,7 @@ public class InvPreProductsController {
} else {
CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(filterInvProductRequest.getCustomerId()));
filterInvProductRequest.setSupId(companyEntity.getUnitIdFk());
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findDefault(true, true);
// InvWarehouseEntity invWarehouseEntity = invWarehouseService.findDefault(true, true);
filterInvProductRequest.setCustomerId(null);
}
List<InvProductResponse> invProductResponses = invProductService.filterJoinInvProduct(filterInvProductRequest);

@ -17,6 +17,7 @@ import com.glxp.sale.admin.req.info.DeleteRequest;
import com.glxp.sale.admin.req.inventory.FilterCodeTraceRequest;
import com.glxp.sale.admin.req.inventory.FilterInvProductDetailRequest;
import com.glxp.sale.admin.req.inventory.FilterInvProductRequest;
import com.glxp.sale.admin.req.inventory.FilterInvWarehouseRequest;
import com.glxp.sale.admin.res.PageSimpleResponse;
import com.glxp.sale.admin.res.basic.UdiRelevanceResponse;
import com.glxp.sale.admin.res.inventory.InvProductDetailResponse;
@ -100,8 +101,18 @@ public class InvProductsController {
} else {
CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(customerId));
filterInvProductRequest.setSupId(companyEntity.getUnitIdFk());
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findDefault(false, true);
filterInvProductRequest.setInvStorageCode(invWarehouseEntity.getCode());
// InvWarehouseEntity invWarehouseEntity = invWarehouseService.findDefault(false, true);
// filterInvProductRequest.setInvStorageCode(invWarehouseEntity.getCode());
FilterInvWarehouseRequest filterInvWarehouseRequest = new FilterInvWarehouseRequest();
filterInvWarehouseRequest.setSpUse(true);
List<InvWarehouseEntity> invWarehouseEntities = invWarehouseService.filterInvWarehouse(filterInvWarehouseRequest);
List<String> invCodes = new ArrayList<>();
invWarehouseEntities.forEach(warehouseUserEntity -> {
invCodes.add(warehouseUserEntity.getCode());
});
filterInvProductRequest.setInvCodes(invCodes);
filterInvProductRequest.setCustomerId(null);
}
// filterInvProductRequest.setGroupType("invStorageCode");
@ -178,7 +189,27 @@ public class InvProductsController {
@GetMapping("spms/inv/products/stat")
public BaseResponse statInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest) {
if (filterInvProductDetailRequest.getCustomerId() != null && filterInvProductDetailRequest.getCustomerId().equals(SYSTEM_CUSTOMER_ID)) {
String customerId = customerService.getCustomerId() + "";
if (SYSTEM_CUSTOMER_ID.equals(customerId)) {
filterInvProductDetailRequest.setCustomerId(null);
if (StrUtil.isEmpty(filterInvProductDetailRequest.getInvStorageCode())) {
List<WarehouseUserEntity> warehouseUserEntities = warehouseUserService.selectCodeByUser(customerService.getUserId() + "");
if (!warehouseUserEntities.isEmpty()) {
List<String> invCodes = new ArrayList<>();
warehouseUserEntities.forEach(warehouseUserEntity -> {
invCodes.add(warehouseUserEntity.getCode());
});
filterInvProductDetailRequest.setInvCodes(invCodes);
}
}
} else {
CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(customerId));
filterInvProductDetailRequest.setSupId(companyEntity.getUnitIdFk());
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findDefault(false, true);
filterInvProductDetailRequest.setInvStorageCode(invWarehouseEntity.getCode());
filterInvProductDetailRequest.setCustomerId(null);
}
@ -272,7 +303,7 @@ public class InvProductsController {
// }
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
filterInvProductDetailRequest.setCode(filterCodeTraceRequest.getCode());
filterInvProductDetailRequest.setOriginCode(filterCodeTraceRequest.getCode());
filterInvProductDetailRequest.setSupId(filterCodeTraceRequest.getSupId());
List<InvProductDetailEntity> invProductDetailEntities = invProductDetailService.filterInvProduct(filterInvProductDetailRequest);
if (invProductDetailEntities.size() > 0) {
@ -311,11 +342,33 @@ public class InvProductsController {
boolean showSup = false;
if (SYSTEM_CUSTOMER_ID.equals(filterInvProductRequest.getCustomerId())) {
filterInvProductRequest.setCustomerId(null);
if (StrUtil.isEmpty(filterInvProductRequest.getInvStorageCode())) {
List<WarehouseUserEntity> warehouseUserEntities = warehouseUserService.selectCodeByUser(customerService.getUserId() + "");
if (!warehouseUserEntities.isEmpty()) {
List<String> invCodes = new ArrayList<>();
warehouseUserEntities.forEach(warehouseUserEntity -> {
invCodes.add(warehouseUserEntity.getCode());
});
filterInvProductRequest.setInvCodes(invCodes);
}
}
showSup = true;
} else {
CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(filterInvProductRequest.getCustomerId()));
filterInvProductRequest.setSupId(companyEntity.getUnitIdFk());
filterInvProductRequest.setCustomerId(null);
filterInvProductRequest.setSupId(companyEntity.getUnitIdFk());
// InvWarehouseEntity invWarehouseEntity = invWarehouseService.findDefault(false, true);
// filterInvProductRequest.setInvStorageCode(invWarehouseEntity.getCode());
FilterInvWarehouseRequest filterInvWarehouseRequest = new FilterInvWarehouseRequest();
filterInvWarehouseRequest.setSpUse(true);
List<InvWarehouseEntity> invWarehouseEntities = invWarehouseService.filterInvWarehouse(filterInvWarehouseRequest);
List<String> invCodes = new ArrayList<>();
invWarehouseEntities.forEach(warehouseUserEntity -> {
invCodes.add(warehouseUserEntity.getCode());
});
filterInvProductRequest.setInvCodes(invCodes);
}
List<InvProductResponse> invProductResponses;

@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.glxp.sale.admin.annotation.AuthRuleAnnotation;
import com.glxp.sale.admin.constant.BasicProcessStatus;
import com.glxp.sale.admin.constant.ConstantStatus;
import com.glxp.sale.admin.entity.auth.AuthAdmin;
import com.glxp.sale.admin.entity.basic.BasicExportStatusEntity;
import com.glxp.sale.admin.entity.basic.BussinessTypeEntity;
@ -219,6 +220,7 @@ public class InvWarehouseController {
invWarehouseEntity.setLevel(pEntity.getLevel());
invWarehouseEntity.setPcode(pEntity.getPcode());
}
invWarehouseEntity.setUpdateTime(new Date());
boolean b = invWarehouseService.insertInvWarehouse(invWarehouseEntity);
if (!b) {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
@ -239,6 +241,7 @@ public class InvWarehouseController {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
invWarehouseEntity.setPid(null); // 不能修改父级 pid
invWarehouseEntity.setUpdateTime(new Date());
boolean b = invWarehouseService.updateInvWarehouse(invWarehouseEntity);
if (!b) {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
@ -349,6 +352,7 @@ public class InvWarehouseController {
basicExportStatusEntity.setUpdateTime(new Date());
basicExportStatusEntity.setIdDatas(JSON.toJSON(results).toString());
basicExportStatusEntity.setId(CustomUtil.getId());
basicExportStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL);
basicExportService.insertExportStatus(basicExportStatusEntity);
return ResultVOUtils.success("上传成功,等待中继服务下载!");
}

@ -0,0 +1,22 @@
package com.glxp.sale.admin.dao.basic;
import com.glxp.sale.admin.entity.basic.BasicExportStatusEntity;
import com.glxp.sale.admin.entity.basic.BasicExportStatusTimeEntity;
import com.glxp.sale.admin.req.basic.BasicExportStatusRequest;
import com.glxp.sale.admin.req.basic.BasicExportTimeRequest;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface BasicExportTimeDao {
List<BasicExportStatusTimeEntity> filterExportStatus(BasicExportTimeRequest basicExportStatusRequest);
boolean insertExportStatus(BasicExportStatusTimeEntity basicExportStatusTimeEntity);
boolean deleteById(String id);
boolean updateExportStatus(BasicExportStatusTimeEntity basicExportStatusTimeEntity);
}

@ -12,6 +12,8 @@ public interface BussinessLocalTypeDao {
List<BussinessLocalTypeEntity> filterList(BussinessLocalTypeFilterRequest bussinessTypeFilterRequest);
List<BussinessLocalTypeEntity> filterAllList(BussinessLocalTypeFilterRequest bussinessTypeFilterRequest);
List<BussinessLocalTypeEntity> filterJoin(BussinessLocalTypeFilterRequest bussinessTypeFilterRequest);
List<BussinessLocalTypeEntity> filterJoinByUser(BussinessLocalTypeFilterRequest bussinessTypeFilterRequest);

@ -14,6 +14,8 @@ public interface BussinessTypeDao {
List<BussinessTypeEntity> filterList(BussinessTypeFilterRequest bussinessTypeFilterRequest);
List<BussinessTypeEntity> filterAllList(BussinessTypeFilterRequest bussinessTypeFilterRequest);
List<BussinessTypResponse> filterJoinList(BussinessTypeFilterRequest bussinessTypeFilterRequest);
List<BussinessTypeEntity> filterAllByUser(BussinessTypeFilterRequest bussinessTypeFilterRequest);

@ -31,6 +31,8 @@ public interface CompanyProductRelevanceDao {
boolean insertCompanyProductRelevance(CompanyProductRelevanceEntity companyCertEntity);
boolean importCompanyProductRelevance(CompanyProductRelevanceEntity companyProductRelevanceEntity);
boolean deleteById(String id);
boolean deleteByRlId(String id);

@ -16,6 +16,8 @@ public interface OrderDao {
boolean insertOrder(OrderEntity orderEntity);
boolean importOrder(OrderEntity orderEntity);
boolean updateOrder(OrderEntity orderEntity);
List<OrderEntity> listOrderError(OrderQueryRequest orderQueryRequest);
@ -49,5 +51,6 @@ public interface OrderDao {
OrderEntity findOne(OrderFilterRequest orderFilterRequest);
List<OrderEntity> findAllByTime(OrderFilterRequest orderFilterRequest);
}

@ -1,6 +1,7 @@
package com.glxp.sale.admin.dao.inout;
import com.glxp.sale.admin.entity.inout.WarehouseUserEntity;
import com.glxp.sale.admin.req.inventory.FilterInvUserRequest;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -8,6 +9,8 @@ import java.util.List;
public interface WarehouseUserDao {
int deleteByPrimaryKey(Integer id);
List<WarehouseUserEntity> filterWarehouseUsers(FilterInvUserRequest filterInvUserRequest);
int insert(WarehouseUserEntity record);
int insertOrUpdate(WarehouseUserEntity record);

@ -34,4 +34,5 @@ public interface ThrCorpDao {
void importThrCorps(@Param("thrCorpEntities") List<ThrCorpEntity> thrCorpEntities);
void importThrCorp(ThrCorpEntity thrCorpEntity);
}

@ -14,6 +14,8 @@ public interface ThrOrderDao {
boolean insertThrOrder(ThrOrderEntity thrCorpEntity);
boolean importThrOrder(ThrOrderEntity thrCorpEntity);
boolean insertThrOrders(@Param("thrOrderEntities") List<ThrOrderEntity> thrOrderEntities);
boolean updateThrOrder(ThrOrderEntity thrOrderEntity);

@ -14,6 +14,8 @@ public interface ThrOrderDetailDao {
boolean insertThrOrderDetail(ThrOrderDetailEntity thrOrderDetailEntity);
boolean importThrOrderDetail(ThrOrderDetailEntity thrOrderDetailEntity);
boolean insertThrOrderDetails(@Param("thrOrderDetailEntities") List<ThrOrderDetailEntity> thrOrderDetailEntities);
boolean updateThrOrderDetail(ThrOrderDetailEntity thrOrderDetailEntity);

@ -12,4 +12,8 @@ public class BasicExportStatusEntity {
private Integer status;
private Integer type;
private Date updateTime;
private Integer scheduleType;
private Date startTime;
private Date endTime;
private String remark;
}

@ -0,0 +1,13 @@
package com.glxp.sale.admin.entity.basic;
import lombok.Data;
@Data
public class BasicExportStatusTimeEntity {
private Integer id;
private String lastUpdateTime;
private String key;
private String remark;
}

@ -2,6 +2,8 @@ package com.glxp.sale.admin.entity.basic;
import lombok.Data;
import java.util.Date;
@Data
public class BussinessLocalTypeEntity {
@ -23,4 +25,5 @@ public class BussinessLocalTypeEntity {
private boolean genUnit;
private String thirdAction;
private String thirdSys;
private Date updateTime;
}

@ -2,6 +2,8 @@ package com.glxp.sale.admin.entity.basic;
import lombok.Data;
import java.util.Date;
@Data
public class BussinessOriginTypeEntity {
private String id;
@ -12,5 +14,5 @@ public class BussinessOriginTypeEntity {
private Boolean enable;
private String remark;
private String mainAction;
private Date updateTime;
}

@ -2,6 +2,8 @@ package com.glxp.sale.admin.entity.basic;
import lombok.Data;
import java.util.Date;
@Data
public class BussinessTypeEntity {
private Integer id;
@ -50,5 +52,6 @@ public class BussinessTypeEntity {
private boolean changeEnable;
private boolean expireTip;
private Date updateTime;
}

@ -2,6 +2,8 @@ package com.glxp.sale.admin.entity.inout;
import lombok.Data;
import java.util.Date;
@Data
public class OrderEntity {
@ -44,6 +46,6 @@ public class OrderEntity {
private boolean isError;
private boolean outChangeEnable;
private String originUllageSupNo;
private Date updateTime;
}

@ -30,4 +30,7 @@ public class InvWarehouseEntity {
private String thirdId3;
private String thirdId4;
private boolean spUse;
}

@ -5,7 +5,9 @@ import lombok.Data;
@Data
public class BasicExportStatusRequest extends ListPageRequest {
private Integer id;
private String id;
private Integer status;
private Integer type;
private Integer scheduleType;
private String idDatas;
}

@ -0,0 +1,10 @@
package com.glxp.sale.admin.req.basic;
import lombok.Data;
@Data
public class BasicExportTimeRequest {
private Integer id;
private String key;
}

@ -25,6 +25,7 @@ public class BasicUnitMaintainFilterRequest extends ListPageRequest {
private Integer corpType;
private Integer outType;
private Boolean isDownThrSys;
private String lastUpdateTime;
List<ErpUnitsResponse> thrCorpEntities;

@ -3,6 +3,8 @@ package com.glxp.sale.admin.req.basic;
import com.glxp.sale.admin.req.ListPageRequest;
import lombok.Data;
import java.util.Date;
@Data
public class BussinessLocalTypeFilterRequest extends ListPageRequest {
@ -16,5 +18,5 @@ public class BussinessLocalTypeFilterRequest extends ListPageRequest {
private Boolean isFilter;
private String code;
private Integer userId;
private String lastUpdateTime;
}

@ -13,4 +13,5 @@ public class BussinessOriginTypeFilterRequest extends ListPageRequest {
private String thirdAction;
private String mainAction;
private String localAction;
private String lastUpdateTime;
}

@ -19,5 +19,5 @@ public class BussinessTypeFilterRequest extends ListPageRequest {
private Integer userId;
private String filterAction;
private String locInvCode;
private String lastUpdateTime;
}

@ -0,0 +1,9 @@
package com.glxp.sale.admin.req.basic;
import lombok.Data;
@Data
public class SpsSyncDataRequest {
private String lastUpdateTime;
}

@ -11,4 +11,5 @@ public class FilterCompanyProductRelevanceRequest extends ListPageRequest {
private String productUuid;
private String udiRlIdFk;
private String unitFk;
private String lastUpdateTime;
}

@ -31,5 +31,6 @@ public class OrderFilterRequest extends ListPageRequest {
private Integer userId;
private String locStorageCode;
private String lastUpdateTime;
private Integer unionUser;
}

@ -33,5 +33,6 @@ public class StockOrderFilterRequest extends ListPageRequest {
private Integer createUser;
private Integer reviewUser;
private Integer userId;
private Integer unionUser;
}

@ -3,6 +3,8 @@ package com.glxp.sale.admin.req.inventory;
import com.glxp.sale.admin.req.ListPageRequest;
import lombok.Data;
import java.util.List;
@Data
public class FilterInvProductDetailRequest extends ListPageRequest {
@ -26,5 +28,6 @@ public class FilterInvProductDetailRequest extends ListPageRequest {
private String invStorageCode;
private String invWarehouseCode;
private List<String> invCodes;
}

@ -0,0 +1,17 @@
package com.glxp.sale.admin.req.inventory;
import lombok.Data;
@Data
public class FilterInvUserRequest {
private Integer id;
private String code;
private Long userid;
private String username;
private Boolean isDirector;
}

@ -21,5 +21,7 @@ public class FilterInvWarehouseRequest extends ListPageRequest {
private Integer userId;
private String locInvCode;
private Integer status;
private String lastUpdateTime;
private List<Integer> ids;
private Boolean spUse;
}

@ -15,4 +15,5 @@ public class FilterThrCorpRequest extends ListPageRequest {
private String name;
private String key;
List<ErpUnitsResponse> thrCorpEntities;
private String lastUpdateTime;
}

@ -18,4 +18,5 @@ public class FilterThrInvWarehouseRequest extends ListPageRequest {
private String key;
private String pcode;
private Integer level;
private String lastUpdateTime;
}

@ -23,6 +23,7 @@ public class FilterThrOrderRequest extends ListPageRequest {
private String thirdSys;
private Integer editStatus;
private String lastUpdateTime;
private List<ErpOrderResponse> erpOrderResponses;
}

@ -22,4 +22,5 @@ public class FilterThrProductsRequest extends ListPageRequest {
private Integer checkStatus;
private String customerId;
private String supId;
private String lastUpdateTime;
}

@ -0,0 +1,16 @@
package com.glxp.sale.admin.res.basic;
import com.glxp.sale.admin.entity.basic.BussinessLocalTypeEntity;
import com.glxp.sale.admin.entity.basic.BussinessOriginTypeEntity;
import com.glxp.sale.admin.entity.basic.BussinessTypeEntity;
import lombok.Data;
import java.util.List;
@Data
public class SpsSyncBusResponse {
private List<BussinessTypeEntity> bussinessTypeEntities;
private List<BussinessOriginTypeEntity> bussinessOriginTypeEntities;
private List<BussinessLocalTypeEntity> bussinessLocalTypeEntities;
}

@ -0,0 +1,26 @@
package com.glxp.sale.admin.res.basic;
import com.glxp.sale.admin.entity.basic.BasicUnitMaintainEntity;
import com.glxp.sale.admin.entity.basic.UdiInfoEntity;
import com.glxp.sale.admin.entity.basic.UdiRelevanceEntity;
import com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity;
import com.glxp.sale.admin.entity.inventory.InvWarehouseEntity;
import com.glxp.sale.admin.entity.thrsys.*;
import lombok.Data;
import java.util.List;
@Data
public class SpsSyncDataResponse {
List<InvWarehouseEntity> invWarehouseEntities;
List<UdiInfoEntity> udiInfoEntities;
List<BasicUnitMaintainEntity> basicUnitMaintainEntities;
List<ThrInvWarehouseEntity> thrInvWarehouseEntities;
List<ThrCorpEntity> thrCorpEntities;
List<ThrProductsEntity> thrProductsEntities;
List<ThrOrderDetailEntity> thrOrderDetailEntities;
List<ThrOrderEntity> thrOrderEntities;
List<CompanyProductRelevanceEntity> companyProductRelevanceEntities;
List<UdiRelevanceEntity> udiRelevanceEntities;
}

@ -0,0 +1,16 @@
package com.glxp.sale.admin.res.basic;
import com.glxp.sale.admin.entity.inout.ErpOrderEntity;
import com.glxp.sale.admin.entity.inout.OrderEntity;
import com.glxp.sale.admin.entity.inout.WarehouseEntity;
import lombok.Data;
import java.util.List;
@Data
public class SpsSyncOrderResponse {
List<OrderEntity> orderEntities;
List<ErpOrderEntity> orderDetailEntityList;
List<WarehouseEntity> warehouseEntityList;
}

@ -23,6 +23,7 @@ public class InvWarehouseResponse {
private Integer level;
private String pcode;
private boolean spUse;
private List<InvWarehouseResponse> children;
}

@ -9,6 +9,8 @@ import java.util.List;
public interface BasicExportService {
BasicExportStatusEntity findByData(String idDatas, Integer status);
List<BasicExportStatusEntity> filterExportStatus(BasicExportStatusRequest basicExportStatusRequest);
boolean insertExportStatus(BasicExportStatusEntity ioOrderStatusEntity);

@ -0,0 +1,18 @@
package com.glxp.sale.admin.service.basic;
import com.glxp.sale.admin.entity.basic.BasicExportStatusTimeEntity;
import com.glxp.sale.admin.req.basic.BasicExportTimeRequest;
import java.util.List;
public interface BasicExportTimeService {
List<BasicExportStatusTimeEntity> filterExportStatus(BasicExportTimeRequest basicExportStatusRequest);
boolean insertExportStatus(BasicExportStatusTimeEntity basicExportStatusTimeEntity);
boolean deleteById(String id);
boolean updateExportStatus(BasicExportStatusTimeEntity basicExportStatusTimeEntity);
}

@ -11,6 +11,8 @@ public interface BussinessLocalTypeService {
List<BussinessLocalTypeEntity> filterList(BussinessLocalTypeFilterRequest bussinessTypeFilterRequest);
List<BussinessLocalTypeEntity> filterAllList(BussinessLocalTypeFilterRequest bussinessTypeFilterRequest);
List<BussinessLocalTypeEntity> filterJoin(BussinessLocalTypeFilterRequest bussinessTypeFilterRequest);
List<BussinessLocalTypeEntity> filterJoinByUser(BussinessLocalTypeFilterRequest bussinessTypeFilterRequest);

@ -11,6 +11,8 @@ public interface BussinessTypeService {
List<BussinessTypeEntity> filterList(BussinessTypeFilterRequest bussinessTypeFilterRequest);
List<BussinessTypeEntity> filterAllList(BussinessTypeFilterRequest bussinessTypeFilterRequest);
List<BussinessTypResponse> filterJoinList(BussinessTypeFilterRequest bussinessTypeFilterRequest);
List<BussinessTypeEntity> filterAllByUser(BussinessTypeFilterRequest bussinessTypeFilterRequest);

@ -1,5 +1,6 @@
package com.glxp.sale.admin.service.basic.impl;
import cn.hutool.core.collection.CollUtil;
import com.github.pagehelper.PageHelper;
import com.glxp.sale.admin.dao.basic.BasicExportDao;
import com.glxp.sale.admin.entity.basic.BasicExportStatusEntity;
@ -17,6 +18,18 @@ public class BasicExportServiceImpl implements BasicExportService {
@Resource
BasicExportDao basicExportDao;
@Override
public BasicExportStatusEntity findByData(String idDatas, Integer status) {
BasicExportStatusRequest basicExportStatusRequest = new BasicExportStatusRequest();
basicExportStatusRequest.setStatus(status);
basicExportStatusRequest.setIdDatas(idDatas);
List<BasicExportStatusEntity> basicExportStatusEntities = basicExportDao.filterExportStatus(basicExportStatusRequest);
if (CollUtil.isNotEmpty(basicExportStatusEntities)) {
return basicExportStatusEntities.get(0);
}
return null;
}
@Override
public List<BasicExportStatusEntity> filterExportStatus(BasicExportStatusRequest basicExportStatusRequest) {
if (basicExportStatusRequest == null) {

@ -0,0 +1,48 @@
package com.glxp.sale.admin.service.basic.impl;
import cn.hutool.core.collection.CollUtil;
import com.github.pagehelper.PageHelper;
import com.glxp.sale.admin.dao.basic.BasicExportDao;
import com.glxp.sale.admin.dao.basic.BasicExportTimeDao;
import com.glxp.sale.admin.entity.basic.BasicExportStatusEntity;
import com.glxp.sale.admin.entity.basic.BasicExportStatusTimeEntity;
import com.glxp.sale.admin.req.basic.BasicExportStatusRequest;
import com.glxp.sale.admin.req.basic.BasicExportTimeRequest;
import com.glxp.sale.admin.service.basic.BasicExportTimeService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Service
public class BasicExportTimeServiceImpl implements BasicExportTimeService {
@Resource
BasicExportTimeDao basicExportTimeDao;
@Override
public List<BasicExportStatusTimeEntity> filterExportStatus(BasicExportTimeRequest basicExportStatusRequest) {
if (basicExportStatusRequest == null) {
return Collections.emptyList();
}
return basicExportTimeDao.filterExportStatus(basicExportStatusRequest);
}
@Override
public boolean insertExportStatus(BasicExportStatusTimeEntity basicExportStatusTimeEntity) {
return basicExportTimeDao.insertExportStatus(basicExportStatusTimeEntity);
}
@Override
public boolean deleteById(String id) {
return basicExportTimeDao.deleteById(id);
}
@Override
public boolean updateExportStatus(BasicExportStatusTimeEntity basicExportStatusTimeEntity) {
return basicExportTimeDao.updateExportStatus(basicExportStatusTimeEntity);
}
}

@ -30,6 +30,12 @@ public class BussinessLocalTypeServiceImpl implements BussinessLocalTypeService
return data;
}
@Override
public List<BussinessLocalTypeEntity> filterAllList(BussinessLocalTypeFilterRequest bussinessTypeFilterRequest) {
List<BussinessLocalTypeEntity> data = bussinessLocalTypeDao.filterAllList(bussinessTypeFilterRequest);
return data;
}
@Override
public List<BussinessLocalTypeEntity> filterJoin(BussinessLocalTypeFilterRequest bussinessTypeFilterRequest) {
if (bussinessTypeFilterRequest == null) {

@ -37,6 +37,12 @@ public class BussinessTypeServiceImpl implements BussinessTypeService {
return data;
}
@Override
public List<BussinessTypeEntity> filterAllList(BussinessTypeFilterRequest bussinessTypeFilterRequest) {
List<BussinessTypeEntity> data = bussinessTypeDao.filterAllList(bussinessTypeFilterRequest);
return data;
}
@Override
public List<BussinessTypResponse> filterJoinList(BussinessTypeFilterRequest bussinessTypeFilterRequest) {
if (bussinessTypeFilterRequest == null) {
@ -116,7 +122,7 @@ public class BussinessTypeServiceImpl implements BussinessTypeService {
@Override
public boolean insertBussinessType(BussinessTypeEntity bussinessTypeEntity) {
if (!StrUtil.isEmpty(bussinessTypeEntity.getSupplementOrderType())){
if (!StrUtil.isEmpty(bussinessTypeEntity.getSupplementOrderType())) {
BussinessTypeEntity correspondType = bussinessTypeDao.selectByAction(bussinessTypeEntity.getSupplementOrderType());
if (correspondType != null && correspondType.getCorpType() == 1) {
bussinessTypeDao.updateSupplementOrderType(bussinessTypeEntity.getSupplementOrderType(), bussinessTypeEntity.getAction());

@ -54,6 +54,8 @@ public interface OrderService {
List<OrderEntity> filterListByCode(List<WarehouseEntity> warehouseEntityList);
List<OrderEntity> findAllByTime(OrderFilterRequest orderFilterRequest);
/**
*
*

@ -2,6 +2,7 @@ package com.glxp.sale.admin.service.inout;
import com.glxp.sale.admin.entity.auth.AuthAdmin;
import com.glxp.sale.admin.entity.inout.WarehouseUserEntity;
import com.glxp.sale.admin.req.inventory.FilterInvUserRequest;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -16,8 +17,9 @@ public interface WarehouseUserService {
*/
List<WarehouseUserEntity> getListByCode(String code);
List<WarehouseUserEntity> selectCodeByUser( String userId);
List<WarehouseUserEntity> selectCodeByUser(String userId);
List<WarehouseUserEntity> filterWarehouseUsers(FilterInvUserRequest filterInvUserRequest);
/**
*

@ -188,6 +188,11 @@ public class OrderServiceImpl implements OrderService {
return orderDao.filterListByCode(warehouseEntityList);
}
@Override
public List<OrderEntity> findAllByTime(OrderFilterRequest orderFilterRequest) {
return orderDao.findAllByTime(orderFilterRequest);
}
@Override
public BaseResponse supplementOrder(String billNo, String orderIdFk) {
//查询订单数据
@ -221,7 +226,7 @@ public class OrderServiceImpl implements OrderService {
supplementOrder.setExportStatus(0); //设置导出状态为未导出
supplementOrder.setContrastStatus(0);//设置erp校验状态为未校验
supplementOrder.setReceiveStatus(0); //设置验收状态为未验收
supplementOrder.setCorpOrderId(CustomUtil.getId()+"x");
//修改往来单位及当前库存号
supplementOrder.setFromCorpId(order.getLocStorageCode());
supplementOrder.setLocStorageCode(order.getFromCorpId());

@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
import com.glxp.sale.admin.dao.inout.WarehouseUserDao;
import com.glxp.sale.admin.entity.auth.AuthAdmin;
import com.glxp.sale.admin.entity.inout.WarehouseUserEntity;
import com.glxp.sale.admin.req.inventory.FilterInvUserRequest;
import com.glxp.sale.admin.service.inout.WarehouseUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@ -35,6 +36,14 @@ public class WarehouseUserServiceImpl implements WarehouseUserService {
return warehouseUserDao.selectCodeByUser(userId);
}
@Override
public List<WarehouseUserEntity> filterWarehouseUsers(FilterInvUserRequest filterInvUserRequest) {
List<WarehouseUserEntity> warehouseUserEntities = warehouseUserDao.filterWarehouseUsers(filterInvUserRequest);
return warehouseUserEntities;
}
@Override
public void saveWarehouseUser(String code, List<AuthAdmin> userList) {

@ -0,0 +1,128 @@
package com.glxp.sale.admin.thread;
import com.glxp.sale.admin.constant.BasicProcessStatus;
import com.glxp.sale.admin.dao.info.ScheduledDao;
import com.glxp.sale.admin.entity.basic.BasicExportStatusEntity;
import com.glxp.sale.admin.entity.info.ScheduledEntity;
import com.glxp.sale.admin.entity.param.SystemParamConfigEntity;
import com.glxp.sale.admin.req.udid.ScheduledRequest;
import com.glxp.sale.admin.service.basic.BasicExportService;
import com.glxp.sale.admin.service.param.SystemParamConfigService;
import com.glxp.sale.admin.util.CustomUtil;
import com.glxp.sale.admin.util.RedisUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
import org.springframework.scheduling.support.CronTrigger;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Date;
@Component
@EnableScheduling
public class AsyncHeartTask implements SchedulingConfigurer {
final Logger logger = LoggerFactory.getLogger(AsyncHeartTask.class);
@Resource
protected ScheduledDao scheduledDao;
@Resource
SystemParamConfigService systemParamConfigService;
@Resource
RedisUtil redisUtil;
@Resource
BasicExportService basicExportService;
@Override
public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) {
scheduledTaskRegistrar.addTriggerTask(() -> process(),
triggerContext -> {
ScheduledRequest scheduledRequest = new ScheduledRequest();
scheduledRequest.setCronName("heartTask");
ScheduledEntity scheduledEntity = scheduledDao.findScheduled(scheduledRequest);
String cron = scheduledEntity.getCron();
if (cron.isEmpty()) {
logger.error("cron is null");
}
return new CronTrigger(cron).nextExecutionTime(triggerContext);
});
}
private void process() {
SystemParamConfigEntity downConnect = systemParamConfigService.selectByParamKey("sync_downstream_enable");
if (downConnect.getParamValue().equals("1")) {
//定时同步最近更新数据至任务表,等待下载
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("sps_sync_gen_data");
long timeInterval = Long.parseLong(systemParamConfigEntity.getParamValue()) * 60 * 1000;
long curTime = System.currentTimeMillis();
Long lastTime = (Long) redisUtil.get("SPS_SYNC_GEN_DATA");
if (lastTime == null) {
lastTime = System.currentTimeMillis();
redisUtil.set("SPS_SYNC_GEN_DATA", lastTime);
}
if (curTime - lastTime > timeInterval) {
//自动创建要求被下载已完成单据任务
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);
}
//自动创建要求被下载单据类型任务
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);
}
//自动创建要求被下载基础信息任务
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);
}
redisUtil.set("SPS_SYNC_GEN_DATA", curTime);
}
}
}
}

@ -0,0 +1,54 @@
package com.glxp.sale.admin.thread;
import com.glxp.sale.admin.constant.BasicProcessStatus;
import com.glxp.sale.admin.dao.info.ScheduledDao;
import com.glxp.sale.admin.entity.basic.BasicExportStatusEntity;
import com.glxp.sale.admin.entity.info.ScheduledEntity;
import com.glxp.sale.admin.req.udid.ScheduledRequest;
import com.glxp.sale.admin.service.basic.BasicExportService;
import com.glxp.sale.admin.util.CustomUtil;
import com.glxp.sale.admin.util.DateUtil;
import com.glxp.sale.admin.util.RedisUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
import org.springframework.scheduling.support.CronTrigger;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Date;
@Component
@EnableScheduling
public class AsyncSpsDataTask implements SchedulingConfigurer {
final Logger logger = LoggerFactory.getLogger(AsyncSpsDataTask.class);
@Resource
private ScheduledDao scheduledDao;
@Resource
BasicExportService basicExportService;
@Override
public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) {
scheduledTaskRegistrar.addTriggerTask(() -> process(),
triggerContext -> {
ScheduledRequest scheduledRequest = new ScheduledRequest();
scheduledRequest.setCronName("syncSpsData");
ScheduledEntity scheduledEntity = scheduledDao.findScheduled(scheduledRequest);
String cron = scheduledEntity.getCron();//"0 55 5 * * ?";
if (cron.isEmpty()) {
logger.error("cron is null");
}
return new CronTrigger(cron).nextExecutionTime(triggerContext);
});
}
private void process() {
}
}

@ -126,6 +126,7 @@ public class BasicGenExcelService {
basicExportStatusEntity.setUpdateTime(new Date());
basicExportStatusEntity.setIdDatas(JSON.toJSON(results).toString());
basicExportStatusEntity.setId(CustomUtil.getId());
basicExportStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL);
basicExportService.insertExportStatus(basicExportStatusEntity);
corpExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
corpExportLogService.updateCorpExportLog(corpExportLogEntity);
@ -454,6 +455,7 @@ public class BasicGenExcelService {
basicExportStatusEntity.setUpdateTime(new Date());
basicExportStatusEntity.setIdDatas(JSON.toJSON(results).toString());
basicExportStatusEntity.setId(CustomUtil.getId());
basicExportStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL);
basicExportService.insertExportStatus(basicExportStatusEntity);
udiInfoExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
udiInfoExportLogService.updateUdiInfoExportLog(udiInfoExportLogEntity);

@ -199,8 +199,10 @@ public class InvProductsTrService {
List<WarehouseEntity> temps = filterMapCodes(datas);
// insetInv(bussinessTypeEntity.isAdvanceType(), mInvProductDetailEntities);//2.插入当前库存
buildPreInOrder(bussinessChangeTypeEntity, temps, orderEntity); //3.生成流转单据
} else {
insetInv(bussinessTypeEntity.isAdvanceType(), mInvProductDetailEntities);//2.插入当前库存
}
}else {
} else {
insetInv(bussinessTypeEntity.isAdvanceType(), mInvProductDetailEntities);//2.插入当前库存
}
@ -498,7 +500,6 @@ public class InvProductsTrService {
InvWarehouseEntity invWarehouseEntity = invWarehouseService.selectByCode(orderEntity.getLocStorageCode());
InvWarehouseEntity defaultWarehouseEntity = invWarehouseService.findDefault(true, true);
//寄售出库生成单据
CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(Constant.SYSTEM_CUSTOMER_ID));
OrderEntity outOrder = new OrderEntity();
BeanUtils.copyProperties(orderEntity, outOrder);
outOrder.setActDate(DateUtil.getBeforeDay(outOrder.getActDate(), bussinessChangeTypeEntity.getBeforeTime()));
@ -515,6 +516,7 @@ public class InvProductsTrService {
outOrder.setErpFk(null);
outOrder.setCustomerId(Constant.SYSTEM_CUSTOMER_ID);
outOrder.setId("SM" + CustomUtil.getId());
outOrder.setCorpOrderId(CustomUtil.getId()+"x");
outOrder.setFromCorp(invWarehouseEntity.getName());
outOrder.setFromCorpId(invWarehouseEntity.getCode());
outOrder.setLocStorageCode(defaultWarehouseEntity.getCode());
@ -584,9 +586,10 @@ public class InvProductsTrService {
outOrder.setFromCorp(basicUnitMaintainEntity.getName());
outOrder.setFromCorpId(corpName);
outOrder.setLocStorageCode(orderEntity.getLocStorageCode());
outOrder.setCorpOrderId(CustomUtil.getId()+"x");
//互填单号
orderEntity.setUllageSupNo(outOrder.getId());
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
outOrder.setOriginUllageSupNo(orderEntity.getId());
@ -630,6 +633,7 @@ public class InvProductsTrService {
//互填单号
orderEntity.setUllageSupNo(outOrder.getId());
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
outOrder.setOriginUllageSupNo(orderEntity.getId());
@ -687,6 +691,7 @@ public class InvProductsTrService {
outOrder.setId("SM" + CustomUtil.getId());
outOrder.setFromCorpId(corpName);
outOrder.setFromCorp(temps.get(0).getFromCorp());
outOrder.setCorpOrderId(CustomUtil.getId()+"x");
outOrder.setLocStorageCode(orderEntity.getLocStorageCode());
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("additional_auto_submit");
if ("1".equals(systemParamConfigEntity.getParamValue())) {
@ -697,6 +702,7 @@ public class InvProductsTrService {
//互填单号
orderEntity.setUllageSupNo(outOrder.getId());
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
outOrder.setOriginUllageSupNo(orderEntity.getId());
@ -716,115 +722,6 @@ public class InvProductsTrService {
}
//生成普通入库单据
public void buildInOrder2(BussinessChangeTypeEntity
bussinessChangeTypeEntity, List<WarehouseEntity> useInList, OrderEntity orderEntity) {
if (useInList.size() <= 0) {
return;
}
//采购入库生成单据
Map<String, List<WarehouseEntity>> filterSupMaps = new HashMap<>();
List<WarehouseEntity> unkonwCorpList = new ArrayList<>();
// InvWarehouseEntity invWarehouseEntity = invWarehouseService.findDefault(false, true);
//根据库存,过滤供应商,条码分组
for (WarehouseEntity warehouseEntity : useInList) {
if (warehouseEntity.getSupId() != null) {
if (filterSupMaps.get(warehouseEntity.getSupId()) == null) {
List<WarehouseEntity> temps = new ArrayList<>();
temps.add(warehouseEntity);
filterSupMaps.put(warehouseEntity.getSupId(), temps);
} else {
filterSupMaps.get(warehouseEntity.getSupId()).add(warehouseEntity);
}
} else
unkonwCorpList.add(warehouseEntity);
}
//有供应商生成采购入库单据
for (String corpName : filterSupMaps.keySet()) {
List<WarehouseEntity> temps;
temps = filterSupMaps.get(corpName);
OrderEntity outOrder = new OrderEntity();
BeanUtils.copyProperties(orderEntity, outOrder);
outOrder.setActDate(DateUtil.getBeforeDay(outOrder.getActDate(), bussinessChangeTypeEntity.getBeforeTime()));
outOrder.setAction(bussinessChangeTypeEntity.getScAction());
outOrder.setMainAction(ConstantType.TYPE_PUT);
outOrder.setContrastStatus(ConstantStatus.ORDER_CHECK_UN);
outOrder.setCustomerId(Constant.SYSTEM_CUSTOMER_ID);
outOrder.setErpFk(null);
outOrder.setFromType(ConstantStatus.FROM_CHANGE);
outOrder.setId("SM" + CustomUtil.getId());
BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByErpId(corpName);
outOrder.setFromCorp(basicUnitMaintainEntity.getName());
outOrder.setFromCorpId(corpName);
outOrder.setLocStorageCode(orderEntity.getLocStorageCode());
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("additional_auto_submit");
if ("1".equals(systemParamConfigEntity.getParamValue())) {
outOrder.setStatus(ConstantStatus.ORDER_STATUS_PROCESS);
} else {
outOrder.setStatus(ConstantStatus.ORDER_STATUS_ADDITIONAL);
}
//互填单号
orderEntity.setUllageSupNo(outOrder.getId());
orderService.updateOrder(orderEntity);
outOrder.setOriginUllageSupNo(orderEntity.getId());
orderService.insertOrder(outOrder);
for (WarehouseEntity warehouseEntity : temps) {
warehouseEntity.setOrderId(outOrder.getId());
warehouseEntity.setId(null);
warehouseEntity.setFromCorp(outOrder.getFromCorp());
warehouseEntity.setFromCorpId(outOrder.getFromCorpId());
warehouseEntity.setLocStorageCode(outOrder.getLocStorageCode());
warehouseEntity.setAction(bussinessChangeTypeEntity.getScAction());
warehouseEntity.setMainAction(ConstantType.TYPE_PUT);
}
codesTempService.insertCodesTemp(temps);
// ioTransInoutService.transInout(outOrder.getId());
}
//无供应商,一个条码生成一个错误单据,到时候利用单据合并生成同一个单据
for (WarehouseEntity warehouseEntity : unkonwCorpList) {
OrderEntity outOrder = new OrderEntity();
BeanUtils.copyProperties(orderEntity, outOrder);
outOrder.setActDate(DateUtil.getBeforeDay(outOrder.getActDate(), bussinessChangeTypeEntity.getBeforeTime()));
outOrder.setAction(bussinessChangeTypeEntity.getScAction());
outOrder.setMainAction(ConstantType.TYPE_PUT);
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("additional_auto_submit");
if ("1".equals(systemParamConfigEntity.getParamValue())) {
outOrder.setStatus(ConstantStatus.ORDER_STATUS_PROCESS);
} else {
outOrder.setStatus(ConstantStatus.ORDER_STATUS_ADDITIONAL);
}
outOrder.setContrastStatus(ConstantStatus.ORDER_CHECK_UN);
outOrder.setRemark("未选择供应商");
outOrder.setErpFk(null);
outOrder.setId("SM" + CustomUtil.getId());
outOrder.setFromCorp(null);
outOrder.setLocStorageCode(orderEntity.getLocStorageCode());
outOrder.setFromCorpId(null);
//互填单号
orderEntity.setUllageSupNo(outOrder.getId());
orderService.updateOrder(orderEntity);
outOrder.setOriginUllageSupNo(orderEntity.getId());
orderService.insertOrder(outOrder);
warehouseEntity.setOrderId(outOrder.getId());
warehouseEntity.setId(null);
warehouseEntity.setAction(bussinessChangeTypeEntity.getScAction());
warehouseEntity.setMainAction(ConstantType.TYPE_PUT);
warehouseEntity.setFromCorp(null);
warehouseEntity.setFromCorpId(null);
warehouseEntity.setLocStorageCode(outOrder.getLocStorageCode());
codesTempService.insertCodesTempSingle(warehouseEntity);
}
}
//生成寄售转入单据
public void buildNorPreInOrder(BussinessChangeTypeEntity
@ -867,6 +764,7 @@ public class InvProductsTrService {
outOrder.setCustomerId(Constant.SYSTEM_CUSTOMER_ID);
outOrder.setFromCorp(temps.get(0).getFromCorp());
outOrder.setFromCorpId(temps.get(0).getFromCorpId());
outOrder.setCorpOrderId(CustomUtil.getId()+"x");
outOrder.setLocStorageCode(orderEntity.getLocStorageCode());
outOrder.setErpFk(null);
outOrder.setFromType(ConstantStatus.FROM_CHANGE);
@ -883,6 +781,7 @@ public class InvProductsTrService {
//互填单号
orderEntity.setUllageSupNo(outOrder.getId());
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
outOrder.setOriginUllageSupNo(orderEntity.getId());
@ -903,111 +802,6 @@ public class InvProductsTrService {
}
//生成寄售转入单据
public void buildNorPreInOrder2(BussinessChangeTypeEntity
bussinessChangeTypeEntity, List<WarehouseEntity> useInList, OrderEntity orderEntity) {
if (useInList.size() <= 0) {
return;
}
//采购入库生成单据
Map<String, List<WarehouseEntity>> filterSupMaps = new HashMap<>();
List<WarehouseEntity> unkonwCorpList = new ArrayList<>();
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findDefault(true, true);
//根据库存,过滤供应商,条码分组
for (WarehouseEntity warehouseEntity : useInList) {
if (warehouseEntity.getSupId() != null) {
if (filterSupMaps.get(warehouseEntity.getSupId()) == null) {
List<WarehouseEntity> temps = new ArrayList<>();
temps.add(warehouseEntity);
filterSupMaps.put(warehouseEntity.getSupId(), temps);
} else {
filterSupMaps.get(warehouseEntity.getSupId()).add(warehouseEntity);
}
} else
unkonwCorpList.add(warehouseEntity);
}
//有供应商生成采购入库单据
for (String corpName : filterSupMaps.keySet()) {
List<WarehouseEntity> temps;
temps = filterSupMaps.get(corpName);
OrderEntity outOrder = new OrderEntity();
BeanUtils.copyProperties(orderEntity, outOrder);
outOrder.setActDate(DateUtil.getBeforeDay(outOrder.getActDate(), bussinessChangeTypeEntity.getBeforeTime()));
outOrder.setAction(bussinessChangeTypeEntity.getScAction());
outOrder.setMainAction(ConstantType.TYPE_PUT);
outOrder.setContrastStatus(ConstantStatus.ORDER_CHECK_UN);
outOrder.setCustomerId(Constant.SYSTEM_CUSTOMER_ID);
outOrder.setFromCorp(invWarehouseEntity.getName());
outOrder.setFromCorpId(invWarehouseEntity.getCode());
outOrder.setLocStorageCode(orderEntity.getLocStorageCode());
outOrder.setErpFk(null);
outOrder.setFromType(ConstantStatus.FROM_CHANGE);
outOrder.setId("SM" + CustomUtil.getId());
// BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByErpId(corpName);
// outOrder.setFromCorp(basicUnitMaintainEntity.getName());
// outOrder.setFromCorpId(corpName);
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("additional_auto_submit");
if ("1".equals(systemParamConfigEntity.getParamValue())) {
outOrder.setStatus(ConstantStatus.ORDER_STATUS_PROCESS);
} else {
outOrder.setStatus(ConstantStatus.ORDER_STATUS_ADDITIONAL);
}
//互填单号
orderEntity.setUllageSupNo(outOrder.getId());
orderService.updateOrder(orderEntity);
outOrder.setOriginUllageSupNo(orderEntity.getId());
orderService.insertOrder(outOrder);
for (WarehouseEntity warehouseEntity : temps) {
warehouseEntity.setOrderId(outOrder.getId());
warehouseEntity.setId(null);
warehouseEntity.setFromCorp(outOrder.getFromCorp());
warehouseEntity.setFromCorpId(outOrder.getFromCorpId());
warehouseEntity.setLocStorageCode(outOrder.getLocStorageCode());
warehouseEntity.setAction(bussinessChangeTypeEntity.getScAction());
warehouseEntity.setMainAction(ConstantType.TYPE_PUT);
}
codesTempService.insertCodesTemp(temps);
// ioTransInoutService.transInout(outOrder.getId());
}
//无供应商,一个条码生成一个错误单据,到时候利用单据合并生成同一个单据
for (WarehouseEntity warehouseEntity : unkonwCorpList) {
OrderEntity outOrder = new OrderEntity();
BeanUtils.copyProperties(orderEntity, outOrder);
outOrder.setActDate(DateUtil.getBeforeDay(outOrder.getActDate(), bussinessChangeTypeEntity.getBeforeTime()));
outOrder.setAction(bussinessChangeTypeEntity.getScAction());
outOrder.setMainAction(ConstantType.TYPE_PUT);
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("additional_auto_submit");
if ("1".equals(systemParamConfigEntity.getParamValue())) {
outOrder.setStatus(ConstantStatus.ORDER_STATUS_PROCESS);
} else {
outOrder.setStatus(ConstantStatus.ORDER_STATUS_ADDITIONAL);
}
outOrder.setContrastStatus(ConstantStatus.ORDER_CHECK_UN);
outOrder.setRemark("未选择供应商");
outOrder.setErpFk(null);
outOrder.setId("SM" + CustomUtil.getId());
outOrder.setFromCorp(invWarehouseEntity.getName());
outOrder.setFromCorpId(invWarehouseEntity.getCode());
outOrder.setLocStorageCode(orderEntity.getLocStorageCode());
orderService.insertOrder(outOrder);
warehouseEntity.setOrderId(outOrder.getId());
warehouseEntity.setId(null);
warehouseEntity.setAction(bussinessChangeTypeEntity.getScAction());
warehouseEntity.setMainAction(ConstantType.TYPE_PUT);
warehouseEntity.setFromCorp(outOrder.getFromCorp());
warehouseEntity.setFromCorpId(outOrder.getFromCorpId());
warehouseEntity.setLocStorageCode(outOrder.getLocStorageCode());
codesTempService.insertCodesTempSingle(warehouseEntity);
}
}
//生成库存
@ -1153,30 +947,6 @@ public class InvProductsTrService {
return 1;
}
public int getActCount(String code) {
UdiEntity udiEntity = FilterUdiUtils.getUdi(code);
UdiRelevanceResponse udiInfoBean = udiRelevanceService.selectByNameCode(udiEntity.getUdi());
if (udiInfoBean != null) {
if (udiInfoBean.getIsUseDy() == 1 && udiInfoBean.getDiType() != 2) {
if (udiInfoBean.getBhzxxsbzsl() == 0)
return udiInfoBean.getZxxsbzbhsydysl();
else
return udiInfoBean.getZxxsbzbhsydysl() * udiInfoBean.getBhzxxsbzsl();
} else {
return udiInfoBean.getBhzxxsbzsl();
}
}
return 1;
}
public boolean isMutiPack(WarehouseEntity warehouseEntity) {
UdiRelevanceResponse udiInfoBean = udiRelevanceService.selectByNameCode(warehouseEntity.getNameCode());
List<UdiInfoEntity> udiInfoEntities = udiInfoService.findByUuids(udiInfoBean.getUuid());
if (udiInfoBean != null && udiInfoEntities.size() > 1) {
return true;
}
return false;
}
public UdiInfoEntity getMinDi(WarehouseEntity warehouseEntity) {
UdiRelevanceResponse udiInfoBean = udiRelevanceService.selectByNameCode(warehouseEntity.getNameCode());

@ -63,6 +63,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Service
@ -312,13 +313,21 @@ public class IoTransInoutService {
public void transInout(OrderEntity orderEntity) {
orderEntity.setRemark("正在处理!");
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_DOING);
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
OrderFilterRequest orderFilterRequest = new OrderFilterRequest();
orderFilterRequest.setCorpOrderId(orderEntity.getCorpOrderId());
orderFilterRequest.setCustomerId(orderEntity.getCustomerId());
List<OrderEntity> orderEntities = orderService.findAllOrders(orderFilterRequest);
if (orderEntities.size() > 1) {
orderEntity.setRemark("单据重复上传");
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_FAIL);
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
return;
}
@ -329,6 +338,7 @@ public class IoTransInoutService {
if (orderEntity.getFromCorp() == null) {
orderEntity.setRemark("未选择往来单位");
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_FAIL);
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
return;
} else if (orderEntity.getFromCorpId() == null) {
@ -340,6 +350,7 @@ public class IoTransInoutService {
basicUnitMaintainEntity.setOutType(ConstantStatus.CORP_SICK_SICK);
basicUnitMaintainEntity.setName(orderEntity.getFromCorp());
orderEntity.setFromCorpId(basicUnitMaintainEntity.getErpId());
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
basicUnitMaintainService.insertBasicUnitMaintain(basicUnitMaintainEntity);
}
@ -347,6 +358,7 @@ public class IoTransInoutService {
if (basicUnitMaintainEntity == null) {
orderEntity.setRemark("未选择往来单位");
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_FAIL);
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
return;
} else {
@ -365,10 +377,12 @@ public class IoTransInoutService {
} else {
orderEntity.setRemark("未选择当前仓库信息");
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_FAIL);
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
return;
}
}
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
for (int j = 0; j < filterList.size(); j++) {
@ -542,6 +556,7 @@ public class IoTransInoutService {
}
warehouseService.updateCode(warehouseEntity);
}
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
if (!bussinessTypeEntity.isCheckEnable()) {
@ -608,6 +623,7 @@ public class IoTransInoutService {
}
orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_SUCCESS);
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS);
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
// orderService.updateOrderStatus(orderEntity.getId(), ConstantStatus.ORDER_STATUS_SUCCESS);
// if (orderEntity.getCustomerId() == null && orderEntity.getCustomerId().equals(Constant.SYSTEM_CUSTOMER_ID)) {
@ -731,7 +747,7 @@ public class IoTransInoutService {
}
public void genOrderDetail(List<WarehouseEntity> warehouseEntityList) {
new InoutUtils(udiUrl).generateConstrastDetail(udiInfoService, udiRelevanceService, myErpOrderService, warehouseEntityList,udiDlHttpClient);
new InoutUtils(udiUrl).generateConstrastDetail(udiInfoService, udiRelevanceService, myErpOrderService, warehouseEntityList, udiDlHttpClient);
}
@ -812,10 +828,12 @@ public class IoTransInoutService {
stockOrderDetailService.insertStockOrderDetails(stockOrderDetailEntities);
orderEntity.setRemark("");
orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_UN);
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
} else {
orderEntity.setRemark("该产品DI绑定多个产品ID请在扫码单据详情绑定对应产品ID");
orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_FAIL);
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
}
}

@ -14,7 +14,7 @@ public class CustomUtil {
String id = System.currentTimeMillis() + "";
int number = new Random().nextInt(90) + 10;
id = id + number;
return id.substring(4);
return id.substring(1);
}
//随机生成往来单位ID
@ -22,7 +22,7 @@ public class CustomUtil {
String id = System.currentTimeMillis() + "";
int number = new Random().nextInt(90) + 10;
id = id + number;
return "HZ" + id.substring(4);
return "HZ" + id.substring(1);
}
public static <T> List<List<T>> splitList(List<T> list, int len) {

@ -1,10 +1,10 @@
# \u751F\u4EA7\u73AF\u5883
server.port=9996
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.jdbc-url=jdbc:mysql://127.0.0.1:3306/spms?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.jdbc-url=jdbc:mysql://139.159.187.130:3306/spms?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.username=root
#spring.datasource.password=root
spring.datasource.password=123456
spring.datasource.password=root
#spring.datasource.password=123456
#server.servlet.context-path=
#logging.level.com.glxp.sale.admin.dao=debug
# \u8DE8\u57DF\u8BBE\u7F6E
@ -51,7 +51,6 @@ STOCK_PRINT_POST=http://139.159.187.130/UDI_WMS_MC/udiwms/stockprint/post
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.time-zone=GMT+8
spring.main.allow-bean-definition-overriding=true
# Redis \u6570\u636E\u5E93\u7F16\u53F7
spring.redis.database=4
# Redis \u670D\u52A1\u5668IP

@ -10,12 +10,19 @@
<if test="id != '' and id!=null">
and id = #{id}
</if>
<if test="status != '' and status!=null">
<if test="status!=null">
and status = #{status}
</if>
<if test="type != '' and type!=null">
<if test="type!=null">
and type = #{type}
</if>
<if test="idDatas != '' and idDatas!=null">
and idDatas = #{idDatas}
</if>
<if test="scheduleType!=null">
and scheduleType = #{scheduleType}
</if>
</where>
</select>
@ -23,13 +30,17 @@
<insert id="insertExportStatus" keyProperty="id"
parameterType="com.glxp.sale.admin.entity.basic.BasicExportStatusEntity">
replace
INTO basic_export_status(id,idDatas,status,type,updateTime)
INTO basic_export_status(id,idDatas,status,`type`,updateTime,scheduleType,startTime,endTime,remark)
values(
#{id},
#{idDatas},
#{status},
#{type},
#{updateTime}
#{updateTime},
#{scheduleType},
#{startTime},
#{endTime},
#{remark}
)
</insert>
@ -40,8 +51,12 @@
<if test="status != null">status=#{status},</if>
<if test="type != null">type=#{type},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="scheduleType != null">scheduleType=#{scheduleType},</if>
<if test="startTime != null">startTime=#{startTime},</if>
<if test="endTime != null">endTime=#{endTime},</if>
<if test="remark != null">remark=#{remark},</if>
</trim>
WHERE orderId = #{orderId}
WHERE id = #{id}
</update>
<delete id="deleteById" parameterType="Map">
DELETE

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.glxp.sale.admin.dao.basic.BasicExportTimeDao">
<select id="filterExportStatus" parameterType="com.glxp.sale.admin.req.basic.BasicExportTimeRequest"
resultType="com.glxp.sale.admin.entity.basic.BasicExportStatusTimeEntity">
select * from basic_export_status_time
<where>
<if test="id != '' and id!=null">
and id = #{id}
</if>
<if test="key != '' and key!=null">
and `key` = #{key}
</if>
</where>
</select>
<insert id="insertExportStatus" keyProperty="id"
parameterType="com.glxp.sale.admin.entity.basic.BasicExportStatusTimeEntity">
replace
INTO basic_export_status_time(`key`,lastUpdateTime,remark)
values(
#{key},
#{lastUpdateTime},
#{remark}
)
</insert>
<update id="updateExportStatus" parameterType="com.glxp.sale.admin.entity.basic.BasicExportStatusTimeEntity">
UPDATE basic_export_status_time
<trim prefix="set" suffixOverrides=",">
<if test="lastUpdateTime != null">lastUpdateTime=#{lastUpdateTime},</if>
<if test="remark != null">remark=#{remark},</if>
</trim>
WHERE key = #{key}
</update>
<delete id="deleteById" parameterType="Map">
DELETE
FROM basic_export_status_time
WHERE id = #{id}
</delete>
</mapper>

@ -36,6 +36,9 @@
<if test="outType != null">
AND ( outType <![CDATA[ <> ]]> #{outType} or outType is NULL)
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
</if>
</where>
order by updateTime desc

@ -24,6 +24,29 @@
</select>
<select id="filterAllList" parameterType="com.glxp.sale.admin.req.basic.BussinessLocalTypeFilterRequest"
resultType="com.glxp.sale.admin.entity.basic.BussinessLocalTypeEntity">
SELECT * from basic_bustype_local
<where>
<if test="name != ''and name != null">
AND basic_bustype_local.name LIKE concat('%',#{name},'%')
</if>
<if test="action != ''and action != null">
AND action LIKE concat(#{action},'%')
</if>
<if test="originAction != ''and originAction != null">
AND originAction =#{originAction}
</if>
<if test="spUse != ''and spUse != null">
AND spUse =#{spUse}
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
</if>
</where>
</select>
<select id="filterJoin" parameterType="com.glxp.sale.admin.req.basic.BussinessLocalTypeFilterRequest"
resultType="com.glxp.sale.admin.entity.basic.BussinessLocalTypeEntity">
@ -60,13 +83,14 @@
basic_bussiness_type.name ,
basic_bussiness_type.action,basic_bussiness_type.checkEnable,basic_bustype_local.advanceType,basic_bustype_local.changeEnable,
basic_bustype_local.spUse,basic_bussiness_type.storageCode,basic_bussiness_type.corpType,basic_bussiness_type.mainAction,
basic_bussiness_type.defaultUnit,basic_bussiness_type.genUnit,basic_bustype_origin.action thirdAction,basic_bustype_origin.thirdSys
basic_bussiness_type.defaultUnit,basic_bussiness_type.genUnit,basic_bustype_origin.action
thirdAction,basic_bustype_origin.thirdSys
FROM basic_bustype_local
inner join basic_bussiness_type on basic_bustype_local.action = basic_bussiness_type.localAction
INNER JOIN inv_warehouse_bussiness_type on basic_bussiness_type.action = inv_warehouse_bussiness_type.action
INNER JOIN inv_warehouse on inv_warehouse_bussiness_type.`code` = inv_warehouse.`code`
INNER JOIN inv_warehouse_user on inv_warehouse.`code` =inv_warehouse_user.`code`
left join basic_bustype_origin on basic_bustype_local.originAction = basic_bustype_origin.action
left join basic_bustype_origin on basic_bustype_local.originAction = basic_bustype_origin.action
<where>
<if test="name != ''and name != null">
AND basic_bustype_local.name LIKE concat('%',#{name},'%')
@ -78,7 +102,7 @@
AND basic_bussiness_type.enable =#{enabled}
</if>
<if test="spUse != ''and spUse != null">
AND spUse =#{spUse}
AND basic_bustype_local.spUse =#{spUse}
</if>
<if test="code != ''and code != null">
AND inv_warehouse_user.`code` = #{code}
@ -116,11 +140,11 @@
<insert id="insertBussinessType" keyProperty="id"
parameterType="com.glxp.sale.admin.entity.basic.BussinessLocalTypeEntity">
INSERT INTO basic_bustype_local
(action, name, remark, originAction, advanceType, changeEnable, spUse)
replace INTO basic_bustype_local
(action, name, remark, originAction, advanceType, changeEnable, spUse,updateTime)
values (#{action},
#{name},
#{remark}, #{originAction}, #{advanceType}, #{changeEnable}, #{spUse})
#{remark}, #{originAction}, #{advanceType}, #{changeEnable}, #{spUse},#{updateTime})
</insert>
<update id="updateBusLocalType" parameterType="com.glxp.sale.admin.entity.basic.BussinessLocalTypeEntity">
@ -133,7 +157,7 @@
<if test="advanceType != null">advanceType = #{advanceType},</if>
<if test="changeEnable != null">changeEnable = #{changeEnable},</if>
<if test="spUse != null">spUse = #{spUse},</if>
<if test="updateTime != null">updateTime = #{updateTime},</if>
</trim>
WHERE id = #{id}

@ -13,7 +13,9 @@
<if test="action != ''and action != null">
AND action LIKE concat(#{action},'%')
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
</if>
</where>
</select>
@ -67,8 +69,8 @@
<insert id="insertBusOriginType" keyProperty="id"
parameterType="com.glxp.sale.admin.entity.basic.BussinessOriginTypeEntity">
INSERT INTO basic_bustype_origin
(action, name, enable, remark, thirdSys, thirdSysName)
replace INTO basic_bustype_origin
(`action`, `name`, enable, remark, thirdSys, thirdSysName)
values (#{action},
#{name},
#{enable},

@ -43,12 +43,45 @@
</where>
GROUP BY basic_bussiness_type.id
</select>
<select id="filterAllList" parameterType="com.glxp.sale.admin.req.basic.BussinessTypeFilterRequest"
resultType="com.glxp.sale.admin.entity.basic.BussinessTypeEntity">
SELECT *
FROM basic_bussiness_type
<where>
<if test="name != ''and name != null">
AND basic_bussiness_type.name LIKE concat('%',#{name},'%')
</if>
<if test="action != ''and action != null">
AND basic_bussiness_type.action LIKE concat('%',#{action},'%')
</if>
<if test="mainAction != ''and mainAction != null">
AND basic_bussiness_type.mainAction LIKE concat('%',#{mainAction},'%')
</if>
<if test="enabled != ''and enabled != null">
AND basic_bussiness_type.enable =#{enabled}
</if>
<if test="advanceType != ''and advanceType != null">
AND basic_bustype_local.advanceType =#{advanceType}
</if>
<if test="spUse != ''and spUse != null">
AND basic_bustype_local.spUse =#{spUse}
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
</if>
</where>
</select>
<select id="filterJoinList" parameterType="com.glxp.sale.admin.req.basic.BussinessTypeFilterRequest"
resultType="com.glxp.sale.admin.res.basic.BussinessTypResponse">
select basic_bussiness_type.*,
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 from basic_bussiness_type LEFT JOIN
basic_bustype_local.spUse,basic_bussiness_type.storageCode,basic_bussiness_type.expireTip 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 =
basic_bustype_local.action
@ -94,7 +127,8 @@
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,
basic_bustype_local.spUse,corpType,basic_bussiness_type.storageCode,basic_bussiness_type.checkBalacne,defaultUnit,
basic_bussiness_type.secCheckBalacne,basic_bustype_origin.action thirdAction,basic_bustype_origin.thirdSys,useDyCount,basic_bussiness_type.expireTip
basic_bussiness_type.secCheckBalacne,basic_bustype_origin.action
thirdAction,basic_bustype_origin.thirdSys,useDyCount,basic_bussiness_type.expireTip
FROM basic_bussiness_type LEFT JOIN basic_bustype_local
on basic_bussiness_type.localAction = basic_bustype_local.action
left join basic_bustype_origin on basic_bustype_local.originAction = basic_bustype_origin.action
@ -136,12 +170,12 @@
parameterType="com.glxp.sale.admin.entity.basic.BussinessTypeEntity">
replace
INTO basic_bussiness_type
(action,name,enable,remark,mainAction,localAction,thirdSysFk,
(`action`,`name`,enable,remark,mainAction,localAction,thirdSysFk,
checkEnable,genUnit,innerOrder,secCheckEnable,
checkUdims,checkPdaEd,checkPdaUn,checkPc,checkWebNew,checkChange
,secCheckUdims,secCheckPdaEd,secCheckPdaUn,secCheckPc,secCheckWebNew,
secCheckChange,corpType,basic_bussiness_type.storageCode,checkBalacne,
secCheckBalacne,supplementOrderType,defaultUnit,useDyCount,expireTip)
secCheckBalacne,supplementOrderType,defaultUnit,useDyCount,expireTip,updateTime)
values
(
#{action},
@ -172,7 +206,9 @@
#{checkBalacne},
#{secCheckBalacne},
#{supplementOrderType},
#{defaultUnit},#{useDyCount},#{expireTip}
#{defaultUnit},
#{useDyCount},
#{expireTip},#{updateTime}
)
</insert>
@ -186,7 +222,7 @@
checkEnable,genUnit,innerOrder,secCheckEnable,
checkUdims,checkPdaEd,checkPdaUn,checkPc,checkWebNew,checkChange
,secCheckUdims,secCheckPdaEd,secCheckPdaUn,secCheckPc,secCheckWebNew,
secCheckChange,corpType,storageCode,checkBalacne,secCheckBalacne,supplementOrderType,defaultUnit,useDyCount,expireTip)
secCheckChange,corpType,storageCode,checkBalacne,secCheckBalacne,supplementOrderType,defaultUnit,useDyCount,expireTip,updateTime)
values
(
#{index},
@ -218,7 +254,9 @@
#{checkBalacne},
#{secCheckBalacnesecCheckBalacne},
#{supplementOrderType},
#{defaultUnit},#{useDyCount},#{expireTip}
#{defaultUnit},
#{useDyCount},
#{expireTip},#{updateTime}
)
</insert>
@ -257,7 +295,7 @@
<if test="defaultUnit != null">defaultUnit=#{defaultUnit},</if>
<if test="useDyCount != null">useDyCount=#{useDyCount},</if>
<if test="expireTip != null">expireTip=#{expireTip},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
thirdSysFk=#{thirdSysFk},
</trim>
WHERE id = #{id}

@ -355,6 +355,9 @@
<if test="mainId != '' and mainId != null">
AND mainId = #{mainId}
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
</if>
</where>
</select>

@ -17,6 +17,9 @@
<if test="unitFk != null and unitFk != ''">
and unitFk = #{unitFk}
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(update_time, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
</if>
</where>
ORDER BY id DESC
</select>
@ -246,6 +249,27 @@
)
</insert>
<insert id="importCompanyProductRelevance"
parameterType="com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity">
replace
INTO company_product_relevance(id,customerId,productId,enterpriseId,registrationId,
create_time,update_time,auditStatus,productUuid,udiRlIdFk,unitFk) values
(
#{id},
#{customerId},
#{productId},
#{enterpriseId},
#{registrationId},
#{create_time},
#{update_time},
#{auditStatus},
#{productUuid},
#{udiRlIdFk},
#{unitFk}
)
</insert>
<delete id="deleteById" parameterType="Map">
DELETE
FROM company_product_relevance

@ -33,7 +33,8 @@
insert INTO io_order(id, action, corpOrderId, actDate, fromCorpId, actor, mainAction,
fromCorp, status, remark, exportStatus, fromType, contrastStatus, signStatus,
receiveStatus, erpFk, stockCheckFk, customerId, supId,
exportFilePath, locStorageCode, supplementNo, ullageSupNo, createUser, reviewUser,outChangeEnable,originUllageSupNo)
exportFilePath, locStorageCode, supplementNo, ullageSupNo, createUser, reviewUser,
outChangeEnable, originUllageSupNo)
values (#{id},
#{action},
#{corpOrderId},
@ -52,8 +53,49 @@
#{erpFk},
#{stockCheckFk},
#{customerId}, #{supId}, #{exportFilePath}, #{locStorageCode}, #{supplementNo}
, #{ullageSupNo}, #{createUser}, #{reviewUser},#{outChangeEnable},#{originUllageSupNo})
, #{ullageSupNo}, #{createUser}, #{reviewUser}, #{outChangeEnable}, #{originUllageSupNo})
</insert>
<insert id="importOrder" keyProperty="id" parameterType="com.glxp.sale.admin.entity.inout.OrderEntity">
replace
INTO io_order(id, action, corpOrderId, actDate, fromCorpId, actor, mainAction,
fromCorp, status, remark, exportStatus, fromType, contrastStatus, signStatus,
receiveStatus, erpFk, stockCheckFk, customerId, supId,
exportFilePath, locStorageCode, supplementNo, ullageSupNo, createUser, reviewUser,
outChangeEnable, originUllageSupNo)
values (
#{id},
#{action},
#{corpOrderId},
#{actDate},
#{fromCorpId},
#{actor},
#{mainAction},
#{fromCorp},
#{status},
#{remark},
#{exportStatus},
#{fromType},
#{contrastStatus},
#{signStatus},
#{receiveStatus},
#{erpFk},
#{stockCheckFk},
#{customerId},
#{supId},
#{exportFilePath},
#{locStorageCode},
#{supplementNo},
#{ullageSupNo},
#{createUser},
#{reviewUser},
#{outChangeEnable},
#{originUllageSupNo}
)
</insert>
<update id="updateOrder" parameterType="com.glxp.sale.admin.entity.inout.OrderEntity">
UPDATE io_order
<trim prefix="set" suffixOverrides=",">
@ -82,6 +124,7 @@
<if test="ullageSupNo != null">ullageSupNo=#{ullageSupNo},</if>
<if test="createUser != null">createUser=#{createUser},</if>
<if test="reviewUser != null">reviewUser=#{reviewUser},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="outChangeEnable != null">outChangeEnable=#{outChangeEnable},</if>
<if test="originUllageSupNo != null">originUllageSupNo=#{originUllageSupNo},</if>
@ -155,7 +198,9 @@
<if test="fromCorpId != '' and fromCorpId!=null">
and fromCorpId =#{fromCorpId}
</if>
<if test="corpOrderId != '' and corpOrderId !=null">
and corpOrderId =#{corpOrderId}
</if>
<if test="action != '' and action!=null">
and action = #{action}
</if>
@ -178,7 +223,6 @@
<if test="receiveStatus!=null">
and receiveStatus = #{receiveStatus}
</if>
<if test="signStatus != '' and signStatus!=null">
and signStatus = #{signStatus}
</if>
@ -203,6 +247,9 @@
<if test="reviewUser!=null">
and reviewUser =#{reviewUser}
</if>
<if test="unionUser != '' and unionUser!=null">
and (createUser =#{unionUser} or reviewUser =#{unionUser})
</if>
<if test="ullageSupNo != '' and ullageSupNo!=null">
and ullageSupNo =#{ullageSupNo}
</if>
@ -212,7 +259,6 @@
<if test="locStorageCode!=null">
and locStorageCode =#{locStorageCode}
</if>
</where>
group by io_order.id
ORDER BY actDate DESC
@ -260,6 +306,9 @@
<if test="receiveStatus != '' and receiveStatus!=null">
and receiveStatus = #{receiveStatus}
</if>
<if test="corpOrderId != '' and corpOrderId !=null">
and corpOrderId =#{corpOrderId}
</if>
<if test="startTime!=null and startTime!=''">
<![CDATA[ and DATE_FORMAT(actDate, '%Y-%m-%d')>= DATE_FORMAT(#{startTime}, '%Y-%m-%d') ]]>
</if>
@ -269,7 +318,7 @@
<if test="customerId != '' and customerId!=null">
and customerId =#{customerId}
</if>
<if test=" createUser!=null">
<if test="createUser!=null">
and createUser =#{createUser}
</if>
<if test=" reviewUser!=null">
@ -454,6 +503,23 @@
</where>
limit 1
</select>
<select id="findAllByTime" parameterType="com.glxp.sale.admin.req.inout.OrderFilterRequest"
resultType="com.glxp.sale.admin.entity.inout.OrderEntity">
SELECT * FROM io_order
<where>
<if test="status != '' and status!=null">
and status = #{status}
</if>
<if test="receiveStatus != '' and receiveStatus!=null">
and receiveStatus = #{receiveStatus}
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
</if>
</where>
</select>
<select id="filterListByCode" parameterType="java.util.List"
resultType="com.glxp.sale.admin.entity.inout.OrderEntity">
SELECT * FROM io_order WHERE id IN

@ -157,6 +157,9 @@
<if test="locStorageCode != '' and locStorageCode!=null">
and locStorageCode = #{locStorageCode}
</if>
<if test="unionUser != '' and unionUser!=null">
and (createUser =#{unionUser} or reviewUser =#{unionUser})
</if>
<if test="createUser!=null">
and createUser = #{createUser}
</if>
@ -218,7 +221,8 @@
resultType="com.glxp.sale.admin.entity.inout.StockOrderPrintEntity">
SELECT stock_order.*, stock_order_detail.productId, stock_order_detail.productName, stock_order_detail.spec,
stock_order_detail.batchNo, stock_order_detail.productDate, stock_order_detail.expireDate,
stock_order_detail.count, stock_order_detail.sweepCount, stock_order_detail.ylqxzcrbarmc,stock_order_detail.manufactory,
stock_order_detail.count, stock_order_detail.sweepCount,
stock_order_detail.ylqxzcrbarmc,stock_order_detail.manufactory,
stock_order_detail.zczbhhzbapzbh,stock_order_detail.price,inv_warehouse.name locInv FROM stock_order INNER JOIN
stock_order_detail on
stock_order.id =

@ -242,11 +242,29 @@
<select id="selectListByCode" resultMap="BaseResultMap">
select inv_warehouse_user.*, auth_user.employeeName
from inv_warehouse_user
inner join auth_user on auth_user.id = inv_warehouse_user.userId
inner join auth_user on auth_user.id = inv_warehouse_user.userId
where code = #{code}
</select>
<select id="filterWarehouseUsers" parameterType="com.glxp.sale.admin.req.inventory.FilterInvUserRequest"
resultType="com.glxp.sale.admin.entity.inout.WarehouseUserEntity">
SELECT * FROM inv_warehouse_user
<where>
<if test="id != '' and id != null">
AND id = #{id}
</if>
<if test="code != '' and code != null">
AND code = #{code}
</if>
<if test="isDirector != '' and isDirector != null">
AND isDirector = #{isDirector}
</if>
</where>
</select>
<select id="selectCodeByUser" resultMap="BaseResultMap">
select inv_warehouse_user.*
from inv_warehouse_user

@ -114,7 +114,7 @@
inv_pre_product.inCount,inv_pre_product.outCount
,inv_pre_product.reCount,inv_pre_product.customerId,
basic_corp.name companyName,inv_pre_product.supId,inv_pre_product.unitFk ,inv_warehouse.name
invStorageName,inv_product.invStorageCode
invStorageName,inv_pre_product.invStorageCode
FROM inv_pre_product
inner join basic_udirel on inv_pre_product.relIdFk = basic_udirel.id
inner join basic_products on basic_udirel.uuid = basic_products.uuid

@ -218,6 +218,14 @@
<if test="code != '' and code != null">
AND code = #{code}
</if>
<if test="invCodes != null and invCodes.size > 0">
AND invStorageCode IN
<foreach collection="invCodes" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
</where>
</select>

@ -35,6 +35,9 @@
<if test="level != null">
AND a.level = #{level}
</if>
<if test="spUse != null">
AND a.spUse = #{spUse}
</if>
</where>
</select>
@ -70,7 +73,10 @@
</if>
<if test="level != null">
AND level = #{level}
AND `level` = #{level}
</if>
<if test="spUse != null">
AND spUse = #{spUse}
</if>
</where>
group by inv_warehouse.code
@ -112,7 +118,7 @@
AND pcode = #{pcode}
</if>
<if test="level != null">
AND level = #{level}
AND `level` = #{level}
</if>
</where>
@ -144,6 +150,15 @@
<if test="pcode != null">
AND pcode = #{pcode}
</if>
<if test="spUse != null">
AND spUse = #{spUse}
</if>
<if test="updateTime!=null and updateTime!=''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S') ]]>
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
</if>
</where>
</select>
@ -156,8 +171,8 @@
parameterType="com.glxp.sale.admin.entity.inventory.InvWarehouseEntity">
replace
INTO inv_warehouse
(pid, code, name, advanceType, isDefault,
status, updateTime, remark,level,pcode)
(pid, code, `name`, advanceType, isDefault,
status, updateTime, remark,`level`,pcode,spUse)
values (
#{pid},
#{code},
@ -168,7 +183,8 @@
#{updateTime},
#{remark},
#{level},
#{pcode}
#{pcode},
#{spUse}
)
</insert>
@ -197,14 +213,15 @@
<if test="thirdId2 != null">remark=#{thirdId2},</if>
<if test="thirdId3 != null">remark=#{thirdId3},</if>
<if test="thirdId4 != null">remark=#{thirdId4},</if>
<if test="spUse != null">spUse=#{spUse},</if>
</trim>
WHERE id = #{id}
</update>
<insert id="importInvWarehouse" parameterType="java.util.List">
replace into inv_warehouse (id, pId, code, name, advanceType, isDefault, status,
updateTime, remark, level, pcode, thirdId, thirdId1, thirdId2, thirdId3,
thirdId4) values
replace into inv_warehouse (id, pid, code, `name`, advanceType, isDefault, status,
updateTime, remark, `level`, pcode, thirdId, thirdId1, thirdId2, thirdId3,
thirdId4,spUse) values
<foreach collection="invWarehouseEntities" item="item" index="index" separator=",">
(#{item.id},
#{item.pid},
@ -215,9 +232,9 @@
#{item.status},
#{item.updateTime},
#{item.remark}, #{item.level},
#{item.pcode}, #{thirdId},
#{thirdId1}, #{thirdId2},
#{thirdId3}, #{thirdId4})
#{item.pcode}, #{item.thirdId},
#{item.thirdId1}, #{item.thirdId2},
#{item.thirdId3}, #{item.thirdId4},#{item.spUse})
</foreach>
</insert>

@ -11,11 +11,15 @@
AND unitId = #{unitId}
</if>
<if test="name != '' and name != null">
AND ( name LIKE concat('%',#{name},'%') or spell LIKE concat('%',#{name},'%') or unitId LIKE concat('%',#{unitId},'%'))
AND ( name LIKE concat('%',#{name},'%') or spell LIKE concat('%',#{name},'%') or unitId LIKE
concat('%',#{unitId},'%'))
</if>
<if test="thirdSysFk != '' and thirdSysFk != null">
AND thirdSysFk = #{thirdSysFk}
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
</if>
</where>
ORDER BY updateTime DESC
</select>

@ -28,6 +28,9 @@
<if test="key != null">
and code like concat('%',#{key},'%') or `name` like concat('%',#{key},'%')
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
</if>
</where>
</select>

@ -44,6 +44,9 @@
<!-- <if test="editStatus == '' or editStatus == null">-->
<!-- and `editStatus` <![CDATA[ <> ]]> 1-->
<!-- </if>-->
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
</if>
</where>
ORDER BY updateTime DESC
</select>
@ -147,5 +150,34 @@
WHERE id = #{id}
</update>
<insert id="importThrOrder" keyProperty="id" parameterType="com.glxp.sale.admin.entity.thrsys.ThrOrderEntity">
replace
INTO thr_order
(id,billNo, billdate, corpId, corpName, billType, billFlag, thirdSysFk, updateTime, originType,
startDate, endDate, createUser, reviewUser, address, linkMan, linkTel, remark, remark1, remark2,
remark3)
values (
#{id},
#{billNo},
#{billdate},
#{corpId},
#{corpName},
#{billType},
#{billFlag},
#{thirdSysFk},
#{updateTime},
#{originType},
#{startDate},
#{endDate},
#{createUser},
#{reviewUser},
#{address},
#{linkMan},
#{linkTel},
#{remark},
#{remark1},
#{remark2},
#{remark3}
)
</insert>
</mapper>

@ -43,6 +43,30 @@
</foreach>
</insert>
<insert id="importThrOrderDetail" keyProperty="id"
parameterType="com.glxp.sale.admin.entity.thrsys.ThrOrderDetailEntity">
replace
INTO thr_order_detail
(id,productId, productName, spec, batchNo, expireDate,
productDate, `count`, reCount, orderIdFk, thirdSysFk, updateTime, price, corpName)
values (
#{id},
#{productId},
#{productName},
#{spec},
#{batchNo},
#{expireDate},
#{productDate},
#{count},
#{reCount},
#{orderIdFk},
#{thirdSysFk},
#{updateTime},
#{price},
#{corpName}
)
</insert>
<delete id="deleteById" parameterType="Map">
DELETE FROM thr_order_detail WHERE id = #{id}
</delete>
@ -70,6 +94,9 @@
WHERE id = #{id}
</update>
<delete id="deleteAll">
DELETE FROM thr_order_detail
</delete>

@ -48,6 +48,7 @@
</select>
<select id="selectThrProducts" parameterType="com.glxp.sale.admin.req.thrsys.FilterThrProductsRequest"
resultType="com.glxp.sale.admin.entity.thrsys.ThrProductsAddEntity">
SELECT * FROM thr_products_add
@ -99,7 +100,7 @@
replace
INTO thr_products_add
(
code,name,measname,spec,registerNo,manufactory,
code,`name`,measname,spec,registerNo,manufactory,
cplb,flbm,qxlb,ybbm,sptm,tyshxydm,zczbhhzbapzbh,ylqxzcrbarmc,ylqxzcrbarywmc,cpms,
thirdSysFk,updateTime,supName,checkStatus,customerId
)

@ -34,6 +34,9 @@
<if test="thirdSysFk != '' and thirdSysFk != null">
AND thirdSysFk = #{thirdSysFk}
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
</if>
</where>
ORDER BY updateTime DESC
</select>

@ -57,3 +57,11 @@ invWarehouseCode VARCHAR(100) NULL DEFAULT NULL COMMENT '货位号'
);
alter table thr_order add
(
locStorageCode varchar(255) null DEFAULT NULL COMMENT '当前仓库',
editStatus TINYINT NULL DEFAULT NULL COMMENT ''
)

Loading…
Cancel
Save