单据校验,库存,扫码单据业务单据根据账号库存分类,同步设置等等,代码备份

master
anthonyywj2 3 years ago
parent 9e4f569138
commit 43c7651026

@ -2,19 +2,20 @@ package com.glxp.sale.admin.controller.basic;
import com.github.pagehelper.PageInfo;
import com.glxp.sale.admin.annotation.AuthRuleAnnotation;
import com.glxp.sale.admin.entity.basic.BussinessLocalTypeEntity;
import com.glxp.sale.admin.entity.basic.BussinessOriginTypeEntity;
import com.glxp.sale.admin.req.basic.BussinessLocalTypeFilterRequest;
import com.glxp.sale.admin.httpclient.ErpBasicClient;
import com.glxp.sale.admin.req.basic.BussinessOriginTypeFilterRequest;
import com.glxp.sale.admin.req.inout.DeleteRequest;
import com.glxp.sale.admin.res.PageSimpleResponse;
import com.glxp.sale.admin.res.basic.BussinessOriginTypeResponse;
import com.glxp.sale.admin.service.basic.BussinessLocalTypeService;
import com.glxp.sale.admin.service.basic.BussinessOriginTypeService;
import com.glxp.sale.common.enums.ResultEnum;
import com.glxp.sale.common.res.BaseResponse;
import com.glxp.sale.common.util.ResultVOUtils;
import org.springframework.validation.BindingResult;
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;
@ -23,9 +24,10 @@ import java.util.List;
@RestController
public class BussinessOriginTypeController {
@Resource
private BussinessOriginTypeService bussinessOriginTypeService;
@Resource
ErpBasicClient erpBasicClient;
@AuthRuleAnnotation("")
@GetMapping("/udiwms/originBusType/filter")
@ -66,4 +68,51 @@ public class BussinessOriginTypeController {
return ResultVOUtils.success(pageSimpleResponse);
}
@PostMapping("/udiwms/originBusType/update")
public BaseResponse updateBussinessType(@RequestBody BussinessOriginTypeEntity bussinessTypeEntity,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (bussinessTypeEntity != null) {
bussinessOriginTypeService.updateBusOriginType(bussinessTypeEntity);
} else {
ResultVOUtils.error(999, "参数错误");
}
return ResultVOUtils.success("更新成功");
}
@PostMapping("/udiwms/originBusType/add")
public BaseResponse addBussinessType(@RequestBody BussinessOriginTypeEntity bussinessTypeEntity,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (bussinessTypeEntity != null) {
bussinessOriginTypeService.insertBusOriginType(bussinessTypeEntity);
} else {
return ResultVOUtils.error(999, "参数错误");
}
return ResultVOUtils.success("更新成功");
}
@PostMapping("/udiwms/originBusType/delete")
public BaseResponse delBussinessType(@RequestBody DeleteRequest deleteRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (deleteRequest != null) {
bussinessOriginTypeService.deleteById(deleteRequest.getId());
} else {
return ResultVOUtils.error(999, "参数错误");
}
return ResultVOUtils.success("更新成功");
}
}

@ -10,6 +10,7 @@ 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.param.SyncDataSetEntity;
import com.glxp.sale.admin.entity.receipt.ProductInfoEntity;
import com.glxp.sale.admin.entity.thrsys.*;
import com.glxp.sale.admin.req.basic.*;
@ -24,12 +25,14 @@ 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.res.param.SyncDataSetResponse;
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.param.SyncDataSetService;
import com.glxp.sale.admin.service.receipt.ProductInfoService;
import com.glxp.sale.admin.service.thrsys.*;
import com.glxp.sale.admin.util.BeanUtils;
@ -67,82 +70,97 @@ public class SpsSyncDownloadController {
ThrOrderDetailService thrOrderDetailService;
@Resource
private CompanyProductRelevanceService companyProductRelevanceService;
@Resource
private SyncDataSetService syncDataSetService;
@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);
}
SpsSyncDataResponse syncDataResponse = new SpsSyncDataResponse();
SyncDataSetResponse syncDataSetEntity = syncDataSetService.selectSet();
if (syncDataSetEntity.isBasicInv()) {
//仓库字典
FilterInvWarehouseRequest filterInvWarehouseRequest = new FilterInvWarehouseRequest();
filterInvWarehouseRequest.setLastUpdateTime(spsSyncDataRequest.getLastUpdateTime());
List<InvWarehouseEntity> invWarehouseEntities = invWarehouseService.filterGroupInvWarehouse(filterInvWarehouseRequest);
syncDataResponse.setInvWarehouseEntities(invWarehouseEntities);
}
//供应商产品信息关联表
FilterCompanyProductRelevanceRequest filterCompanyProductRelevanceRequest = new FilterCompanyProductRelevanceRequest();
BeanUtils.copyProperties(spsSyncDataRequest, filterCompanyProductRelevanceRequest);
List<CompanyProductRelevanceEntity> companyProductRelevanceEntities = companyProductRelevanceService.filterCompanyProductRelevance(filterCompanyProductRelevanceRequest);
if (syncDataSetEntity.isBasicProducts()) {
//耗材字典
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);
//供应商产品信息关联表
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);
syncDataResponse.setCompanyProductRelevanceEntities(companyProductRelevanceEntities);
syncDataResponse.setUdiInfoEntities(udiInfoEntities);
syncDataResponse.setUdiRelevanceEntities(udiRelevanceEntities);
}
if (syncDataSetEntity.isBasicCorp()) {
//往来单位字典
BasicUnitMaintainFilterRequest basicUnitMaintainFilterRequest = new BasicUnitMaintainFilterRequest();
basicUnitMaintainFilterRequest.setLastUpdateTime(spsSyncDataRequest.getLastUpdateTime());
List<BasicUnitMaintainEntity> basicUnitMaintainEntities = basicUnitMaintainService.filterList(basicUnitMaintainFilterRequest);
syncDataResponse.setBasicUnitMaintainEntities(basicUnitMaintainEntities);
}
if (syncDataSetEntity.isBasicThirdInv()) {
//第三方仓库信息
FilterThrInvWarehouseRequest filterThrInvWarehouseRequest = new FilterThrInvWarehouseRequest();
filterThrInvWarehouseRequest.setLastUpdateTime(spsSyncDataRequest.getLastUpdateTime());
List<ThrInvWarehouseEntity> thrInvWarehouseEntities = thrInvWarehouseService.filterThrInvWarehouse(filterThrInvWarehouseRequest);
syncDataResponse.setThrInvWarehouseEntities(thrInvWarehouseEntities);
}
if (syncDataSetEntity.isBasicThirdCorp()) {
//第三方往来单位
FilterThrCorpRequest filterThrCorpRequest = new FilterThrCorpRequest();
BeanUtils.copyProperties(spsSyncDataRequest, filterThrCorpRequest);
List<ThrCorpEntity> thrCorpEntities = thrCorpService.filterThrCorps(filterThrCorpRequest);
syncDataResponse.setThrCorpEntities(thrCorpEntities);
}
if (syncDataSetEntity.isBasicThirdProducts()) {
//第三方产品信息
FilterThrProductsRequest filterThrProductsRequest = new FilterThrProductsRequest();
BeanUtils.copyProperties(spsSyncDataRequest, filterThrProductsRequest);
List<ThrProductsEntity> thrProductsEntities = thrProductsService.filterThrProductsRequest(filterThrProductsRequest);
syncDataResponse.setThrProductsEntities(thrProductsEntities);
}
if (syncDataSetEntity.isBasicThirdBusOrder()) {
//第三方业务单据
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);
}
}
syncDataResponse.setThrOrderDetailEntities(allOrderDetailEntities);
syncDataResponse.setThrOrderEntities(thrOrderEntities);
}
return ResultVOUtils.success(syncDataResponse);
}
@ -157,19 +175,27 @@ public class SpsSyncDownloadController {
@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);
SyncDataSetResponse syncDataSetEntity = syncDataSetService.selectSet();
SpsSyncBusResponse spsSyncBusResponse = new SpsSyncBusResponse();
spsSyncBusResponse.setBussinessTypeEntities(bussinessTypeEntities);
spsSyncBusResponse.setBussinessLocalTypeEntities(bussinessLocalTypeEntities);
spsSyncBusResponse.setBussinessOriginTypeEntities(bussinessOriginTypeEntities);
if (syncDataSetEntity.isTypeScan()) {
BussinessTypeFilterRequest bussinessTypeFilterRequest = new BussinessTypeFilterRequest();
BeanUtils.copyProperties(spsSyncDataRequest, bussinessTypeFilterRequest);
List<BussinessTypeEntity> bussinessTypeEntities = bussinessTypeService.filterAllList(bussinessTypeFilterRequest);
spsSyncBusResponse.setBussinessTypeEntities(bussinessTypeEntities);
}
if (syncDataSetEntity.isTypeBus()) {
BussinessLocalTypeFilterRequest bussinessLocalTypeFilterRequest = new BussinessLocalTypeFilterRequest();
BeanUtils.copyProperties(spsSyncDataRequest, bussinessLocalTypeFilterRequest);
List<BussinessLocalTypeEntity> bussinessLocalTypeEntities = bussinessLocalTypeService.filterAllList(bussinessLocalTypeFilterRequest);
spsSyncBusResponse.setBussinessLocalTypeEntities(bussinessLocalTypeEntities);
}
if (syncDataSetEntity.isTypeThird()) {
BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest = new BussinessOriginTypeFilterRequest();
BeanUtils.copyProperties(spsSyncDataRequest, bussinessOriginTypeFilterRequest);
List<BussinessOriginTypeEntity> bussinessOriginTypeEntities = bussinessOriginTypeService.filterList(bussinessOriginTypeFilterRequest);
spsSyncBusResponse.setBussinessOriginTypeEntities(bussinessOriginTypeEntities);
}
return ResultVOUtils.success(spsSyncBusResponse);
}
@ -185,30 +211,74 @@ public class SpsSyncDownloadController {
@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);
SpsSyncOrderResponse syncOrderResponse = new SpsSyncOrderResponse();
SyncDataSetResponse syncDataSetEntity = syncDataSetService.selectSet();
if (syncDataSetEntity.isOrderScanFinish()) {
List<OrderEntity> orderEntities = new ArrayList<>();
if (syncDataSetEntity.isOrderScanFinish()) {
OrderFilterRequest orderFilterRequest = new OrderFilterRequest();
BeanUtils.copyProperties(spsSyncDataRequest, orderFilterRequest);
orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS);
orderFilterRequest.setReceiveStatus(ConstantStatus.RECEIVE_ED);
List<OrderEntity> temps = orderService.findAllByTime(orderFilterRequest);
if (CollUtil.isNotEmpty(temps)) {
orderEntities.addAll(temps);
}
}
if (syncDataSetEntity.isOrderUnReceive()) {
OrderFilterRequest orderFilterRequest = new OrderFilterRequest();
BeanUtils.copyProperties(spsSyncDataRequest, orderFilterRequest);
orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS);
orderFilterRequest.setReceiveStatus(ConstantStatus.RECEIVE_UN);
List<OrderEntity> temps = orderService.findAllByTime(orderFilterRequest);
if (CollUtil.isNotEmpty(temps)) {
orderEntities.addAll(temps);
}
}
if (syncDataSetEntity.isOrderUnCheck()) {
OrderFilterRequest orderFilterRequest = new OrderFilterRequest();
BeanUtils.copyProperties(spsSyncDataRequest, orderFilterRequest);
orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_CHECK);
List<OrderEntity> temps = orderService.findAllByTime(orderFilterRequest);
if (CollUtil.isNotEmpty(temps)) {
orderEntities.addAll(temps);
}
}
if (syncDataSetEntity.isOrderScanFinish()) {
OrderFilterRequest orderFilterRequest = new OrderFilterRequest();
BeanUtils.copyProperties(spsSyncDataRequest, orderFilterRequest);
orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS);
orderFilterRequest.setReceiveStatus(ConstantStatus.RECEIVE_ED);
List<OrderEntity> temps = orderService.findAllByTime(orderFilterRequest);
if (CollUtil.isNotEmpty(temps)) {
orderEntities.addAll(temps);
}
List<WarehouseEntity> codes = codesService.findByReceiptId(orderEntity.getId());
if (CollUtil.isNotEmpty(codes)) {
warehouseEntityList.addAll(codes);
}
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);
}
}
}
syncOrderResponse.setOrderEntities(orderEntities);
syncOrderResponse.setOrderDetailEntityList(allOrderDetailEntityList);
syncOrderResponse.setWarehouseEntityList(warehouseEntityList);
}
SpsSyncOrderResponse syncOrderResponse = new SpsSyncOrderResponse();
syncOrderResponse.setOrderEntities(orderEntities);
syncOrderResponse.setOrderDetailEntityList(allOrderDetailEntityList);
syncOrderResponse.setWarehouseEntityList(warehouseEntityList);
return ResultVOUtils.success(syncOrderResponse);
}
@ -221,15 +291,18 @@ public class SpsSyncDownloadController {
//udi同步数据
@GetMapping("sps/sync/syncUdis")
public BaseResponse syncUdi(SpsSyncDataRequest spsSyncDataRequest) {
ProductInfoFilterRequest productInfoFilterRequest = new ProductInfoFilterRequest();
productInfoFilterRequest.setUpdateTime(spsSyncDataRequest.getLastUpdateTime());
List<ProductInfoEntity> productInfoEntityList = productInfoService.syncDlUdi(productInfoFilterRequest);
UdiCompanyRequest udiCompanyRequest = new UdiCompanyRequest();
udiCompanyRequest.setUpdateTime(spsSyncDataRequest.getLastUpdateTime());
List<UdiCompanyEntity> udiCompanyEntities = udiCompanyService.syncDlCompany(udiCompanyRequest);
SpSyncUdiResponse spSyncUdiResponse = new SpSyncUdiResponse();
spSyncUdiResponse.setUdiCompanyEntities(udiCompanyEntities);
spSyncUdiResponse.setProductInfoEntityList(productInfoEntityList);
SyncDataSetResponse syncDataSetEntity = syncDataSetService.selectSet();
if (syncDataSetEntity.isDbDiProducts()) {
ProductInfoFilterRequest productInfoFilterRequest = new ProductInfoFilterRequest();
productInfoFilterRequest.setUpdateTime(spsSyncDataRequest.getLastUpdateTime());
List<ProductInfoEntity> productInfoEntityList = productInfoService.syncDlUdi(productInfoFilterRequest);
UdiCompanyRequest udiCompanyRequest = new UdiCompanyRequest();
udiCompanyRequest.setUpdateTime(spsSyncDataRequest.getLastUpdateTime());
List<UdiCompanyEntity> udiCompanyEntities = udiCompanyService.syncDlCompany(udiCompanyRequest);
spSyncUdiResponse.setUdiCompanyEntities(udiCompanyEntities);
spSyncUdiResponse.setProductInfoEntityList(productInfoEntityList);
}
return ResultVOUtils.success(spSyncUdiResponse);
}

@ -1,5 +1,7 @@
package com.glxp.sale.admin.controller.basic;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.github.pagehelper.PageInfo;
@ -22,8 +24,10 @@ import com.glxp.sale.admin.res.basic.ErpProductsResponse;
import com.glxp.sale.admin.service.basic.BasicThirdSysDetailService;
import com.glxp.sale.admin.service.basic.UdiInfoService;
import com.glxp.sale.admin.service.basic.UdiRelevanceService;
import com.glxp.sale.admin.service.receipt.ProductInfoService;
import com.glxp.sale.admin.service.receipt.SyncUdiService;
import com.glxp.sale.admin.service.thrsys.ThrProductsService;
import com.glxp.sale.admin.thread.AsyncDiDlHelper;
import com.glxp.sale.admin.util.FilterUdiUtils;
import com.glxp.sale.admin.util.HttpClient;
import com.glxp.sale.common.enums.ResultEnum;
@ -59,16 +63,16 @@ public class UdiInfoController {
@Resource
private ErpBasicClient erpBasicClient;
@Resource
HttpClient httpClient;
@Resource
SyncUdiService syncUdiService;
@Resource
AsyncDiDlHelper asyncDiDlHelper;
@Resource
ProductInfoService productInfoService;
//获取同步库UDI信息
@AuthRuleAnnotation("")
@GetMapping("udiwms/udiinfo/filterUdi")
public BaseResponse filterUdi(FilterUdiInfoRequest filterUdiInfoRequest) {
Map<String, Object> paramMap = new HashMap<>(16);
String nameCode = null;
if (filterUdiInfoRequest.getUdiCode() != null && !filterUdiInfoRequest.getUdiCode().equals("")) {
UdiEntity udiEntity = FilterUdiUtils.getUdi(filterUdiInfoRequest.getUdiCode());
@ -79,28 +83,66 @@ public class UdiInfoController {
}
} else
nameCode = filterUdiInfoRequest.getNameCode();
// paramMap.put("page", productInfoFilterRequest.getPage());
// paramMap.put("limit", productInfoFilterRequest.getLimit());
// paramMap.put("ylqxzcrbarmc", productInfoFilterRequest.getYlqxzcrbarmc());
// paramMap.put("cpmctymc", productInfoFilterRequest.getCpmctymc());
// paramMap.put("nameCode", nameCode);
// paramMap.put("ggxh", productInfoFilterRequest.getGgxh());
// paramMap.put("zczbhhzbapzbh", productInfoFilterRequest.getZczbhhzbapzbh());
// paramMap.put("uuid", productInfoFilterRequest.getUuid());
ProductInfoFilterRequest productInfoFilterRequest = new ProductInfoFilterRequest();
BeanUtils.copyProperties(filterUdiInfoRequest, productInfoFilterRequest);
productInfoFilterRequest.setNameCode(nameCode);
// String response = httpClient.mipsGetHead(udiUrl + "/udidl/device/filterUdi", paramMap);
try {
BaseResponse<PageSimpleResponse<ProductInfoEntity>> udiDlDeviceResponse = syncUdiService.filterUdi(productInfoFilterRequest);
if (filterUdiInfoRequest.getIsCheck() != null && filterUdiInfoRequest.getIsCheck()) {
List<ProductInfoEntity> productInfoEntities = udiDlDeviceResponse.getData().getList();
List<UdiInfoEntity> udiInfoEntities = new ArrayList<>();
if (productInfoEntities != null && productInfoEntities.size() > 0) {
for (ProductInfoEntity productInfoEntity : productInfoEntities) {
UdiInfoEntity udiInfoEntity = new UdiInfoEntity();
List<UdiRelevanceEntity> udiRelevanceEntities = udiRelevanceService.selectByUuid(productInfoEntity.getUuid());
if (udiRelevanceEntities != null && udiRelevanceEntities.size() > 0) {
BeanUtils.copyProperties(productInfoEntity, udiInfoEntity);
for (UdiRelevanceEntity udiRelevanceEntity : udiRelevanceEntities) {
if (udiRelevanceEntity.getThirdId() == null &&
udiRelevanceEntity.getThirdId2() == null && udiRelevanceEntity.getThirdId1() == null &&
udiRelevanceEntity.getThirdId3() == null && udiRelevanceEntity.getThirdId4() == null) {
//不能添加
udiInfoEntity.setCheck(true);
break;
} else
udiInfoEntity.setCheck(false);
}
} else {
udiInfoEntity.setCheck(false);
}
udiInfoEntities.add(udiInfoEntity);
}
}
}
return udiDlDeviceResponse;
} catch (Exception e) {
e.printStackTrace();
return ResultVOUtils.error(500, "连接UDI数据下载服务出错");
}
}
@AuthRuleAnnotation("")
@GetMapping("udiwms/udiinfo/superSearch")
public BaseResponse superSearch(FilterUdiInfoRequest filterUdiInfoRequest) {
if (StrUtil.isEmpty(filterUdiInfoRequest.getNameCode())) {
return ResultVOUtils.error(500, "DI不能为空");
}
ProductInfoFilterRequest productInfoFilterRequest = new ProductInfoFilterRequest();
productInfoFilterRequest.setNameCode(filterUdiInfoRequest.getNameCode());
try {
// BaseResponse<PageSimpleResponse<UdiInfoEntity>> udiDlDeviceResponse =
// JSONObject.parseObject(response, new TypeReference<BaseResponse<PageSimpleResponse<UdiInfoEntity>>>() {
// });
BaseResponse<PageSimpleResponse<ProductInfoEntity>> udiDlDeviceResponse = syncUdiService.filterUdi(productInfoFilterRequest);
if (CollUtil.isEmpty(udiDlDeviceResponse.getData().getList())) {
List<ProductInfoEntity> productInfoEntityList = asyncDiDlHelper.dlByDi(filterUdiInfoRequest.getNameCode());
if (CollUtil.isNotEmpty(productInfoEntityList)) {
productInfoService.insertProductInfos(productInfoEntityList);
udiDlDeviceResponse = syncUdiService.filterUdi(productInfoFilterRequest);
}
}
if (filterUdiInfoRequest.getIsCheck() != null && filterUdiInfoRequest.getIsCheck()) {
List<ProductInfoEntity> productInfoEntities = udiDlDeviceResponse.getData().getList();
List<UdiInfoEntity> udiInfoEntities = new ArrayList<>();
@ -141,17 +183,8 @@ public class UdiInfoController {
@GetMapping("udiwms/udiinfo/filterCompany")
public BaseResponse filterCompany(UdiCompanyRequest udiCompanyRequest) {
// Map<String, Object> paramMap = new HashMap<>(16);
// paramMap.put("page", productInfoFilterRequest.getPage());
// paramMap.put("limit", productInfoFilterRequest.getLimit());
// paramMap.put("ylqxzcrbarmc", productInfoFilterRequest.getYlqxzcrbarmc());
// String response = httpClient.mipsGetHead(udiUrl + "/udi/company/filter", paramMap);
try {
BaseResponse<PageSimpleResponse<UdiCompanyEntity>> udiDlDeviceResponse = syncUdiService.filterCompany(udiCompanyRequest);
// BaseResponse<PageSimpleResponse<UdiCompanyEntity>> udiDlDeviceResponse = (BaseResponse<PageSimpleResponse<UdiCompanyEntity>>) JSONObject.parseObject(response, BaseResponse.class);
return udiDlDeviceResponse;
} catch (Exception e) {
e.printStackTrace();

@ -231,9 +231,9 @@ public class UdiRelevanceController {
}
WarehouseQueryRequest warehouseQueryRequest = new WarehouseQueryRequest();
warehouseQueryRequest.setRelId(ids);
if(StrUtil.isNotEmpty(ids)){
if (StrUtil.isNotEmpty(ids)) {
List<WarehouseEntity> warehouseEntityList = warehouseService.findByOrderId(warehouseQueryRequest);
if(CollUtil.isNotEmpty(warehouseEntityList)){
if (CollUtil.isNotEmpty(warehouseEntityList)) {
return ResultVOUtils.error(500, "该产品已被" + warehouseEntityList.get(0).getOrderId() + "订单关联不能删除");
}
}
@ -267,6 +267,15 @@ public class UdiRelevanceController {
}
udiRelevanceEntity.setUpdateTime(DateUtil.getDateTime());
udiRelevanceService.updateUdiRelevance(udiRelevanceEntity);
long customerId = customerService.getCustomerId();
if (customerId != 110) {
if (StrUtil.isNotEmpty(udiRelevanceEntity.getPrice())) {
CompanyProductRelevanceEntity companyProductRelevanceEntity = companyProductRelevanceService.findCompanyProductRelevanceByUdiRlIdFk(udiRelevanceEntity.getId(), customerId + "");
companyProductRelevanceEntity.setPrice(udiRelevanceEntity.getPrice());
companyProductRelevanceService.updateCompanyProductRelevance(companyProductRelevanceEntity);
}
}
return ResultVOUtils.success("更新成功");
}

@ -157,7 +157,7 @@ public class StockOrderController {
if (StringUtils.isBlank(stockOrderEntity.getId())) {
BussinessLocalTypeEntity bussinessLocalTypeEntity = bussinessLocalTypeService.findBTByAction(stockOrderEntity.getBillType());
if (StrUtil.isEmpty(stockOrderPostRequest.getBillNo())) {
String orderNo = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean("ZY" + MyStrUtil.trim(bussinessLocalTypeEntity.getLocalPrefix()), "yyyyMMdd"));
String orderNo = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.BUS_ORDER + MyStrUtil.trim(bussinessLocalTypeEntity.getLocalPrefix()), "yyyyMMdd"));
stockOrderPostRequest.setBillNo(orderNo);
stockOrderEntity.setBillNo(orderNo);
}
@ -254,9 +254,6 @@ public class StockOrderController {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<StockOrderEntity> stockOrderEntityList;
// if (stockOrderFilterRequest.getStatus() == null) {
// stockOrderFilterRequest.setStatus(0 + "");
// }
if (StringUtils.isNotBlank(stockOrderFilterRequest.getCorpId())) {
CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(stockOrderFilterRequest.getCorpId()));
@ -309,7 +306,22 @@ public class StockOrderController {
String customerId = getCustomerId();
if (customerId != null) {
if (customerId.equals(Constant.SYSTEM_CUSTOMER_ID)) {
Integer userId = customerService.getUserId();
stockOrderFilterRequest.setUnitIdFk(null);
stockOrderFilterRequest.setUserId(userId);
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 {
CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(customerId));
stockOrderFilterRequest.setUnitIdFk(companyEntity.getUnitIdFk());

@ -1,5 +1,6 @@
package com.glxp.sale.admin.controller.inout;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.sale.admin.annotation.AuthRuleAnnotation;
import com.glxp.sale.admin.constant.ConstantStatus;
@ -48,6 +49,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
@ -286,6 +288,9 @@ public class StockOrderDetailController {
stockOrderDetailEntity.setYlqxzcrbarmc(udiInfoEntity.getYlqxzcrbarmc());
stockOrderDetailEntity.setZczbhhzbapzbh(udiInfoEntity.getZczbhhzbapzbh());
stockOrderDetailEntity.setAllowNoBatch(udiInfoEntity.isAllowNoBatch());
if(StrUtil.isNotEmpty(udiInfoEntity.getPrice())){
stockOrderDetailEntity.setPrice(new BigDecimal(udiInfoEntity.getPrice()));
}
if (stockOrderIdsRequest.getUdiEntity() != null) {
UdiEntity udiEntity = stockOrderIdsRequest.getUdiEntity();
stockOrderDetailEntity.setBatchNo(udiEntity.getBatchNo());

@ -1,5 +1,6 @@
package com.glxp.sale.admin.controller.inout;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.github.pagehelper.PageInfo;
@ -13,6 +14,7 @@ import com.glxp.sale.admin.entity.basic.BussinessTypeEntity;
import com.glxp.sale.admin.entity.info.CompanyEntity;
import com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity;
import com.glxp.sale.admin.entity.inout.*;
import com.glxp.sale.admin.entity.inventory.InvProductDetailEntity;
import com.glxp.sale.admin.entity.param.SystemParamConfigEntity;
import com.glxp.sale.admin.entity.udid.UdiEntity;
import com.glxp.sale.admin.exception.JsonException;
@ -20,6 +22,7 @@ import com.glxp.sale.admin.req.basic.CompanyProductRelevanceRequest;
import com.glxp.sale.admin.req.basic.FilterUdiInfoRequest;
import com.glxp.sale.admin.req.info.FilterCompanyProductRelevanceRequest;
import com.glxp.sale.admin.req.inout.*;
import com.glxp.sale.admin.req.inventory.FilterInvProductDetailRequest;
import com.glxp.sale.admin.res.PageSimpleResponse;
import com.glxp.sale.admin.res.basic.BussinessTypResponse;
import com.glxp.sale.admin.res.basic.CompanyProductRelevanceResponse;
@ -33,6 +36,7 @@ import com.glxp.sale.admin.service.basic.UdiRelevanceService;
import com.glxp.sale.admin.service.info.CompanyProductRelevanceService;
import com.glxp.sale.admin.service.info.CompanyService;
import com.glxp.sale.admin.service.inout.*;
import com.glxp.sale.admin.service.inventory.InvPreInProductDetailService;
import com.glxp.sale.admin.service.param.SystemParamConfigService;
import com.glxp.sale.admin.thread.IoTransInoutService;
import com.glxp.sale.admin.util.*;
@ -259,6 +263,7 @@ public class WareHouseController {
orderEntity1.setFromCorpId(addOrderRequest.getFromCorpId());
orderEntity1.setLocStorageCode(addOrderRequest.getLocStorageCode());
orderEntity1.setOutChangeEnable(addOrderRequest.isOutChangeEnable());
orderEntity1.setPreCheck(addOrderRequest.isPreCheck());
orderEntity1.setUpdateTime(new Date());
orderService.updateOrder(orderEntity1);
WarehouseEntity warehouseEntity = new WarehouseEntity();
@ -325,6 +330,9 @@ public class WareHouseController {
}
@Resource
InvPreInProductDetailService invPreInProductDetailService;
//网页端数据上传调用接口
@AuthRuleAnnotation("")
@PostMapping("warehouse/inout/addOrderWeb")
@ -387,6 +395,16 @@ public class WareHouseController {
}
//预验收校验
if (addOrderRequest.isPreCheck()) {
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
filterInvProductDetailRequest.setOriginCode(code);
List<InvProductDetailEntity> invProductDetailEntities = invPreInProductDetailService.filterInvProduct(filterInvProductDetailRequest);
if(CollUtil.isEmpty(invProductDetailEntities)){
return ResultVOUtils.error(500, "该产品未入库!");
}
}
String orderId = addOrderRequest.getOrderId();
if (addOrderRequest.getCustomerId() != null && (addOrderRequest.getFromCorpId() == null || "".equals(addOrderRequest.getFromCorpId()))) {
CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(addOrderRequest.getCustomerId()));
@ -494,6 +512,7 @@ public class WareHouseController {
orderSaveRequest.setLocStorageCode(addOrderRequest.getLocStorageCode());
orderSaveRequest.setFromCorpId(addOrderRequest.getFromCorpId());
orderSaveRequest.setFromCorp(addOrderRequest.getFromCorp());
orderSaveRequest.setPreCheck(addOrderRequest.isPreCheck());
orderSaveRequest.setFromType(ConstantStatus.FROM_WEBNEW);
orderSaveRequest.setStatus(ConstantStatus.ORDER_STATUS_TEMP_SAVE);
orderSaveRequest.setExportStatus(ConstantStatus.ORDER_EXPORT_UN);

@ -54,55 +54,58 @@ public class CheckOrderUtils {
filterUdiInfoRequest.setNameCode(myErpOrder.getNameCode());
UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectGroupById(myErpOrder.getBindRlFk());
for (ErpOrderEntity vailOrderEntity : vailOrderEntities) {
if (checkId(vailOrderEntity, udiRelevanceResponse, bussinessTypeEntity) == null
&& checkBatchNo(vailOrderEntity, myErpOrder) == null
&& checkProductDate(vailOrderEntity, myErpOrder) == null
&& checkExpireDate(vailOrderEntity, myErpOrder) == null
&& checkWarehouse(vailOrderEntity, myErpOrder) == null
&& checkCount(vailOrderEntity, myErpOrder) == null
) {
myErpOrder.setErpOrderId(vailOrderEntity.getErpOrderId());
myErpOrder.setErpCount(vailOrderEntity.getErpCount());
myErpOrder.setReCount(vailOrderEntity.getReCount());
myErpOrder.setGoodsname(vailOrderEntity.getGoodsname());
myErpOrder.setGoodsid(vailOrderEntity.getGoodsid());
myErpOrder.setStatus("success");
vailOrderEntity.setStatus("success");
orderDetailService.updateErpOrder(myErpOrder);
break;
} else {
errMsg = checkBatchNo(vailOrderEntity, myErpOrder);
if (errMsg == null) {
errMsg = checkId(vailOrderEntity, udiRelevanceResponse, bussinessTypeEntity);
if(!vailOrderEntity.isCheckSuccess()){
if (checkId(vailOrderEntity, udiRelevanceResponse, bussinessTypeEntity) == null
&& checkBatchNo(vailOrderEntity, myErpOrder) == null
&& checkProductDate(vailOrderEntity, myErpOrder) == null
&& checkExpireDate(vailOrderEntity, myErpOrder) == null
&& checkWarehouse(vailOrderEntity, myErpOrder) == null
&& checkCount(vailOrderEntity, myErpOrder) == null
) {
myErpOrder.setErpOrderId(vailOrderEntity.getErpOrderId());
myErpOrder.setErpCount(vailOrderEntity.getErpCount());
myErpOrder.setReCount(vailOrderEntity.getReCount());
myErpOrder.setGoodsname(vailOrderEntity.getGoodsname());
myErpOrder.setGoodsid(vailOrderEntity.getGoodsid());
myErpOrder.setStatus("success");
vailOrderEntity.setStatus("success");
vailOrderEntity.setCheckSuccess(true);
orderDetailService.updateErpOrder(myErpOrder);
break;
} else {
errMsg = checkBatchNo(vailOrderEntity, myErpOrder);
if (errMsg == null) {
errMsg = checkProductDate(vailOrderEntity, myErpOrder);
errMsg = checkId(vailOrderEntity, udiRelevanceResponse, bussinessTypeEntity);
if (errMsg == null) {
errMsg = checkExpireDate(vailOrderEntity, myErpOrder);
errMsg = checkProductDate(vailOrderEntity, myErpOrder);
if (errMsg == null) {
errMsg = checkWarehouse(vailOrderEntity, myErpOrder);
errMsg = checkExpireDate(vailOrderEntity, myErpOrder);
if (errMsg == null) {
errMsg = checkCount(vailOrderEntity, myErpOrder);
if (errMsg != null) {
myErpOrder.setErpCount(vailOrderEntity.getErpCount());
myErpOrder.setReCount(vailOrderEntity.getReCount());
myErpOrder.setGoodsname(vailOrderEntity.getGoodsname());
myErpOrder.setGoodsid(vailOrderEntity.getGoodsid());
myErpOrder.setStatus("fail");
vailOrderEntity.setStatus("fail");
orderDetailService.updateErpOrder(myErpOrder);
break;
errMsg = checkWarehouse(vailOrderEntity, myErpOrder);
if (errMsg == null) {
errMsg = checkCount(vailOrderEntity, myErpOrder);
if (errMsg != null) {
myErpOrder.setErpCount(vailOrderEntity.getErpCount());
myErpOrder.setReCount(vailOrderEntity.getReCount());
myErpOrder.setGoodsname(vailOrderEntity.getGoodsname());
myErpOrder.setGoodsid(vailOrderEntity.getGoodsid());
myErpOrder.setStatus("fail");
vailOrderEntity.setStatus("fail");
orderDetailService.updateErpOrder(myErpOrder);
break;
}
}
}
}
}
}
}
}
}
}
}

@ -0,0 +1,171 @@
package com.glxp.sale.admin.controller.inventory;
import cn.hutool.core.collection.CollUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.sale.admin.annotation.AuthRuleAnnotation;
import com.glxp.sale.admin.constant.ConstantStatus;
import com.glxp.sale.admin.constant.ConstantType;
import com.glxp.sale.admin.entity.info.CompanyEntity;
import com.glxp.sale.admin.entity.inventory.InvProductDetailEntity;
import com.glxp.sale.admin.entity.inventory.InvProductEntity;
import com.glxp.sale.admin.req.inout.DeleteRequest;
import com.glxp.sale.admin.req.inventory.FilterInvProductDetailRequest;
import com.glxp.sale.admin.req.inventory.FilterInvProductRequest;
import com.glxp.sale.admin.res.PageSimpleResponse;
import com.glxp.sale.admin.res.inventory.InvProductDetailResponse;
import com.glxp.sale.admin.res.inventory.InvProductPageRespnonse;
import com.glxp.sale.admin.res.inventory.InvProductResponse;
import com.glxp.sale.admin.res.inventory.InvProductStatResponse;
import com.glxp.sale.admin.service.info.CompanyService;
import com.glxp.sale.admin.service.inventory.InvPreInProductDetailService;
import com.glxp.sale.admin.service.inventory.InvPreInProductService;
import com.glxp.sale.admin.util.Constant;
import com.glxp.sale.common.enums.ResultEnum;
import com.glxp.sale.common.res.BaseResponse;
import com.glxp.sale.common.util.ResultVOUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@RestController
public class InvPreInProductsController {
@Resource
InvPreInProductService invProductService;
@Resource
InvPreInProductDetailService invProductDetailService;
@Resource
private CompanyService companyService;
@AuthRuleAnnotation("")
@GetMapping("spms/prein/inv/products/filter")
public BaseResponse filterInvProduct(FilterInvProductRequest filterInvProductRequest) {
boolean showSup = false;
if (Constant.SYSTEM_CUSTOMER_ID.equals(filterInvProductRequest.getCustomerId())) {
filterInvProductRequest.setCustomerId(null);
showSup = true;
} else {
CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(filterInvProductRequest.getCustomerId()));
filterInvProductRequest.setSupId(companyEntity.getUnitIdFk());
filterInvProductRequest.setCustomerId(null);
}
List<InvProductResponse> invProductResponses = invProductService.filterJoinInvProduct(filterInvProductRequest);
PageInfo<InvProductResponse> pageInfo;
pageInfo = new PageInfo<>(invProductResponses);
InvProductPageRespnonse<InvProductResponse> pageSimpleResponse = new InvProductPageRespnonse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(invProductResponses);
pageSimpleResponse.setShowSup(showSup);
return ResultVOUtils.success(pageSimpleResponse);
}
@AuthRuleAnnotation("")
@GetMapping("spms/prein/inv/products/isExist")
public BaseResponse isExistInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest) {
List<InvProductDetailEntity> invProductResponses = invProductDetailService.filterInvProduct(filterInvProductDetailRequest);
if (CollUtil.isNotEmpty(invProductResponses)) {
return ResultVOUtils.success("success");
}
return ResultVOUtils.error(501, "库存不存在此产品");
}
@AuthRuleAnnotation("")
@GetMapping("spms/prein/inv/products/getAllCode")
public BaseResponse getAllCodees(FilterInvProductDetailRequest filterInvProductDetailRequest) {
List<String> invProductResponses = invProductDetailService.findAllCode(filterInvProductDetailRequest);
if (CollUtil.isNotEmpty(invProductResponses)) {
return ResultVOUtils.success(invProductResponses);
}
return ResultVOUtils.error(501, "未入库");
}
@AuthRuleAnnotation("")
@GetMapping("spms/prein/inv/products/filterDetail")
public BaseResponse filterInvProductDetail(FilterInvProductDetailRequest filterInvProductRequest) {
if (Constant.SYSTEM_CUSTOMER_ID.equals(filterInvProductRequest.getCustomerId())) {
filterInvProductRequest.setCustomerId(null);
}
List<InvProductDetailEntity> invProductDetailEntities = invProductDetailService.filterInvProduct(filterInvProductRequest);
PageInfo<InvProductDetailEntity> pageInfo;
pageInfo = new PageInfo<>(invProductDetailEntities);
List<InvProductDetailResponse> invProductDetailResponses = new ArrayList<>();
if (invProductDetailEntities.size() > 0) {
for (InvProductDetailEntity invProductDetailEntity : invProductDetailEntities) {
InvProductDetailResponse invProductDetailResponse = new InvProductDetailResponse();
BeanUtils.copyProperties(invProductDetailEntity, invProductDetailResponse);
if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
invProductDetailResponse.setMainActionStr("出库");
invProductDetailResponse.setOutCount(invProductDetailEntity.getCount());
} else {
invProductDetailResponse.setMainActionStr("入库");
invProductDetailResponse.setInCount(invProductDetailEntity.getCount());
}
invProductDetailResponses.add(invProductDetailResponse);
}
}
PageSimpleResponse<InvProductDetailResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(invProductDetailResponses);
return ResultVOUtils.success(pageSimpleResponse);
}
@AuthRuleAnnotation("")
@PostMapping("spms/prein/inv/products/delete")
public BaseResponse deleteInvProduct(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
String id = deleteRequest.getId();
InvProductEntity invProductEntity = invProductService.selectById(id);
if (invProductEntity != null) {
invProductService.deleteById(id);
FilterInvProductDetailRequest detailRequest = new FilterInvProductDetailRequest();
detailRequest.setSupId(invProductEntity.getSupId());
detailRequest.setBatchNo(invProductEntity.getBatchNo());
detailRequest.setProductIdFk(invProductEntity.getRelIdFk());
invProductDetailService.deleteByProductId(detailRequest);
return ResultVOUtils.success("删除成功");
} else {
return ResultVOUtils.error(500, "删除失败!");
}
}
@AuthRuleAnnotation("")
@GetMapping("spms/prein/inv/products/stat")
public BaseResponse statInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest) {
InvProductStatResponse invProductStatResponse = new InvProductStatResponse();
//统计预入库数量
FilterInvProductDetailRequest temp1 = new FilterInvProductDetailRequest();
BeanUtils.copyProperties(filterInvProductDetailRequest, temp1);
temp1.setPurchaseType(ConstantStatus.PRUCHASE_ADVANCE);
invProductStatResponse.setAdvanceCount(invProductDetailService.statCount(temp1));
//统计普通采购数量
FilterInvProductDetailRequest temp2 = new FilterInvProductDetailRequest();
BeanUtils.copyProperties(filterInvProductDetailRequest, temp2);
temp2.setPurchaseType(ConstantStatus.PRUCHASE_COMMON);
invProductStatResponse.setCommonCount(invProductDetailService.statCount(temp2));
//统计入库数量
FilterInvProductDetailRequest temp3 = new FilterInvProductDetailRequest();
BeanUtils.copyProperties(filterInvProductDetailRequest, temp3);
temp3.setMainAction(ConstantType.TYPE_PUT);
invProductStatResponse.setInCount(invProductDetailService.statCount(temp3));
//统计出库数量
FilterInvProductDetailRequest temp4 = new FilterInvProductDetailRequest();
BeanUtils.copyProperties(filterInvProductDetailRequest, temp4);
temp4.setMainAction(ConstantType.TYPE_OUT);
invProductStatResponse.setOutCount(invProductDetailService.statCount(temp4));
return ResultVOUtils.success(invProductStatResponse);
}
}

@ -67,8 +67,6 @@ public class InvWarehouseController {
@Resource
InvProductDetailService invProductDetailService;
@Resource
BussinessTypeService bussinessTypeService;
@Resource
WarehouseBussinessTypeService warehouseBussinessTypeService;
@ -293,11 +291,6 @@ public class InvWarehouseController {
}
InvWarehouseEntity invWarehouseEntity = invWarehouseService.selectByCode(request.getCode());
// InvProductDetailEntity invProductDetailEntity = invProductDetailService.isExit(invWarehouseEntity.getCode());
// if (invProductDetailEntity != null) {
// return ResultVOUtils.error(500, "该仓库已有库存,不能删除!");
// }
FilterInvWarehouseRequest filterInvWarehouseRequest = new FilterInvWarehouseRequest();
filterInvWarehouseRequest.setCode(invWarehouseEntity.getCode());
List<InvWarehouseEntity> warehouseEntities = invWarehouseService.filterAllByUser(filterInvWarehouseRequest);

@ -0,0 +1,50 @@
package com.glxp.sale.admin.controller.param;
import com.alibaba.fastjson.JSON;
import com.glxp.sale.admin.annotation.AuthRuleAnnotation;
import com.glxp.sale.admin.entity.param.SyncDataSetEntity;
import com.glxp.sale.admin.res.param.SyncDataSetResponse;
import com.glxp.sale.admin.service.param.SyncDataSetService;
import com.glxp.sale.admin.util.BeanUtils;
import com.glxp.sale.common.enums.ResultEnum;
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 javax.validation.Valid;
@RestController
public class SyncDataSetController {
@Resource
private SyncDataSetService syncDataSetService;
@AuthRuleAnnotation("system/param/syncData/config")
@GetMapping("/system/param/syncData/config")
public BaseResponse list() {
return ResultVOUtils.success(syncDataSetService.selectSet());
}
@AuthRuleAnnotation("system/param/syncData/save")
@PostMapping("/system/param/syncData/save")
public BaseResponse save(@RequestBody @Valid SyncDataSetResponse syncDataSetResponse
) {
SyncDataSetEntity syncDataSetEntity = new SyncDataSetEntity();
BeanUtils.copyProperties(syncDataSetResponse, syncDataSetEntity);
syncDataSetEntity.setBusTypes(JSON.toJSONString(syncDataSetResponse.getBusTypes()));
boolean b = syncDataSetService.insert(syncDataSetEntity);
if (!b) {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
}
return ResultVOUtils.success();
}
}

@ -4,6 +4,7 @@ import com.glxp.sale.admin.entity.basic.BussinessOriginTypeEntity;
import com.glxp.sale.admin.req.basic.BussinessOriginTypeFilterRequest;
import com.glxp.sale.admin.res.basic.BussinessOriginTypeResponse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -19,4 +20,6 @@ public interface BussinessOriginTypeDao {
boolean updateBusOriginType(BussinessOriginTypeEntity bussinessTypeEntity);
boolean insertBusOriginType(BussinessOriginTypeEntity bussinessTypeEntity);
boolean deleteById(@Param("id") String id);
}

@ -0,0 +1,31 @@
package com.glxp.sale.admin.dao.inventory;
import com.glxp.sale.admin.entity.inventory.InvProductEntity;
import com.glxp.sale.admin.req.inventory.FilterInvProductRequest;
import com.glxp.sale.admin.res.inventory.InvProductResponse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface InvPreInProductDao {
List<InvProductEntity> filterInvProduct(FilterInvProductRequest filterInvProductRequest);
List<InvProductResponse> filterJoinInvProduct(FilterInvProductRequest filterInvProductRequest);
boolean insertInvProduct(InvProductEntity invProductEntity);
boolean updateInvProduct(InvProductEntity invProductEntity);
InvProductEntity selectByUuid(@Param("relIdFk") String relIdFk, @Param("batchNo") String batchNo,
@Param("supId") String supId, @Param("invStorageCode") String invStorageCode,
@Param("invWarehouseCode") String invWarehouseCode);
InvProductEntity selectById(@Param("id") String id);
InvProductEntity selectExit(@Param("relIdFk") String id);
boolean deleteById(@Param("id") String id);
}

@ -0,0 +1,31 @@
package com.glxp.sale.admin.dao.inventory;
import com.glxp.sale.admin.entity.inventory.InvProductDetailEntity;
import com.glxp.sale.admin.req.inventory.FilterInvProductDetailRequest;
import com.glxp.sale.admin.res.inventory.InvProductDetailJoinResponse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface InvPreInProductDetailDao {
List<InvProductDetailEntity> filterInvProductDetail(FilterInvProductDetailRequest filterInvProductDetailRequest);
List<InvProductDetailJoinResponse> filterJoinInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest);
boolean insertInvProductDetail(InvProductDetailEntity invProductDetailEntity);
boolean insertInvProductDetails(@Param("invProductDetailEntitys") List<InvProductDetailEntity> invProductDetailEntitys);
boolean updateInvProductDetail(InvProductDetailEntity invProductDetailEntity);
boolean deleteById(@Param("id") String id);
boolean deleteByProductId(FilterInvProductDetailRequest filterInvProductDetailRequest);
int statCount(FilterInvProductDetailRequest filterInvProductDetailRequest);
List<String> findAllCode(FilterInvProductDetailRequest filterInvProductDetailRequest);
}

@ -0,0 +1,11 @@
package com.glxp.sale.admin.dao.param;
import com.glxp.sale.admin.entity.param.SyncDataSetEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface SyncDataSetDao {
SyncDataSetEntity selectSet();
boolean insert(SyncDataSetEntity syncDataSetEntity);
}

@ -28,4 +28,5 @@ public class BussinessLocalTypeEntity {
private Date updateTime;
private String prefix;
private String localPrefix;
private boolean preIn;
}

@ -56,5 +56,6 @@ public class BussinessTypeEntity {
private String prefix;
private String localPrefix;
private boolean preIn;
}

@ -34,6 +34,8 @@ public class UdiRelevanceEntity {
private String originUuid;
private boolean allowNoBatch;
private String price;
public Integer getLockStatus() {
if (lockStatus == null)
return 1;

@ -2,7 +2,9 @@ package com.glxp.sale.admin.entity.info;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.poi.hpsf.Decimal;
import java.math.BigDecimal;
import java.util.Date;
@Data
@ -20,5 +22,5 @@ public class CompanyProductRelevanceEntity {
private String productUuid;
private Integer udiRlIdFk;
private String unitFk;
private String price;
}

@ -67,7 +67,7 @@ public class ErpOrderEntity {
private String secSalesInvNo;
private String invoiceDate;
private BigDecimal price;
private boolean checkSuccess;
public Integer getBindStatus() {
if (bindStatus == null)

@ -47,5 +47,6 @@ public class OrderEntity {
private boolean outChangeEnable;
private String originUllageSupNo;
private Date updateTime;
private boolean preCheck;
}

@ -0,0 +1,27 @@
package com.glxp.sale.admin.entity.param;
import lombok.Data;
import java.util.List;
@Data
public class SyncDataSetEntity {
private Integer id;
private boolean typeBus;
private boolean typeScan;
private boolean typeThird;
private boolean basicProducts;
private boolean basicCorp;
private boolean basicInv;
private boolean basicThirdProducts;
private boolean basicThirdCorp;
private boolean basicThirdInv;
private boolean basicThirdBusOrder;
private boolean dbDiProducts;
private boolean downstreamEnable;
private boolean orderScanFinish;
private boolean orderUnReceive;
private boolean orderUnCheck;
private String busTypes;
private Integer syncTime;
}

@ -23,4 +23,5 @@ public class AddOrderRequest {
private boolean outChangeEnable;
private boolean ignoreExpire;
private boolean ignoreRecentExpire;
private boolean preCheck;
}

@ -3,6 +3,8 @@ package com.glxp.sale.admin.req.inout;
import com.glxp.sale.admin.req.ListPageRequest;
import lombok.Data;
import java.util.List;
@Data
public class OrderFilterRequest extends ListPageRequest {
@ -33,4 +35,5 @@ public class OrderFilterRequest extends ListPageRequest {
private String locStorageCode;
private String lastUpdateTime;
private Integer unionUser;
private List<String> filterActions;
}

@ -57,4 +57,5 @@ public class BussinessTypResponse {
private boolean expireTip;
private String prefix;
private String localPrefix;
private boolean preIn;
}

@ -66,5 +66,6 @@ public class CompanyProductRelevanceResponse {
private String cpms;
private String supName;
private boolean allowNoBatch;
private String price;
}

@ -0,0 +1,29 @@
package com.glxp.sale.admin.res.param;
import lombok.Data;
import java.util.List;
@Data
public class SyncDataSetResponse {
private Integer id;
private boolean typeBus;
private boolean typeScan;
private boolean typeThird;
private boolean basicProducts;
private boolean basicCorp;
private boolean basicInv;
private boolean basicThirdProducts;
private boolean basicThirdCorp;
private boolean basicThirdInv;
private boolean basicThirdBusOrder;
private boolean dbDiProducts;
private boolean downstreamEnable;
private boolean orderScanFinish;
private boolean orderUnReceive;
private boolean orderUnCheck;
private List<String> busTypes;
private Integer syncTime;
}

@ -14,8 +14,20 @@ public interface BussinessOriginTypeService {
BussinessOriginTypeEntity findByAction(String action);
BasicThirdSysDetailEntity findSysByAction(String action, String key);
List<BussinessOriginTypeEntity> filterEnableList(BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest);
BussinessOriginTypeResponse finAllByAction(String action);
List<BussinessOriginTypeEntity> filterList(BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest);
boolean updateBusOriginType(BussinessOriginTypeEntity bussinessTypeEntity);
boolean insertBusOriginType(BussinessOriginTypeEntity bussinessTypeEntity);
List<BussinessOriginTypeResponse> filterJoinList(BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest);
BussinessOriginTypeResponse finByThirdAction(String action);
@ -24,12 +36,6 @@ public interface BussinessOriginTypeService {
BussinessOriginTypeResponse finByMainAction(String action);
BasicThirdSysDetailEntity findSysByAction(String action, String key);
List<BussinessOriginTypeEntity> filterList(BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest);
boolean updateBusOriginType(BussinessOriginTypeEntity bussinessTypeEntity);
boolean insertBusOriginType(BussinessOriginTypeEntity bussinessTypeEntity);
boolean deleteById(String id);
}

@ -33,11 +33,57 @@ public class BussinessOriginTypeServiceImpl implements BussinessOriginTypeServic
return null;
}
@Override
public BasicThirdSysDetailEntity findSysByAction(String action, String key) {
BussinessOriginTypeEntity bussinessOriginTypeEntity = findByAction(action);
if (bussinessOriginTypeEntity != null) {
BasicThirdSysDetailEntity basicThirdSysDetailEntity = basicThirdSysDetailService.selectByKey(key, bussinessOriginTypeEntity.getThirdSys());
// basicThirdSysDetailEntity.setLocalAction(bussinessTypResponse.getLocalAction());
return basicThirdSysDetailEntity;
}
return null;
}
@Override
public List<BussinessOriginTypeEntity> filterEnableList(BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest) {
return bussinessOriginTypeDao.filterEnableList(bussinessOriginTypeFilterRequest);
}
@Override
public BussinessOriginTypeResponse finAllByAction(String action) {
BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest = new BussinessOriginTypeFilterRequest();
bussinessOriginTypeFilterRequest.setAction(action);
List<BussinessOriginTypeResponse> bussinessOriginTypeEntities = bussinessOriginTypeDao.filterJoinList(bussinessOriginTypeFilterRequest);
if (bussinessOriginTypeEntities != null && bussinessOriginTypeEntities.size() > 0) {
return bussinessOriginTypeEntities.get(0);
}
return null;
}
@Override
public List<BussinessOriginTypeEntity> filterList(BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest) {
if (bussinessOriginTypeFilterRequest == null) {
return Collections.emptyList();
}
if (bussinessOriginTypeFilterRequest.getPage() != null) {
int offset = (bussinessOriginTypeFilterRequest.getPage() - 1) * bussinessOriginTypeFilterRequest.getLimit();
PageHelper.offsetPage(offset, bussinessOriginTypeFilterRequest.getLimit());
}
List<BussinessOriginTypeEntity> data = bussinessOriginTypeDao.filterList(bussinessOriginTypeFilterRequest);
return data;
}
@Override
public boolean updateBusOriginType(BussinessOriginTypeEntity bussinessTypeEntity) {
return bussinessOriginTypeDao.updateBusOriginType(bussinessTypeEntity);
}
@Override
public boolean insertBusOriginType(BussinessOriginTypeEntity bussinessTypeEntity) {
return bussinessOriginTypeDao.insertBusOriginType(bussinessTypeEntity);
}
@Override
public List<BussinessOriginTypeResponse> filterJoinList(BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest) {
return bussinessOriginTypeDao.filterJoinList(bussinessOriginTypeFilterRequest);
@ -77,37 +123,7 @@ public class BussinessOriginTypeServiceImpl implements BussinessOriginTypeServic
}
@Override
public BasicThirdSysDetailEntity findSysByAction(String action, String key) {
BussinessOriginTypeEntity bussinessOriginTypeEntity = findByAction(action);
if (bussinessOriginTypeEntity != null) {
BasicThirdSysDetailEntity basicThirdSysDetailEntity = basicThirdSysDetailService.selectByKey(key, bussinessOriginTypeEntity.getThirdSys());
// basicThirdSysDetailEntity.setLocalAction(bussinessTypResponse.getLocalAction());
return basicThirdSysDetailEntity;
}
return null;
}
@Override
public List<BussinessOriginTypeEntity> filterList(BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest) {
if (bussinessOriginTypeFilterRequest == null) {
return Collections.emptyList();
}
if (bussinessOriginTypeFilterRequest.getPage() != null) {
int offset = (bussinessOriginTypeFilterRequest.getPage() - 1) * bussinessOriginTypeFilterRequest.getLimit();
PageHelper.offsetPage(offset, bussinessOriginTypeFilterRequest.getLimit());
}
List<BussinessOriginTypeEntity> data = bussinessOriginTypeDao.filterList(bussinessOriginTypeFilterRequest);
return data;
}
@Override
public boolean updateBusOriginType(BussinessOriginTypeEntity bussinessTypeEntity) {
return bussinessOriginTypeDao.updateBusOriginType(bussinessTypeEntity);
}
@Override
public boolean insertBusOriginType(BussinessOriginTypeEntity bussinessTypeEntity) {
return bussinessOriginTypeDao.insertBusOriginType(bussinessTypeEntity);
public boolean deleteById(String id) {
return bussinessOriginTypeDao.deleteById(id);
}
}

@ -0,0 +1,29 @@
package com.glxp.sale.admin.service.inventory;
import com.glxp.sale.admin.entity.inventory.InvProductDetailEntity;
import com.glxp.sale.admin.req.inventory.FilterInvProductDetailRequest;
import com.glxp.sale.admin.res.inventory.InvProductDetailJoinResponse;
import java.util.List;
public interface InvPreInProductDetailService {
List<InvProductDetailEntity> filterInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest);
List<InvProductDetailJoinResponse> filterJoinInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest);
boolean insertInvProduct(InvProductDetailEntity invProductDetailEntity);
boolean insertInvProducts(List<InvProductDetailEntity> invProductDetailEntitys);
boolean updateInvProduct(InvProductDetailEntity invProductDetailEntity);
boolean deleteById(String id);
boolean deleteByProductId(FilterInvProductDetailRequest filterInvProductDetailRequest);
int statCount(FilterInvProductDetailRequest filterInvProductDetailRequest);
List<String> findAllCode(FilterInvProductDetailRequest filterInvProductDetailRequest);
}

@ -0,0 +1,26 @@
package com.glxp.sale.admin.service.inventory;
import com.glxp.sale.admin.entity.inventory.InvProductEntity;
import com.glxp.sale.admin.req.inventory.FilterInvProductRequest;
import com.glxp.sale.admin.res.inventory.InvProductResponse;
import java.util.List;
public interface InvPreInProductService {
List<InvProductEntity> filterInvProduct(FilterInvProductRequest filterInvProductRequest);
List<InvProductResponse> filterJoinInvProduct(FilterInvProductRequest filterInvProductRequest);
InvProductEntity selectByUuid(String uuid, String batchNo, String supId, String invStorageCode, String invWarehouseCode);
InvProductEntity selectExit(String id);
InvProductEntity selectById(String id);
boolean insertInvProduct(InvProductEntity invProductEntity);
boolean updateInvProduct(InvProductEntity invProductEntity);
boolean deleteById(String id);
}

@ -0,0 +1,81 @@
package com.glxp.sale.admin.service.inventory.impl;
import com.github.pagehelper.PageHelper;
import com.glxp.sale.admin.dao.inventory.InvPreInProductDetailDao;
import com.glxp.sale.admin.entity.inventory.InvProductDetailEntity;
import com.glxp.sale.admin.req.inventory.FilterInvProductDetailRequest;
import com.glxp.sale.admin.res.inventory.InvProductDetailJoinResponse;
import com.glxp.sale.admin.service.inventory.InvPreInProductDetailService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Service
public class InvPreInProductDetailServiceImpl implements InvPreInProductDetailService {
@Resource
InvPreInProductDetailDao invPreInProductDetailDao;
@Override
public List<InvProductDetailEntity> filterInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest) {
if (filterInvProductDetailRequest == null) {
return Collections.emptyList();
}
if (filterInvProductDetailRequest.getPage() != null) {
int offset = (filterInvProductDetailRequest.getPage() - 1) * filterInvProductDetailRequest.getLimit();
PageHelper.offsetPage(offset, filterInvProductDetailRequest.getLimit());
}
List<InvProductDetailEntity> data = invPreInProductDetailDao.filterInvProductDetail(filterInvProductDetailRequest);
return data;
}
@Override
public List<InvProductDetailJoinResponse> filterJoinInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest) {
if (filterInvProductDetailRequest == null) {
return Collections.emptyList();
}
if (filterInvProductDetailRequest.getPage() != null) {
int offset = (filterInvProductDetailRequest.getPage() - 1) * filterInvProductDetailRequest.getLimit();
PageHelper.offsetPage(offset, filterInvProductDetailRequest.getLimit());
}
List<InvProductDetailJoinResponse> data = invPreInProductDetailDao.filterJoinInvProduct(filterInvProductDetailRequest);
return data;
}
@Override
public boolean insertInvProduct(InvProductDetailEntity invProductDetailEntity) {
return invPreInProductDetailDao.insertInvProductDetail(invProductDetailEntity);
}
@Override
public boolean insertInvProducts(List<InvProductDetailEntity> invProductDetailEntitys) {
return invPreInProductDetailDao.insertInvProductDetails(invProductDetailEntitys);
}
@Override
public boolean updateInvProduct(InvProductDetailEntity invProductDetailEntity) {
return invPreInProductDetailDao.updateInvProductDetail(invProductDetailEntity);
}
@Override
public boolean deleteById(String id) {
return invPreInProductDetailDao.deleteById(id);
}
@Override
public boolean deleteByProductId(FilterInvProductDetailRequest filterInvProductDetailRequest) {
return invPreInProductDetailDao.deleteByProductId(filterInvProductDetailRequest);
}
@Override
public int statCount(FilterInvProductDetailRequest filterInvProductDetailRequest) {
return invPreInProductDetailDao.statCount(filterInvProductDetailRequest);
}
@Override
public List<String> findAllCode(FilterInvProductDetailRequest filterInvProductDetailRequest) {
return invPreInProductDetailDao.findAllCode(filterInvProductDetailRequest);
}
}

@ -0,0 +1,76 @@
package com.glxp.sale.admin.service.inventory.impl;
import com.github.pagehelper.PageHelper;
import com.glxp.sale.admin.dao.inventory.InvPreInProductDao;
import com.glxp.sale.admin.entity.inventory.InvProductEntity;
import com.glxp.sale.admin.req.inventory.FilterInvProductRequest;
import com.glxp.sale.admin.res.inventory.InvProductResponse;
import com.glxp.sale.admin.service.inventory.InvPreInProductService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Service
public class InvPreInProductServiceImpl implements InvPreInProductService {
@Resource
InvPreInProductDao invPreInProductDao;
@Override
public List<InvProductEntity> filterInvProduct(FilterInvProductRequest filterInvProductRequest) {
if (filterInvProductRequest == null) {
return Collections.emptyList();
}
if (filterInvProductRequest.getPage() != null) {
int offset = (filterInvProductRequest.getPage() - 1) * filterInvProductRequest.getLimit();
PageHelper.offsetPage(offset, filterInvProductRequest.getLimit());
}
List<InvProductEntity> data = invPreInProductDao.filterInvProduct(filterInvProductRequest);
return data;
}
@Override
public List<InvProductResponse> filterJoinInvProduct(FilterInvProductRequest filterInvProductRequest) {
if (filterInvProductRequest == null) {
return Collections.emptyList();
}
if (filterInvProductRequest.getPage() != null) {
int offset = (filterInvProductRequest.getPage() - 1) * filterInvProductRequest.getLimit();
PageHelper.offsetPage(offset, filterInvProductRequest.getLimit());
}
List<InvProductResponse> data = invPreInProductDao.filterJoinInvProduct(filterInvProductRequest);
return data;
}
@Override
public InvProductEntity selectByUuid(String uuid, String batchNo, String supId, String invStorageCode, String invWarehouseCode) {
return invPreInProductDao.selectByUuid(uuid, batchNo, supId, invStorageCode, invWarehouseCode);
}
@Override
public InvProductEntity selectExit(String id) {
return invPreInProductDao.selectExit(id);
}
@Override
public InvProductEntity selectById(String id) {
return invPreInProductDao.selectById(id);
}
@Override
public boolean insertInvProduct(InvProductEntity invProductEntity) {
return invPreInProductDao.insertInvProduct(invProductEntity);
}
@Override
public boolean updateInvProduct(InvProductEntity invProductEntity) {
return invPreInProductDao.updateInvProduct(invProductEntity);
}
@Override
public boolean deleteById(String id) {
return invPreInProductDao.deleteById(id);
}
}

@ -0,0 +1,12 @@
package com.glxp.sale.admin.service.param;
import com.glxp.sale.admin.entity.param.SyncDataSetEntity;
import com.glxp.sale.admin.res.param.SyncDataSetResponse;
public interface SyncDataSetService {
SyncDataSetEntity findSet();
SyncDataSetResponse selectSet();
boolean insert(SyncDataSetEntity syncDataSetEntity);
}

@ -0,0 +1,46 @@
package com.glxp.sale.admin.service.param.impl;
import com.alibaba.fastjson.JSON;
import com.glxp.sale.admin.dao.param.SyncDataSetDao;
import com.glxp.sale.admin.entity.param.SyncDataSetEntity;
import com.glxp.sale.admin.res.param.SyncDataSetResponse;
import com.glxp.sale.admin.service.param.SyncDataSetService;
import com.glxp.sale.admin.util.BeanUtils;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.lang.reflect.Type;
import java.util.List;
@Service
public class SyncDataSetServiceImpl implements SyncDataSetService {
@Resource
SyncDataSetDao syncDataSetDao;
@Override
public SyncDataSetEntity findSet() {
SyncDataSetEntity syncDataSetEntity = syncDataSetDao.selectSet();
return syncDataSetEntity;
}
@Override
public SyncDataSetResponse selectSet() {
SyncDataSetEntity syncDataSetEntity = syncDataSetDao.selectSet();
SyncDataSetResponse syncDataSetResponse = new SyncDataSetResponse();
BeanUtils.copyProperties(syncDataSetEntity, syncDataSetResponse);
List<String> busTypes = JSON.parseArray(syncDataSetEntity.getBusTypes(), String.class);
syncDataSetResponse.setBusTypes(busTypes);
return syncDataSetResponse;
}
@Override
public boolean insert(SyncDataSetEntity syncDataSetEntity) {
return syncDataSetDao.insert(syncDataSetEntity);
}
}

@ -47,22 +47,27 @@ public class SyncUdiService {
&& StrUtil.isEmpty(productInfoFilterRequest.getNameCode())
&& StrUtil.isEmpty(productInfoFilterRequest.getGgxh())
&& StrUtil.isEmpty(productInfoFilterRequest.getUuid())
&& StrUtil.isEmpty(productInfoFilterRequest.getZczbhhzbapzbh()))
&& StrUtil.isEmpty(productInfoFilterRequest.getZczbhhzbapzbh())) {
if (productInfoFilterRequest.getNameCode() != null && !productInfoFilterRequest.getNameCode().equals("") && productInfoFilterRequest.getNameCode().length() < 10) {
return ResultVOUtils.error(500, "请输入完整的最小销售单元标识!");
}
if (productInfoFilterRequest.getYlqxzcrbarmc() != null && !productInfoFilterRequest.getYlqxzcrbarmc().equals("") && productInfoFilterRequest.getYlqxzcrbarmc().length() < 4) {
return ResultVOUtils.error(500, "请输入完整的医疗器械注册备案人名称!");
}
if ((productInfoFilterRequest.getYlqxzcrbarmc() == null || productInfoFilterRequest.getYlqxzcrbarmc().equals(""))
&& (productInfoFilterRequest.getNameCode() == null || productInfoFilterRequest.getNameCode().equals(""))
&& (productInfoFilterRequest.getCpmctymc() == null || productInfoFilterRequest.getCpmctymc().equals(""))
if (StrUtil.isEmpty(productInfoFilterRequest.getYlqxzcrbarmc()) && StrUtil.isEmpty(productInfoFilterRequest.getNameCode())) {
if (StrUtil.isNotEmpty(productInfoFilterRequest.getCpmctymc())) {
return ResultVOUtils.error(500, "请输入医疗器械注册备案人名称");
}
if (productInfoFilterRequest.getGgxh() != null && !productInfoFilterRequest.getGgxh().equals("")) {
return ResultVOUtils.error(500, "请输入医疗器械注册备案人名称");
}
if (productInfoFilterRequest.getZczbhhzbapzbh() != null && !productInfoFilterRequest.getZczbhhzbapzbh().equals("")) {
return ResultVOUtils.error(500, "请输入医疗器械注册备案人名称");
}
}
if (
StrUtil.isEmpty(productInfoFilterRequest.getYlqxzcrbarmc())
&& (productInfoFilterRequest.getNameCode() == null || productInfoFilterRequest.getNameCode().equals(""))
&& (productInfoFilterRequest.getCpmctymc() == null || productInfoFilterRequest.getCpmctymc().equals(""))
) {
if (productInfoFilterRequest.getGgxh() != null && !productInfoFilterRequest.getGgxh().equals("")) {
return ResultVOUtils.error(500, "请输入医疗器械注册备案人名称");
@ -72,11 +77,8 @@ public class SyncUdiService {
}
}
// if (productInfoFilterRequest.getCpmctymc() != null && !productInfoFilterRequest.getCpmctymc().equals("")) {
// return ResultVOUtils.error(500, "请输入完整的产品通用名称!");
// }
productInfoFilterRequest.setIsNewest(1);
// productInfoFilterRequest.setDiType("1");
productInfoFilterRequest.setDiType("1");
List<ProductInfoEntity> productInfoEntityList = productInfoService.filterUdi(productInfoFilterRequest);
PageInfo<ProductInfoEntity> pageInfo;
pageInfo = new PageInfo<>(productInfoEntityList);

@ -17,8 +17,7 @@ public class AsyncCompanyDlHelper {
@Resource
UdiCompanyService udiCompanyService;
@Resource
ProductInfoDao productInfoDao;
AsyncDiDlHelper asyncDiDlHelper;
@Value("${UDI_SERVER_URL}")
private String udiUrl;
@ -27,7 +26,6 @@ public class AsyncCompanyDlHelper {
@Async
public void asyncDiByTime(String updateTime) {
AsyncDiDlHelper asyncDiDlHelper = new AsyncDiDlHelper();
int page = 1;
int limit = 300;
while (true) {

@ -8,12 +8,17 @@ import com.glxp.sale.admin.entity.receipt.ProductInfoEntity;
import com.glxp.sale.admin.res.PageSimpleResponse;
import com.glxp.sale.admin.util.HttpClient;
import com.glxp.sale.common.res.BaseResponse;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class AsyncDiDlHelper {
@Value("${UDI_SERVER_URL}")
private String udiUrl;
public List<ProductInfoEntity> dlByTime(String udiUrl, int page, int limit, String updateTime) {
Map<String, Object> paramMap = new HashMap<>(16);
@ -22,8 +27,6 @@ public class AsyncDiDlHelper {
paramMap.put("updateTime", updateTime);
String response = HttpClient.mipsGet(udiUrl + "/udidl/udiwms/syncUdi", paramMap);
try {
// BaseResponse<List<ProductInfoEntity>> udiDlDeviceResponse = (BaseResponse<List<ProductInfoEntity>>) JSONObject.parseObject(response, BaseResponse.class);
BaseResponse<List<ProductInfoEntity>> udiDlDeviceResponse =
JSONObject.parseObject(response, new TypeReference<BaseResponse<List<ProductInfoEntity>>>() {
});
@ -45,9 +48,6 @@ public class AsyncDiDlHelper {
paramMap.put("updateTime", updateTime);
String response = HttpClient.mipsGet(udiUrl + "/udidl/udiwms/syncCompany", paramMap);
try {
// BaseResponse<List<UdiCompanyEntity>> baseResponse = (BaseResponse<List<UdiCompanyEntity>>) JSONObject.parseObject(response, BaseResponse.class);
BaseResponse<List<UdiCompanyEntity>> baseResponse =
JSONObject.parseObject(response, new TypeReference<BaseResponse<List<UdiCompanyEntity>>>() {
});
@ -61,4 +61,22 @@ public class AsyncDiDlHelper {
}
}
public List<ProductInfoEntity> dlByDi(String deviceId) {
Map<String, Object> paramMap = new HashMap<>(16);
paramMap.put("deviceId", deviceId);
String response = HttpClient.mipsGet(udiUrl + "/udidl/device/serchDlByDi", paramMap);
try {
BaseResponse<List<ProductInfoEntity>> baseResponse =
JSONObject.parseObject(response, new TypeReference<BaseResponse<List<ProductInfoEntity>>>() {
});
List<ProductInfoEntity> productInfoEntityList = baseResponse.getData();
return productInfoEntityList;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}

@ -28,11 +28,12 @@ public class AsyncDiDlService {
ProductInfoService productInfoService;
@Resource
ThrImportLogService udiInfoImportLogService;
@Resource
AsyncDiDlHelper asyncDiDlHelper;
private static final Logger logger = LoggerFactory.getLogger(AsyncDiDlService.class);
@Async
public void asyncDiByTime(String updateTime) {
AsyncDiDlHelper asyncDiDlHelper = new AsyncDiDlHelper();
int page = 1;
int limit = 200;
while (true) {
@ -69,6 +70,4 @@ public class AsyncDiDlService {
}
}

@ -4,9 +4,12 @@ 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.SyncDataSetEntity;
import com.glxp.sale.admin.entity.param.SystemParamConfigEntity;
import com.glxp.sale.admin.req.udid.ScheduledRequest;
import com.glxp.sale.admin.res.param.SyncDataSetResponse;
import com.glxp.sale.admin.service.basic.BasicExportService;
import com.glxp.sale.admin.service.param.SyncDataSetService;
import com.glxp.sale.admin.service.param.SystemParamConfigService;
import com.glxp.sale.admin.util.CustomUtil;
import com.glxp.sale.admin.util.RedisUtil;
@ -30,13 +33,12 @@ public class AsyncHeartTask implements SchedulingConfigurer {
@Resource
protected ScheduledDao scheduledDao;
@Resource
SystemParamConfigService systemParamConfigService;
@Resource
RedisUtil redisUtil;
@Resource
BasicExportService basicExportService;
@Resource
BasicBackUpdateProductService backUpdateProductService;
@Resource
private SyncDataSetService syncDataSetService;
@Override
public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) {
@ -57,29 +59,24 @@ public class AsyncHeartTask implements SchedulingConfigurer {
private void process() {
SystemParamConfigEntity downConnect = systemParamConfigService.selectByParamKey("sync_downstream_enable");
if (downConnect.getParamValue().equals("1")) {
SyncDataSetResponse syncDataSetEntity = syncDataSetService.selectSet();
if (syncDataSetEntity.isDownstreamEnable()) {
//定时同步最近更新数据至任务表,等待下载
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 (syncDataSetEntity.getSyncTime() != null) {
long timeInterval = syncDataSetEntity.getSyncTime() * 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) {
backUpdateProductService.syncUpdatetTime();
redisUtil.set("SPS_SYNC_GEN_DATA", curTime);
}
}
if (curTime - lastTime > timeInterval) {
backUpdateProductService.syncUpdatetTime();
redisUtil.set("SPS_SYNC_GEN_DATA", curTime);
}
}
}

@ -53,6 +53,10 @@ public class InvProductsTrService {
@Resource
private InvPreProductService invPreProductService;
@Resource
private InvPreInProductService invPreInProductService;
@Resource
private InvPreInProductDetailService invPreInProductDetailService;
@Resource
private InvPreProductDetailService invPreProductDetailService;
@Resource
private BussinessChangeTypeService bussinessChangeTypeService;
@ -92,7 +96,25 @@ public class InvProductsTrService {
List<WarehouseEntity> warehouseEntityList = codesService.findByReceiptId(orderId);
for (WarehouseEntity warehouseEntity : warehouseEntityList) {
ErpOrderEntity erpOrderEntity = getErpOrders(warehouseEntity, erpOrderEntities);
if (bussinessTypeEntity.isAdvanceType()) {//预入库,则转存预入库
if (bussinessTypeEntity.isPreIn()) {
InvProductEntity invPreProductEntity =
invPreInProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo(), warehouseEntity.getSupId()
, warehouseEntity.getInvStorageCode(), warehouseEntity.getInvWarehouseCode());
if (invPreProductEntity == null) {
invPreProductEntity = buildInvProduct(erpOrderEntity.getGoodsid(), erpOrderEntity, orderEntity, warehouseEntity);
invPreInProductService.insertInvProduct(invPreProductEntity);
} else {
int actCount = getActCount(warehouseEntity);
int count = actCount * warehouseEntity.getCount();
if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
invPreProductEntity.setOutCount(invPreProductEntity.getOutCount() + count);
} else if (orderEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
invPreProductEntity.setInCount(invPreProductEntity.getInCount() + count);
}
invPreInProductService.updateInvProduct(invPreProductEntity);
}
} else if (bussinessTypeEntity.isAdvanceType()) {//预入库,则转存预入库
InvProductEntity invPreProductEntity =
invPreProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo(), warehouseEntity.getSupId()
, warehouseEntity.getInvStorageCode(), warehouseEntity.getInvWarehouseCode());
@ -145,10 +167,11 @@ public class InvProductsTrService {
if (relId != null) {
List<InvProductDetailEntity> invProductDetailEntities;
if (bussinessTypeEntity.isAdvanceType()) {//预入库,则转存预入库
invProductDetailEntities = buildInvProductDetail(orderId, erpOrderEntity, orderEntity, 1, true);
invProductDetailEntities = buildInvProductDetail(orderId, erpOrderEntity, orderEntity, 1);
} else if (bussinessTypeEntity.isPreIn()) {
invProductDetailEntities = buildInvProductDetail(orderId, erpOrderEntity, orderEntity, 3);
} else {
invProductDetailEntities = buildInvProductDetail(orderId, erpOrderEntity, orderEntity, 2, false);
invProductDetailEntities = buildInvProductDetail(orderId, erpOrderEntity, orderEntity, 2);
}
if (invProductDetailEntities != null && invProductDetailEntities.size() > 0) {
mInvProductDetailEntities.addAll(invProductDetailEntities);
@ -179,14 +202,14 @@ public class InvProductsTrService {
List<WarehouseEntity> temps = filterMapCodes(datas);
buildPreInOrder(bussinessChangeTypeEntity, temps, orderEntity); //3.生成流转单据
} else {
insetInv(bussinessTypeEntity.isAdvanceType(), mInvProductDetailEntities);//2.插入当前库存
insetInv(bussinessTypeEntity, mInvProductDetailEntities);//2.插入当前库存
}
} else {
insetInv(bussinessTypeEntity.isAdvanceType(), mInvProductDetailEntities);//2.插入当前库存
insetInv(bussinessTypeEntity, mInvProductDetailEntities);//2.插入当前库存
}
} else {
insetInv(bussinessTypeEntity.isAdvanceType(), mInvProductDetailEntities);//2.插入当前库存
insetInv(bussinessTypeEntity, mInvProductDetailEntities);//2.插入当前库存
}
}
@ -470,8 +493,8 @@ public class InvProductsTrService {
outOrder.setFromCorp(invWarehouseEntity.getName());
outOrder.setFromCorpId(invWarehouseEntity.getCode());
outOrder.setLocStorageCode(defaultWarehouseEntity.getCode());
// outOrder.setFromCorp(companyEntity.getCompanyName());
// outOrder.setFromCorpId(companyEntity.getUnitIdFk());
outOrder.setCreateUser(null);
outOrder.setReviewUser(null);
orderService.insertOrder(outOrder);
for (WarehouseEntity warehouseEntity : preOutList) {
warehouseEntity.setOrderId(outOrder.getId());
@ -546,7 +569,8 @@ public class InvProductsTrService {
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
outOrder.setOriginUllageSupNo(orderEntity.getId());
outOrder.setCreateUser(null);
outOrder.setReviewUser(null);
orderService.insertOrder(outOrder);
for (WarehouseEntity warehouseEntity : temps) {
warehouseEntity.setOrderId(outOrder.getId());
@ -558,10 +582,7 @@ public class InvProductsTrService {
warehouseEntity.setMainAction(ConstantType.TYPE_PUT);
}
codesTempService.insertCodesTemp(temps);
// ioTransInoutService.transInout(outOrder.getId());
}
//无供应商,一个条码生成一个错误单据,到时候利用单据合并生成同一个单据
for (WarehouseEntity warehouseEntity : unkonwCorpList) {
OrderEntity outOrder = new OrderEntity();
@ -591,7 +612,8 @@ public class InvProductsTrService {
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
outOrder.setOriginUllageSupNo(orderEntity.getId());
outOrder.setCreateUser(null);
outOrder.setReviewUser(null);
orderService.insertOrder(outOrder);
warehouseEntity.setOrderId(outOrder.getId());
warehouseEntity.setId(null);
@ -661,7 +683,8 @@ public class InvProductsTrService {
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
outOrder.setOriginUllageSupNo(orderEntity.getId());
outOrder.setCreateUser(null);
outOrder.setReviewUser(null);
orderService.insertOrder(outOrder);
for (WarehouseEntity warehouseEntity : temps) {
warehouseEntity.setOrderId(outOrder.getId());
@ -738,7 +761,8 @@ public class InvProductsTrService {
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
outOrder.setOriginUllageSupNo(orderEntity.getId());
outOrder.setCreateUser(null);
outOrder.setReviewUser(null);
orderService.insertOrder(outOrder);
for (WarehouseEntity warehouseEntity : temps) {
warehouseEntity.setOrderId(outOrder.getId());
@ -750,7 +774,6 @@ public class InvProductsTrService {
warehouseEntity.setMainAction(ConstantType.TYPE_PUT);
}
codesTempService.insertCodesTemp(temps);
// ioTransInoutService.transInout(outOrder.getId());
}
@ -786,7 +809,7 @@ public class InvProductsTrService {
//生成库存条码
private List<InvProductDetailEntity> buildInvProductDetail(String orderId, ErpOrderEntity erpOrderEntity,
OrderEntity orderEntity, Integer purchaseType, boolean isPre) {
OrderEntity orderEntity, Integer purchaseType) {
List<InvProductDetailEntity> mInvProductDetailEntities = new ArrayList<>();
List<WarehouseEntity> warehouseEntities = codesService.findByReceiptId(orderId);
@ -799,7 +822,6 @@ public class InvProductsTrService {
invProductDetailEntity.setOriginCode(warehouseEntity.getCode());
invProductDetailEntity.setProductIdFk(erpOrderEntity.getGoodsid() + "");
int actCount = getActCount(warehouseEntity);
String code = warehouseEntity.getCode();
UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity);
if (udiInfoEntity.getDiType() == ConstantStatus.DITYPE_PACK || udiInfoEntity.getDiType() == ConstantStatus.DITYPE_SYDY
@ -826,27 +848,6 @@ public class InvProductsTrService {
invProductDetailEntity.setUpdateTime(new Date());
invProductDetailEntity.setCustomerId(orderEntity.getCustomerId());
invProductDetailEntity.setSupId(warehouseEntity.getSupId());
// if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
// if (warehouseEntity.getSupId() != null) {
// invProductDetailEntity.setSupId(warehouseEntity.getSupId());
// } else {
// FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
// filterInvProductDetailRequest.setMainAction(ConstantType.TYPE_PUT);
// filterInvProductDetailRequest.setCode(warehouseEntity.getCode());
// List<InvProductDetailEntity> temps = null;
// if (isPre) {
// temps = invPreProductDetailService.filterInvProduct(filterInvProductDetailRequest);
// } else {
// temps = invProductDetailService.filterInvProduct(filterInvProductDetailRequest);
// }
// if (temps.size() > 0) {
// invProductDetailEntity.setSupId(temps.get(0).getSupId());
// }
// }
// } else {
// invProductDetailEntity.setSupId(orderEntity.getFromCorpId());
// }
mInvProductDetailEntities.add(invProductDetailEntity);
}
}
@ -855,9 +856,11 @@ public class InvProductsTrService {
return mInvProductDetailEntities;
}
public void insetInv(boolean isPre, List<InvProductDetailEntity> invProductDetailEntities) {
if (isPre) {
public void insetInv(BussinessTypeEntity bussinessTypeEntity, List<InvProductDetailEntity> invProductDetailEntities) {
if (bussinessTypeEntity.isAdvanceType()) {
invPreProductDetailService.insertInvProducts(invProductDetailEntities);
} else if (bussinessTypeEntity.isPreIn()) {
invPreInProductDetailService.insertInvProducts(invProductDetailEntities);
} else {
invProductDetailService.insertInvProducts(invProductDetailEntities);
}

@ -9,6 +9,7 @@ import com.glxp.sale.admin.controller.inout.utils.CheckOrderUtils;
import com.glxp.sale.admin.controller.inout.utils.InoutUtils;
import com.glxp.sale.admin.dao.inout.UdimsOrderDetailDao;
import com.glxp.sale.admin.entity.basic.BasicUnitMaintainEntity;
import com.glxp.sale.admin.entity.basic.BussinessLocalTypeEntity;
import com.glxp.sale.admin.entity.basic.BussinessTypeEntity;
import com.glxp.sale.admin.entity.info.CompanyEntity;
import com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity;
@ -23,10 +24,7 @@ import com.glxp.sale.admin.req.inventory.FilterInvProductRequest;
import com.glxp.sale.admin.req.inventory.FilterInvWarehouseRequest;
import com.glxp.sale.admin.res.basic.CompanyProductRelevanceResponse;
import com.glxp.sale.admin.res.basic.UdiRelevanceResponse;
import com.glxp.sale.admin.service.basic.BasicUnitMaintainService;
import com.glxp.sale.admin.service.basic.BussinessTypeService;
import com.glxp.sale.admin.service.basic.UdiInfoService;
import com.glxp.sale.admin.service.basic.UdiRelevanceService;
import com.glxp.sale.admin.service.basic.*;
import com.glxp.sale.admin.service.info.CompanyProductRelevanceService;
import com.glxp.sale.admin.service.info.CompanyService;
import com.glxp.sale.admin.service.inout.*;
@ -58,7 +56,8 @@ public class IoTransInoutService {
@Resource
private OrderDetailService myErpOrderService;
@Resource
BussinessLocalTypeService bussinessLocalTypeService;
@Resource
UdiRelevanceService udiRelevanceService;
@Resource
@ -591,7 +590,6 @@ public class IoTransInoutService {
public void unCheckFinish(OrderEntity orderEntity, List<WarehouseEntity> warehouseEntityList) {
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(orderEntity.getAction());
genOrderDetail(warehouseEntityList);
// checkMutiDi(orderEntity.getId(), bussinessTypeEntity); //校验一个DI是否绑定多个产品ID
orderEntity = orderService.findById(orderEntity.getId());
if (orderEntity.getContrastStatus() != ConstantStatus.ORDER_CHECK_FAIL) {
List<ErpOrderEntity> erpOrderEntities = myErpOrderService.filterAllByOrderIdFk(orderEntity.getId());
@ -604,11 +602,6 @@ public class IoTransInoutService {
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)) {
//
// }
printOrder(orderEntity.getId());
}
}
@ -843,7 +836,10 @@ public class IoTransInoutService {
public StockOrderEntity genStockOrder(OrderEntity orderEntity, BussinessTypeEntity bussinessTypeEntity) {
//生成业务单据记录
StockOrderEntity stockOrderEntity = new StockOrderEntity();
stockOrderEntity.setBillNo("ST" + CustomUtil.getId());
BussinessLocalTypeEntity bussinessLocalTypeEntity = bussinessLocalTypeService.findBTByAction(bussinessTypeEntity.getLocalAction());
String orderNo = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.BUS_ORDER + MyStrUtil.trim(bussinessLocalTypeEntity.getLocalPrefix()), "yyyyMMdd"));
stockOrderEntity.setBillNo(orderNo);
stockOrderEntity.setBillType(bussinessTypeEntity.getLocalAction());//todo
stockOrderEntity.setBilldate(orderEntity.getActDate());
stockOrderEntity.setCustomerId(orderEntity.getCustomerId());

@ -18,7 +18,7 @@ public class Constant {
public static final String SERIAL_CACHE_PREFIX = "serial_";
public static final String SERIAL_CACHE_PREFIX_ST = "serialst_";
public static final String SCAN_ORDER = "MS";
public static final String BUS_ORDER = "MY";
public static final String SCAN_ORDER = "ZS";
public static final String BUS_ORDER = "ZY";
}

@ -38,7 +38,7 @@
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 每天一归档 d://glxpdata/udiwms -->
<fileNamePattern>home/glxpdata/udiwms/logs/${LOG_INFO_HOME}//%d{yyyy-MM-dd}_%i.log
<fileNamePattern>d://glxpdata/udiwms/logs/${LOG_INFO_HOME}//%d{yyyy-MM-dd}_%i.log
</fileNamePattern>
<maxHistory>30</maxHistory>
<timeBasedFileNamingAndTriggeringPolicy
@ -59,7 +59,7 @@
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 每天一归档 /home/glxpdata/udiwms -->
<fileNamePattern>home/glxpdata/udiwms/logs/${LOG_ERROR_HOME}//%d{yyyy-MM-dd}_%i.log
<fileNamePattern>d://glxpdata/udiwms/logs/${LOG_ERROR_HOME}//%d{yyyy-MM-dd}_%i.log
</fileNamePattern>
<maxHistory>30</maxHistory>
<timeBasedFileNamingAndTriggeringPolicy

@ -55,7 +55,7 @@
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.prefix,basic_bustype_local.prefix localPrefix
,basic_bussiness_type.prefix,basic_bustype_local.prefix localPrefix,basic_bustype_local.preIn
FROM basic_bustype_local
inner join basic_bussiness_type
on basic_bustype_local.action = basic_bussiness_type.localAction
@ -85,7 +85,7 @@
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.prefix,basic_bustype_local.prefix localPrefix
thirdAction,basic_bustype_origin.thirdSys,basic_bussiness_type.prefix,basic_bustype_local.prefix localPrefix,preIn
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
@ -123,7 +123,7 @@
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.prefix,basic_bustype_local.prefix localPrefix
,basic_bussiness_type.prefix,basic_bustype_local.prefix localPrefix,preIn
FROM basic_bustype_local
LEFT JOIN basic_bussiness_type on basic_bussiness_type.localAction = basic_bustype_local.action
<where>
@ -143,10 +143,10 @@
<insert id="insertBussinessType" keyProperty="id"
parameterType="com.glxp.sale.admin.entity.basic.BussinessLocalTypeEntity">
replace INTO basic_bustype_local
(action, name, remark, originAction, advanceType, changeEnable, spUse,updateTime,prefix)
(action, name, remark, originAction, advanceType, changeEnable, spUse,updateTime,prefix,preIn)
values (#{action},
#{name},
#{remark}, #{originAction}, #{advanceType}, #{changeEnable}, #{spUse},#{updateTime},#{prefix})
#{remark}, #{originAction}, #{advanceType}, #{changeEnable}, #{spUse},#{updateTime},#{prefix},#{preIn})
</insert>
<update id="updateBusLocalType" parameterType="com.glxp.sale.admin.entity.basic.BussinessLocalTypeEntity">
@ -161,6 +161,8 @@
<if test="spUse != null">spUse = #{spUse},</if>
<if test="updateTime != null">updateTime = #{updateTime},</if>
<if test="prefix != null">prefix = #{prefix},</if>
<if test="preIn != null">preIn = #{preIn},</if>
</trim>
WHERE id = #{id}
</update>

@ -46,7 +46,7 @@
AND basic_bustype_origin.action = #{thirdAction}
</if>
<if test="corpType != ''and corpType != null">
AND basic_bussiness_type.action = #{corpType}
AND basic_bussiness_type.corpType = #{corpType}
</if>
</where>
@ -96,9 +96,12 @@
<if test="thirdSys != null">thirdSys = #{thirdSys},</if>
<if test="thirdSysName != null">thirdSysName = #{thirdSysName},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
WHERE id = #{id}
</update>
<delete id="deleteById" parameterType="Map">
DELETE
FROM basic_bustype_origin
WHERE id = #{id}
</delete>
</mapper>

@ -18,7 +18,7 @@
basic_bustype_local.spUse,corpType,basic_bussiness_type.storageCode,basic_bussiness_type.checkBalacne,
basic_bussiness_type.secCheckBalacne, defaultUnit,basic_bustype_origin.action
thirdAction,basic_bustype_origin.thirdSys,basic_bussiness_type.useDyCount,basic_bussiness_type.expireTip,basic_bussiness_type.prefix,basic_bustype_local.prefix
localPrefix
localPrefix,basic_bustype_local.preIn
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
@ -82,7 +82,7 @@
basic_bustype_local.name localName,basic_bussiness_type.checkEnable, basic_bustype_local.advanceType,
basic_bustype_local.changeEnable,basic_bussiness_type.genUnit,basic_bussiness_type.innerOrder,defaultUnit,
basic_bustype_local.spUse,basic_bussiness_type.storageCode,basic_bussiness_type.expireTip,
basic_bustype_local.prefix localPrefix from
basic_bustype_local.prefix localPrefix ,basic_bustype_local.preIn 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 =
@ -131,7 +131,7 @@
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.prefix,basic_bustype_local.prefix
localPrefix
localPrefix,basic_bustype_local.preIn
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

@ -49,7 +49,7 @@
basic_udirel.mainId,basic_udirel.mainName,basic_udirel.isAdavence,basic_products.scbssfbhph,
basic_products.scbssfbhxlh,
basic_products.scbssfbhscrq,
basic_products.scbssfbhsxrq,basic_products.cpms,basic_products.originUuid
basic_products.scbssfbhsxrq,basic_products.cpms,basic_products.originUuid,company_product_relevance.price
FROM company_product_relevance
inner JOIN basic_udirel
ON company_product_relevance.udiRlIdFk = basic_udirel.id
@ -232,7 +232,7 @@
<if test="productUuid != null">productUuid=#{productUuid},</if>
<if test="udiRlIdFk != null">udiRlIdFk=#{udiRlIdFk},</if>
<if test="unitFk != null">unitFk=#{unitFk},</if>
<if test="price != null">price=#{price},</if>
</set>
WHERE id = #{id}
</update>
@ -241,7 +241,7 @@
parameterType="com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity">
replace
INTO company_product_relevance(customerId,productId,enterpriseId,registrationId,
create_time,update_time,auditStatus,productUuid,udiRlIdFk,unitFk) values
create_time,update_time,auditStatus,productUuid,udiRlIdFk,unitFk,price) values
(
#{customerId},
#{productId},
@ -252,7 +252,7 @@
#{auditStatus},
#{productUuid},
#{udiRlIdFk},
#{unitFk}
#{unitFk},#{price}
)
</insert>
@ -261,7 +261,7 @@
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
create_time,update_time,auditStatus,productUuid,udiRlIdFk,unitFk,price) values
(
#{id},
#{customerId},
@ -273,7 +273,7 @@
#{auditStatus},
#{productUuid},
#{udiRlIdFk},
#{unitFk}
#{unitFk},#{price}
)
</insert>

@ -34,7 +34,7 @@
fromCorp, status, remark, exportStatus, fromType, contrastStatus, signStatus,
receiveStatus, erpFk, stockCheckFk, customerId, supId,
exportFilePath, locStorageCode, supplementNo, ullageSupNo, createUser, reviewUser,
outChangeEnable, originUllageSupNo)
outChangeEnable, originUllageSupNo,preCheck)
values (#{id},
#{action},
#{corpOrderId},
@ -53,7 +53,7 @@
#{erpFk},
#{stockCheckFk},
#{customerId}, #{supId}, #{exportFilePath}, #{locStorageCode}, #{supplementNo}
, #{ullageSupNo}, #{createUser}, #{reviewUser}, #{outChangeEnable}, #{originUllageSupNo})
, #{ullageSupNo}, #{createUser}, #{reviewUser}, #{outChangeEnable}, #{originUllageSupNo},#{preCheck})
</insert>
@ -63,7 +63,7 @@
fromCorp, status, remark, exportStatus, fromType, contrastStatus, signStatus,
receiveStatus, erpFk, stockCheckFk, customerId, supId,
exportFilePath, locStorageCode, supplementNo, ullageSupNo, createUser, reviewUser,
outChangeEnable, originUllageSupNo)
outChangeEnable, originUllageSupNo,preCheck)
values (
#{id},
#{action},
@ -91,7 +91,7 @@
#{createUser},
#{reviewUser},
#{outChangeEnable},
#{originUllageSupNo}
#{originUllageSupNo},#{preCheck}
)
</insert>
@ -127,6 +127,7 @@
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="outChangeEnable != null">outChangeEnable=#{outChangeEnable},</if>
<if test="originUllageSupNo != null">originUllageSupNo=#{originUllageSupNo},</if>
<if test="preCheck != null">preCheck=#{preCheck},</if>
</trim>
WHERE id = #{id}
@ -513,6 +514,13 @@
<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>
<if test="filterActions!=null">
action in
<foreach collection="filterActions" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
</where>
</select>

@ -5,7 +5,8 @@
<select id="filterStockOrderDetail" parameterType="com.glxp.sale.admin.req.inout.StockOrderDetailFilterRequest"
resultType="com.glxp.sale.admin.entity.inout.StockOrderDetailEntity">
select * from stock_order_detail
select stock_order_detail.*,basic_udirel.allowNoBatch from stock_order_detail
left join basic_udirel on stock_order_detail.relId = basic_udirel.id
<where>
<if test="orderIdFk != '' and orderIdFk!=null">
and orderIdFk = #{orderIdFk}
@ -23,6 +24,7 @@
and expireDate = #{expireDate}
</if>
</where>
group by stock_order_detail.id
ORDER BY id DESC
</select>
@ -33,7 +35,7 @@
basic_products.cpmctymc,basic_products.ggxh,
stock_order_detail.batchNo,stock_order_detail.expireDate,stock_order_detail.productDate,
stock_order_detail.count,stock_order_detail.reCount,stock_order_detail.sweepCount,stock_order_detail.relId,
basic_products.ylqxzcrbarmc,basic_products.zczbhhzbapzbh,stock_order_detail.price,stock_order_detail.allowNoBatch
basic_products.ylqxzcrbarmc,basic_products.zczbhhzbapzbh,stock_order_detail.price
from stock_order_detail
right JOIN basic_products
ON stock_order_detail.productId = basic_products.uuid
@ -63,7 +65,8 @@
replace
INTO stock_order_detail(id,
orderIdFk,productId,productName,spec,batchNo,productDate,
expireDate,count,reCount,sweepCount,ylqxzcrbarmc,zczbhhzbapzbh,price,relId,manufactory,firstSalesInvNo,secSalesInvNo,secSalesListNo,invoiceDate,allowNoBatch)
expireDate,count,reCount,sweepCount,ylqxzcrbarmc,zczbhhzbapzbh,price,relId,
manufactory,firstSalesInvNo,secSalesInvNo,secSalesListNo,invoiceDate)
values(
#{id},
#{orderIdFk},
@ -84,7 +87,7 @@
#{firstSalesInvNo},
#{secSalesInvNo},
#{secSalesListNo},
#{invoiceDate},#{allowNoBatch}
#{invoiceDate}
)
</insert>
@ -92,7 +95,8 @@
parameterType="com.glxp.sale.admin.entity.inout.StockOrderDetailEntity">
replace INTO stock_order_detail(id,
orderIdFk,productId,productName,spec,batchNo,productDate,
expireDate,count,reCount,sweepCount,ylqxzcrbarmc,zczbhhzbapzbh,price,relId,manufactory,firstSalesInvNo,secSalesInvNo,secSalesListNo,invoiceDate,allowNoBatch)
expireDate,count,reCount,sweepCount,ylqxzcrbarmc,zczbhhzbapzbh,price,relId,
manufactory,firstSalesInvNo,secSalesInvNo,secSalesListNo,invoiceDate)
values
<foreach collection="stockOrderDetailEntities" item="item" index="index"
separator=",">
@ -109,7 +113,8 @@
#{item.reCount},
#{item.sweepCount},
#{item.ylqxzcrbarmc},
#{item.zczbhhzbapzbh},#{item.price},#{item.relId},#{item.manufactory},#{item.firstSalesInvNo},#{item.secSalesInvNo},#{item.secSalesListNo},#{item.invoiceDate},#{item.allowNoBatch}
#{item.zczbhhzbapzbh},#{item.price},#{item.relId},#{item.manufactory},#{item.firstSalesInvNo},#{item.secSalesInvNo},
#{item.secSalesListNo},#{item.invoiceDate}
)
</foreach>
@ -131,8 +136,6 @@
<if test="invoiceDate != null">invoiceDate=#{invoiceDate},</if>
<if test="relId != null">relId=#{relId},</if>
<if test="manufactory != null">manufactory=#{manufactory},</if>
<if test="allowNoBatch != null">allowNoBatch=#{allowNoBatch},</if>
</set>
WHERE id = #{id}
</update>

@ -257,6 +257,9 @@
<if test="code != '' and code != null">
AND code = #{code}
</if>
<if test="userid != null">
and userId = #{userid}
</if>
<if test="isDirector != '' and isDirector != null">
AND isDirector = #{isDirector}
</if>

@ -0,0 +1,231 @@
<?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.inventory.InvPreInProductDao">
<select id="filterInvProduct" parameterType="com.glxp.sale.admin.req.inventory.FilterInvProductRequest"
resultType="com.glxp.sale.admin.entity.inventory.InvProductEntity">
SELECT * FROM inv_prein_product
<where>
<if test="productsName != '' and productsName != null">
AND productsName = #{productsName}
</if>
<if test="nameCode != '' and nameCode != null">
AND nameCode = #{nameCode}
</if>
<if test="relIdFk != '' and relIdFk != null">
AND relIdFk = #{relIdFk}
</if>
<if test="ggxh != '' and ggxh != null">
AND ggxh = #{ggxh}
</if>
<if test="batchNo != '' and batchNo != null">
AND batchNo = #{batchNo}
</if>
<if test="productionDate != '' and productionDate != null">
AND productionDate = #{productionDate}
</if>
<if test="expireDate != '' and expireDate != null">
AND expireDate = #{expireDate}
</if>
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
AND ylqxzcrbarmc = #{ylqxzcrbarmc}
</if>
<if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
AND zczbhhzbapzbh = #{zczbhhzbapzbh}
</if>
<if test="customerId != '' and customerId != null">
AND customerId = #{customerId}
</if>
<if test="supId != '' and supId != null">
AND supId = #{supId}
</if>
<if test="unitFk != '' and unitFk != null">
AND unitFk = #{unitFk}
</if>
<if test="invStorageCode != '' and invStorageCode != null">
AND invStorageCode = #{invStorageCode}
</if>
<if test="invWarehouseCode != '' and invWarehouseCode != null">
AND invWarehouseCode = #{invWarehouseCode}
</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>
<if test="groupType != '' and groupType != null">
GROUP BY #{groupType}
</if>
</select>
<select id="selectById" parameterType="Map"
resultType="com.glxp.sale.admin.entity.inventory.InvProductEntity">
SELECT *
FROM inv_prein_product
WHERE id = #{id}
</select>
<select id="selectByUuid" parameterType="Map"
resultType="com.glxp.sale.admin.entity.inventory.InvProductEntity">
SELECT *
FROM inv_prein_product
<where>
relIdFk = #{relIdFk}
and invStorageCode = #{invStorageCode}
<if test="supId != '' and supId != null">
AND supId = #{supId}
</if>
<if test="supId == null">
AND supId is NULL
</if>
<if test="invWarehouseCode != '' and invWarehouseCode != null">
AND invWarehouseCode = #{invWarehouseCode}
</if>
<if test="invWarehouseCode == null">
AND invWarehouseCode is NULL
</if>
</where>
</select>
<select id="selectExit" parameterType="Map"
resultType="com.glxp.sale.admin.entity.inventory.InvProductEntity">
SELECT *
FROM inv_prein_product
<where>
relIdFk = #{relIdFk}
</where>
limit 1
</select>
<!-- and supId = #{supId}-->
<select id="filterJoinInvProduct" parameterType="com.glxp.sale.admin.req.inventory.FilterInvProductRequest"
resultType="com.glxp.sale.admin.res.inventory.InvProductResponse">
SELECT
inv_prein_product.id,
basic_products.cpmctymc,basic_products.nameCode,inv_prein_product.relIdFk,basic_products.ggxh,
inv_prein_product.batchNo
,inv_prein_product.productionDate,inv_prein_product.expireDate,
basic_products.ylqxzcrbarmc,basic_products.zczbhhzbapzbh,
inv_prein_product.inCount,inv_prein_product.outCount
,inv_prein_product.reCount,inv_prein_product.customerId,
basic_corp.name companyName,inv_prein_product.supId,inv_prein_product.unitFk ,inv_warehouse.name
invStorageName,inv_prein_product.invStorageCode
FROM inv_prein_product
inner join basic_udirel on inv_prein_product.relIdFk = basic_udirel.id
inner join basic_products on basic_udirel.uuid = basic_products.uuid
left join basic_corp on inv_prein_product.supId=basic_corp.erpId
left join inv_warehouse on inv_warehouse.code=inv_prein_product.invStorageCode
<where>
basic_products.diType=1
<if test="cpmctymc != '' and cpmctymc != null">
AND basic_products.cpmctymc = #{cpmctymc}
</if>
<if test="nameCode != '' and nameCode != null">
AND basic_products.nameCode = #{nameCode}
</if>
<if test="relIdFk != '' and relIdFk != null">
AND inv_prein_product.relIdFk = #{relIdFk}
</if>
<if test="invStorageCode != '' and invStorageCode != null">
AND invStorageCode = #{invStorageCode}
</if>
<if test="invWarehouseCode != '' and invWarehouseCode != null">
AND invWarehouseCode = #{invWarehouseCode}
</if>
<if test="ggxh != '' and ggxh != null">
AND basic_products.ggxh = #{ggxh}
</if>
<if test="batchNo != '' and batchNo != null">
AND inv_prein_product.batchNo = #{batchNo}
</if>
<if test="productionDate != '' and productionDate != null">
AND inv_prein_product.productionDate = #{productionDate}
</if>
<if test="expireDate != '' and expireDate != null">
AND inv_prein_product.expireDate = #{expireDate}
</if>
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
AND basic_products.ylqxzcrbarmc = #{ylqxzcrbarmc}
</if>
<if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
AND basic_products.zczbhhzbapzbh = #{zczbhhzbapzbh}
</if>
<if test="customerId != '' and customerId != null">
AND inv_prein_product.customerId = #{customerId}
</if>
<if test="supId != '' and supId != null">
AND supId = #{supId}
</if>
<if test="unitFk != '' and unitFk != null">
AND unitFk = #{unitFk}
</if>
<if test="invStorageCode != '' and invStorageCode != null">
AND invStorageCode = #{invStorageCode}
</if>
<if test="invWarehouseCode != '' and invWarehouseCode != null">
AND invWarehouseCode = #{invWarehouseCode}
</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>
<if test="groupType != '' and groupType != null">
GROUP BY #{groupType}
</if>
</select>
<insert id="insertInvProduct" keyProperty="id"
parameterType="com.glxp.sale.admin.entity.inventory.InvProductEntity">
insert INTO inv_prein_product
(productsName, nameCode, relIdFk, ggxh, batchNo,
productionDate, expireDate, ylqxzcrbarmc, zczbhhzbapzbh,
inCount, outCount, reCount, customerId, supId, unitFk, invStorageCode, invWarehouseCode)
values (#{productsName}, #{nameCode},
#{relIdFk}, #{ggxh}, #{batchNo},
#{productionDate}, #{expireDate},
#{ylqxzcrbarmc}, #{zczbhhzbapzbh},
#{inCount}, #{outCount}, #{reCount}, #{customerId}, #{supId}, #{unitFk}
, #{invStorageCode}, #{invWarehouseCode})
</insert>
<delete id="deleteById" parameterType="Map">
DELETE
FROM inv_prein_product
WHERE id = #{id}
</delete>
<update id="updateInvProduct" parameterType="com.glxp.sale.admin.entity.inventory.InvProductEntity">
UPDATE inv_prein_product
<trim prefix="set" suffixOverrides=",">
<if test="productsName != null">productsName=#{productsName},</if>
<if test="nameCode != null">nameCode=#{nameCode},</if>
<if test="relIdFk != null">relIdFk=#{relIdFk},</if>
<if test="ggxh != null">ggxh=#{ggxh},</if>
<if test="batchNo != null">batchNo=#{batchNo},</if>
<if test="productionDate != null">productionDate=#{productionDate},</if>
<if test="expireDate != null">expireDate=#{expireDate},</if>
<if test="ylqxzcrbarmc != null">ylqxzcrbarmc=#{ylqxzcrbarmc},</if>
<if test="zczbhhzbapzbh != null">zczbhhzbapzbh=#{zczbhhzbapzbh},</if>
<if test="inCount != null">inCount=#{inCount},</if>
<if test="outCount != null">outCount=#{outCount},</if>
<if test="reCount != null">reCount=#{reCount},</if>
<if test="customerId != null">customerId=#{customerId},</if>
<if test="supId != null">supId=#{supId},</if>
<if test="unitFk != null">unitFk=#{unitFk},</if>
<if test="invStorageCode != null">invStorageCode=#{invStorageCode},</if>
<if test="invWarehouseCode != null">invWarehouseCode=#{invWarehouseCode},</if>
</trim>
WHERE id = #{id}
</update>
</mapper>

@ -0,0 +1,273 @@
<?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.inventory.InvPreInProductDetailDao">
<select id="filterInvProductDetail" parameterType="com.glxp.sale.admin.req.inventory.FilterInvProductDetailRequest"
resultType="com.glxp.sale.admin.entity.inventory.InvProductDetailEntity">
SELECT * FROM inv_prein_product_detail
<where>
<if test="productIdFk != '' and productIdFk != null">
AND productIdFk = #{productIdFk}
</if>
<if test="customerId != '' and customerId != null">
AND customerId = #{customerId}
</if>
<if test="mainAction != '' and mainAction != null">
AND mainAction = #{mainAction}
</if>
<if test="action != '' and action != null">
AND action = #{action}
</if>
<if test="count != '' and count != null">
AND count = #{count}
</if>
<if test="purchaseType != null">
AND purchaseType = #{purchaseType}
</if>
<if test="batchNo != '' and batchNo != null">
AND batchNo = #{batchNo}
</if>
<if test="unitFk != '' and unitFk != null">
AND unitFk = #{unitFk}
</if>
<if test="supId != '' and supId != null">
AND supId = #{supId}
</if>
<if test="code != '' and code != null">
AND code = #{code}
</if>
<if test="originCode != '' and originCode != null">
AND originCode = #{originCode}
</if>
<if test="invStorageCode != '' and invStorageCode != null">
AND invStorageCode = #{invStorageCode}
</if>
<if test="invWarehouseCode != '' and invWarehouseCode != null">
AND invWarehouseCode = #{invWarehouseCode}
</if>
</where>
</select>
<select id="findAllCode" parameterType="com.glxp.sale.admin.req.inventory.FilterInvProductDetailRequest"
resultType="java.lang.String">
SELECT originCode FROM inv_prein_product_detail
<where>
<if test="productIdFk != '' and productIdFk != null">
AND productIdFk = #{productIdFk}
</if>
<if test="customerId != '' and customerId != null">
AND customerId = #{customerId}
</if>
<if test="mainAction != '' and mainAction != null">
AND mainAction = #{mainAction}
</if>
<if test="action != '' and action != null">
AND action = #{action}
</if>
<if test="count != '' and count != null">
AND count = #{count}
</if>
<if test="purchaseType != null">
AND purchaseType = #{purchaseType}
</if>
<if test="batchNo != '' and batchNo != null">
AND batchNo = #{batchNo}
</if>
<if test="unitFk != '' and unitFk != null">
AND unitFk = #{unitFk}
</if>
<if test="supId != '' and supId != null">
AND supId = #{supId}
</if>
<if test="code != '' and code != null">
AND code = #{code}
</if>
<if test="originCode != '' and originCode != null">
AND originCode = #{originCode}
</if>
<if test="invStorageCode != '' and invStorageCode != null">
AND invStorageCode = #{invStorageCode}
</if>
<if test="invWarehouseCode != '' and invWarehouseCode != null">
AND invWarehouseCode = #{invWarehouseCode}
</if>
</where>
</select>
<select id="filterJoinInvProduct" parameterType="com.glxp.sale.admin.req.inventory.FilterInvProductDetailRequest"
resultType="com.glxp.sale.admin.res.inventory.InvProductDetailJoinResponse">
SELECT inv_prein_product_detail.* ,io_order.fromCorp,io_order.fromCorpId FROM inv_prein_product_detail
inner join io_order on inv_prein_product_detail.orderIdFk = io_order.id
<where>
<if test="productIdFk != '' and productIdFk != null">
AND productIdFk = #{productIdFk}
</if>
<if test="customerId != '' and customerId != null">
AND customerId = #{customerId}
</if>
<if test="mainAction != '' and mainAction != null">
AND inv_prein_product_detail.mainAction = #{mainAction}
</if>
<if test="action != '' and action != null">
AND inv_prein_product_detail.action = #{action}
</if>
<if test="count != '' and count != null">
AND count = #{count}
</if>
<if test="purchaseType != null">
AND purchaseType = #{purchaseType}
</if>
<if test="batchNo != '' and batchNo != null">
AND batchNo = #{batchNo}
</if>
<if test="unitFk != '' and unitFk != null">
AND unitFk = #{unitFk}
</if>
<if test="supId != '' and supId != null">
AND inv_prein_product_detail.supId = #{supId}
</if>
<if test="code != '' and code != null">
AND code = #{code}
</if>
<if test="originCode != '' and originCode != null">
AND originCode = #{originCode}
</if>
<if test="invStorageCode != '' and invStorageCode != null">
AND invStorageCode = #{invStorageCode}
</if>
<if test="invWarehouseCode != '' and invWarehouseCode != null">
AND invWarehouseCode = #{invWarehouseCode}
</if>
</where>
</select>
<insert id="insertInvProductDetail" keyProperty="id"
parameterType="com.glxp.sale.admin.entity.inventory.InvProductDetailEntity">
insert INTO inv_prein_product_detail
(code, productIdFk, orderIdFk, customerId, mainAction, action, count, updateTime,
purchaseType, batchNo, productionDate, expireDate, unitFk, stockIdFk, supId, originCode
, invStorageCode, invWarehouseCode)
values (#{code},
#{productIdFk}, #{orderIdFk},
#{customerId}, #{mainAction}, #{action}, #{count}, #{updateTime},
#{purchaseType}, #{batchNo}, #{productionDate}, #{expireDate}, #{unitFk}, #{stockIdFk}
, #{supId}, #{originCode}, #{invStorageCode}, #{invWarehouseCode})
</insert>
<insert id="insertInvProductDetails" keyProperty="id"
parameterType="com.glxp.sale.admin.entity.inventory.InvProductDetailEntity">
insert INTO inv_prein_product_detail
(code, productIdFk, orderIdFk, customerId, mainAction, action, count, updateTime,
purchaseType, batchNo, productionDate, expireDate, unitFk, stockIdFk, supId,originCode
, invStorageCode, invWarehouseCode)
values
<foreach collection="invProductDetailEntitys" item="item" index="index"
separator=",">
(
#{item.code},
#{item.productIdFk},#{item.orderIdFk},
#{item.customerId},#{item.mainAction},#{item.action},#{item.count},#{item.updateTime},
#{item.purchaseType}, #{item.batchNo}, #{item.productionDate}, #{item.expireDate},
#{item.unitFk},#{item.stockIdFk},#{item.supId},#{item.originCode}, #{item.invStorageCode},
#{item.invWarehouseCode}
)
</foreach>
</insert>
<delete id="deleteById" parameterType="Map">
DELETE
FROM inv_prein_product_detail
WHERE id = #{id}
</delete>
<delete id="deleteByProductId" parameterType="com.glxp.sale.admin.req.inventory.FilterInvProductDetailRequest">
DELETE
FROM inv_prein_product_detail
<where>
<if test="productIdFk != '' and productIdFk != null">
AND productIdFk = #{productIdFk}
</if>
<if test="batchNo != '' and batchNo != null">
AND batchNo = #{batchNo}
</if>
<if test="supId != '' and supId != null">
AND supId = #{supId}
</if>
</where>
</delete>
<update id="updateInvProductDetail" parameterType="com.glxp.sale.admin.entity.inventory.InvProductDetailEntity">
UPDATE inv_prein_product_detail
<trim prefix="set" suffixOverrides=",">
<if test="code != null">code=#{code},</if>
<if test="productIdFk != null">productIdFk=#{productIdFk},</if>
<if test="customerId != null">customerId=#{customerId},</if>
<if test="mainAction != null">mainAction=#{mainAction},</if>
<if test="action != null">action=#{action},</if>
<if test="count != null">count=#{count},</if>
<if test="unitFk != null">unitFk=#{unitFk},</if>
<if test="purchaseType != null">purchaseType=#{purchaseType},</if>
<if test="batchNo != null">batchNo=#{batchNo},</if>
<if test="productionDate != null">productionDate=#{productionDate},</if>
<if test="expireDate != null">expireDate=#{expireDate},</if>
<if test="stockIdFk != null">stockIdFk=#{stockIdFk},</if>
<if test="supId != null">supId=#{supId},</if>
<if test="originCode != null">originCode=#{originCode},</if>
<if test="invStorageCode != null">invStorageCode=#{invStorageCode},</if>
<if test="invWarehouseCode != null">invWarehouseCode=#{invWarehouseCode},</if>
</trim>
WHERE id = #{id}
</update>
<select id="statCount" parameterType="com.glxp.sale.admin.req.inventory.FilterInvProductDetailRequest"
resultType="java.lang.Integer">
SELECT count(0) FROM inv_prein_product_detail
<where>
<if test="productIdFk != '' and productIdFk != null">
AND productIdFk = #{productIdFk}
</if>
<if test="customerId != '' and customerId != null">
AND customerId = #{customerId}
</if>
<if test="mainAction != '' and mainAction != null">
AND mainAction = #{mainAction}
</if>
<if test="action != '' and action != null">
AND action = #{action}
</if>
<if test="purchaseType != null">
AND purchaseType = #{purchaseType}
</if>
<if test="batchNo != '' and batchNo != null">
AND batchNo = #{batchNo}
</if>
<if test="unitFk != '' and unitFk != null">
AND unitFk = #{unitFk}
</if>
<if test="stockIdFk != '' and stockIdFk != null">
AND stockIdFk = #{stockIdFk}
</if>
<if test="supId != '' and supId != null">
AND supId = #{supId}
</if>
</where>
</select>
</mapper>

@ -36,7 +36,9 @@
<if test="supId != '' and supId != null">
AND supId = #{supId}
</if>
<if test="code != '' and code != null">
AND code = #{code}
</if>
<if test="originCode != '' and originCode != null">
AND originCode = #{originCode}
</if>

@ -0,0 +1,40 @@
<?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.param.SyncDataSetDao">
<select id="selectSet"
resultType="com.glxp.sale.admin.entity.param.SyncDataSetEntity">
SELECT *
FROM sync_data_set limit 1
</select>
<insert id="insert" parameterType="com.glxp.sale.admin.entity.param.SyncDataSetEntity">
replace
INTO sync_data_set(id,typeBus, typeScan,
typeThird, basicProducts, basicCorp, basicInv, basicThirdProducts, basicThirdCorp, basicThirdInv
, basicThirdBusOrder, orderScanFinish, dbDiProducts,downstreamEnable,syncTime,
orderUnReceive,orderUnCheck,busTypes)
values (
#{id},
#{typeBus},
#{typeScan},
#{typeThird},
#{basicProducts},
#{basicCorp},
#{basicInv},
#{basicThirdProducts},
#{basicThirdCorp},
#{basicThirdInv},
#{basicThirdBusOrder},
#{orderScanFinish},
#{dbDiProducts},
#{downstreamEnable},
#{syncTime},#{orderUnReceive},#{orderUnCheck},#{busTypes}
)
</insert>
</mapper>
Loading…
Cancel
Save