预验收功能;

预验收校验;
业务单据根据用户ID分类;
master
anthonyywj2 3 years ago
parent 43c7651026
commit 93134fe095

@ -137,10 +137,18 @@ public class UdiInfoController {
try { try {
BaseResponse<PageSimpleResponse<ProductInfoEntity>> udiDlDeviceResponse = syncUdiService.filterUdi(productInfoFilterRequest); BaseResponse<PageSimpleResponse<ProductInfoEntity>> udiDlDeviceResponse = syncUdiService.filterUdi(productInfoFilterRequest);
if (CollUtil.isEmpty(udiDlDeviceResponse.getData().getList())) { if (CollUtil.isEmpty(udiDlDeviceResponse.getData().getList())) {
List<ProductInfoEntity> productInfoEntityList = asyncDiDlHelper.dlByDi(filterUdiInfoRequest.getNameCode()); BaseResponse<List<ProductInfoEntity>> listBaseResponse = asyncDiDlHelper.dlByDiRes(filterUdiInfoRequest.getNameCode());
if (CollUtil.isNotEmpty(productInfoEntityList)) {
productInfoService.insertProductInfos(productInfoEntityList); if(listBaseResponse.getCode() == 20000){
udiDlDeviceResponse = syncUdiService.filterUdi(productInfoFilterRequest); List<ProductInfoEntity> productInfoEntityList = listBaseResponse.getData();
if (CollUtil.isNotEmpty(productInfoEntityList)) {
productInfoService.insertProductInfos(productInfoEntityList);
udiDlDeviceResponse = syncUdiService.filterUdi(productInfoFilterRequest);
} else {
ResultVOUtils.error(500, "未查询到该产品DI");
}
}else {
return listBaseResponse;
} }
} }
if (filterUdiInfoRequest.getIsCheck() != null && filterUdiInfoRequest.getIsCheck()) { if (filterUdiInfoRequest.getIsCheck() != null && filterUdiInfoRequest.getIsCheck()) {

@ -281,7 +281,12 @@ public class OrderController {
AuthAdmin authAdmin = customerService.getUserBean(); AuthAdmin authAdmin = customerService.getUserBean();
OrderEntity orderEntity = orderService.findById(updateExportStatusRequest.getOrderId()); OrderEntity orderEntity = orderService.findById(updateExportStatusRequest.getOrderId());
orderEntity.setReceiveStatus(1); orderEntity.setReceiveStatus(1);
orderEntity.setReviewUser(authAdmin.getId().intValue()); long customerId = customerService.getCustomerId();
if (customerId == 110) {
orderEntity.setReviewUser(authAdmin.getId().intValue());
}
orderEntity.setUpdateTime(new Date()); orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity); orderService.updateOrder(orderEntity);
List<String> erpIds = DataTransUtil.strToErpList(orderEntity.getErpFk()); List<String> erpIds = DataTransUtil.strToErpList(orderEntity.getErpFk());
@ -291,7 +296,9 @@ public class OrderController {
stockOrderFilterRequest.setBillNo(id); stockOrderFilterRequest.setBillNo(id);
StockOrderEntity stockOrderEntity = stockOrderService.findOne(stockOrderFilterRequest); StockOrderEntity stockOrderEntity = stockOrderService.findOne(stockOrderFilterRequest);
stockOrderEntity.setStatus(ConstantStatus.SORDER_DELIVER); stockOrderEntity.setStatus(ConstantStatus.SORDER_DELIVER);
stockOrderEntity.setReviewUser(authAdmin.getId().intValue()); if (customerId == 110) {
stockOrderEntity.setReviewUser(authAdmin.getId().intValue());
}
stockOrderService.updateById(stockOrderEntity); stockOrderService.updateById(stockOrderEntity);
} }
@ -302,7 +309,10 @@ public class OrderController {
if (!stockOrderEntityLit.isEmpty()) { if (!stockOrderEntityLit.isEmpty()) {
for (StockOrderEntity stockOrderEntity : stockOrderEntityLit) { for (StockOrderEntity stockOrderEntity : stockOrderEntityLit) {
stockOrderEntity.setStatus(ConstantStatus.SORDER_DELIVER); stockOrderEntity.setStatus(ConstantStatus.SORDER_DELIVER);
stockOrderEntity.setReviewUser(authAdmin.getId().intValue()); if (customerId == 110) {
stockOrderEntity.setReviewUser(authAdmin.getId().intValue());
}
stockOrderService.updateById(stockOrderEntity); stockOrderService.updateById(stockOrderEntity);
} }

@ -473,7 +473,10 @@ public class OrderDetailController {
OrderFilterRequest orderFilterRequest = new OrderFilterRequest(); OrderFilterRequest orderFilterRequest = new OrderFilterRequest();
orderFilterRequest.setId(importErpOrderRequest.getOrderId()); orderFilterRequest.setId(importErpOrderRequest.getOrderId());
OrderEntity orderEntity = orderService.findOne(orderFilterRequest); OrderEntity orderEntity = orderService.findOne(orderFilterRequest);
orderEntity.setReviewUser(authAdmin.getId().intValue()); long customerId = customerService.getCustomerId();
if(customerId == 110){
orderEntity.setReviewUser(authAdmin.getId().intValue());
}
ErpOrderEntity exitErp = new ContrastErpUtil().vailErpExit(orderDetailService, erpOrderEntities, importErpOrderRequest.getOrderId()); ErpOrderEntity exitErp = new ContrastErpUtil().vailErpExit(orderDetailService, erpOrderEntities, importErpOrderRequest.getOrderId());
if (exitErp != null) { if (exitErp != null) {
String errMsg = "所选ERP单" + exitErp.getErpOrderId() + "已被其他出入库单" + exitErp.getOrderIdFk() + "绑定"; String errMsg = "所选ERP单" + exitErp.getErpOrderId() + "已被其他出入库单" + exitErp.getOrderIdFk() + "绑定";

@ -165,6 +165,7 @@ public class StockOrderController {
CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(stockOrderPostRequest.getCustomerId())); CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(stockOrderPostRequest.getCustomerId()));
stockOrderEntity.setCorpId(companyEntity.getUnitIdFk()); stockOrderEntity.setCorpId(companyEntity.getUnitIdFk());
stockOrderEntity.setCorpName(companyEntity.getCompanyName()); stockOrderEntity.setCorpName(companyEntity.getCompanyName());
stockOrderEntity.setCreateUser(null);
stockOrderEntity.setUnitIdFk(companyEntity.getUnitIdFk()); stockOrderEntity.setUnitIdFk(companyEntity.getUnitIdFk());
} else { } else {
if (stockOrderPostRequest.getCorpId() == null) { if (stockOrderPostRequest.getCorpId() == null) {

@ -394,18 +394,32 @@ public class WareHouseController {
} }
} }
String orderId = addOrderRequest.getOrderId();
//预验收校验 //预验收校验
if (addOrderRequest.isPreCheck()) { if (addOrderRequest.isPreCheck()) {
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest(); InvProductDetailEntity invProductDetailEntity = invPreInProductDetailService.statInvPreInDetail(code);
filterInvProductDetailRequest.setOriginCode(code); if (invProductDetailEntity == null) {
List<InvProductDetailEntity> invProductDetailEntities = invPreInProductDetailService.filterInvProduct(filterInvProductDetailRequest); return ResultVOUtils.error(500, "预验收库存未存在此产品!");
if(CollUtil.isEmpty(invProductDetailEntities)){ } else {
return ResultVOUtils.error(500, "该产品未入库!"); if (StrUtil.isNotEmpty(orderId)) {//非首次添加
if (StrUtil.isEmpty(udiEntity.getSerialNo())) {//该单据已有该产品
WarehouseQueryRequest warehouseQueryRequest = new WarehouseQueryRequest();
warehouseQueryRequest.setOrderId(orderId);
warehouseQueryRequest.setCode(code);
List<WarehouseEntity> warehouseEntitys = codesTempService.findByOrderIdAndCode(warehouseQueryRequest);
if (CollUtil.isNotEmpty(warehouseEntitys)) {
WarehouseEntity warehouseEntity = warehouseEntitys.get(0);
if (invProductDetailEntity.getCount() < (warehouseEntity.getCount() + 1)) {
return ResultVOUtils.error(500, "超出预验收库存数量");
}
}
}
}
} }
} }
String orderId = addOrderRequest.getOrderId();
if (addOrderRequest.getCustomerId() != null && (addOrderRequest.getFromCorpId() == null || "".equals(addOrderRequest.getFromCorpId()))) { if (addOrderRequest.getCustomerId() != null && (addOrderRequest.getFromCorpId() == null || "".equals(addOrderRequest.getFromCorpId()))) {
CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(addOrderRequest.getCustomerId())); CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(addOrderRequest.getCustomerId()));
addOrderRequest.setFromCorp(companyEntity.getCompanyName()); addOrderRequest.setFromCorp(companyEntity.getCompanyName());
@ -505,6 +519,10 @@ public class WareHouseController {
} }
Integer userId = customerService.getUserId(); Integer userId = customerService.getUserId();
long customerId = customerService.getCustomerId();
if (customerId == 110) {
orderSaveRequest.setCreateUser(userId);
}
orderSaveRequest.setMainAction(bussinessTypeEntity.getMainAction()); orderSaveRequest.setMainAction(bussinessTypeEntity.getMainAction());
orderSaveRequest.setAction(bussinessTypeEntity.getAction()); orderSaveRequest.setAction(bussinessTypeEntity.getAction());
orderSaveRequest.setActor(addOrderRequest.getActor()); orderSaveRequest.setActor(addOrderRequest.getActor());
@ -519,8 +537,7 @@ public class WareHouseController {
orderSaveRequest.setContrastStatus(ConstantStatus.ORDER_CHECK_UN); orderSaveRequest.setContrastStatus(ConstantStatus.ORDER_CHECK_UN);
orderSaveRequest.setSignStatus(ConstantStatus.ORDER_SIGN_UN); orderSaveRequest.setSignStatus(ConstantStatus.ORDER_SIGN_UN);
orderSaveRequest.setReceiveStatus(ConstantStatus.RECEIVE_UN); orderSaveRequest.setReceiveStatus(ConstantStatus.RECEIVE_UN);
orderSaveRequest.setCustomerId(customerService.getCustomerId() + ""); orderSaveRequest.setCustomerId(customerId + "");
orderSaveRequest.setCreateUser(userId);
orderService.insertOrder(orderSaveRequest); orderService.insertOrder(orderSaveRequest);
} }
@ -655,9 +672,15 @@ public class WareHouseController {
} }
try { try {
String customerId = getCustomerId(); String customerId = getCustomerId();
Integer userId = customerService.getUserId();
postOrderRequest.setCustomerId(customerId); if(customerId.equals("110")){
postOrderRequest.setUserId(userId); Integer userId = customerService.getUserId();
postOrderRequest.setCustomerId(customerId);
postOrderRequest.setUserId(userId);
}else {
postOrderRequest.setUserId(null);
}
ioTransInoutService.creatOrderWeb(postOrderRequest); ioTransInoutService.creatOrderWeb(postOrderRequest);
} catch (Exception e) { } catch (Exception e) {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK); return ResultVOUtils.error(ResultEnum.NOT_NETWORK);

@ -129,7 +129,9 @@ public class CheckOrderUtils {
status = getStockOrderStatus(orderEntity, bussinessTypeEntity); status = getStockOrderStatus(orderEntity, bussinessTypeEntity);
stockOrderEntity.setStatus(status); stockOrderEntity.setStatus(status);
stockOrderEntity.setOrderIdFk(orderId); stockOrderEntity.setOrderIdFk(orderId);
stockOrderEntity.setReviewUser(orderEntity.getReviewUser()); if(orderEntity.getCustomerId().equals("110")){
stockOrderEntity.setReviewUser(orderEntity.getReviewUser());
}
stockOrderService.updateById(stockOrderEntity); stockOrderService.updateById(stockOrderEntity);
} }
} }

@ -85,7 +85,16 @@ public class InvPreInProductsController {
if (CollUtil.isNotEmpty(invProductResponses)) { if (CollUtil.isNotEmpty(invProductResponses)) {
return ResultVOUtils.success(invProductResponses); return ResultVOUtils.success(invProductResponses);
} }
return ResultVOUtils.error(501, "未入库"); return ResultVOUtils.error(501, "该产品未预验收入库");
}
@AuthRuleAnnotation("")
@GetMapping("spms/prein/inv/products/getDetaiByCode")
public BaseResponse getDetaiByCode(FilterInvProductDetailRequest filterInvProductDetailRequest) {
InvProductDetailEntity invProductDetailEntity = invProductDetailService.statInvPreInDetail(filterInvProductDetailRequest.getCode());
if (invProductDetailEntity != null)
return ResultVOUtils.success(invProductDetailEntity);
return ResultVOUtils.error(501, "该产品未预验收入库");
} }

@ -18,10 +18,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* *
@ -75,31 +72,16 @@ public class ThrInvWarehouseController {
thrInvWarehouseEntity.setPid(0); // 默认设置 thrInvWarehouseEntity.setPid(0); // 默认设置
FilterThrInvWarehouseRequest filterThrInvWarehouseRequest = new FilterThrInvWarehouseRequest(); FilterThrInvWarehouseRequest filterThrInvWarehouseRequest = new FilterThrInvWarehouseRequest();
filterThrInvWarehouseRequest.setPid(thrInvWarehouseEntity.getPid()); filterThrInvWarehouseRequest.setPid(thrInvWarehouseEntity.getPid());
// ThrInvWarehouseEntity codeEntity = thrInvWarehouseService.selectMaxCode(filterThrInvWarehouseRequest);
// if(codeEntity == null)
// if (codeEntity == null) {
// int code = Integer.parseInt("1") * 1000;
// thrInvWarehouseEntity.setCode(code + "");
// } else {
// thrInvWarehouseEntity.setCode(Integer.parseInt(codeEntity.getCode()) + 1 + "");
// }
// thrInvWarehouseEntity.setCode(Integer.parseInt(codeEntity.getCode()) + 1 + "");
} else {//货位 } else {//货位
FilterThrInvWarehouseRequest filterThrInvWarehouseRequest = new FilterThrInvWarehouseRequest(); FilterThrInvWarehouseRequest filterThrInvWarehouseRequest = new FilterThrInvWarehouseRequest();
filterThrInvWarehouseRequest.setPid(thrInvWarehouseEntity.getPid()); filterThrInvWarehouseRequest.setPid(thrInvWarehouseEntity.getPid());
// ThrInvWarehouseEntity codeEntity = thrInvWarehouseService.selectMaxCode(filterThrInvWarehouseRequest);
ThrInvWarehouseEntity pEntity = thrInvWarehouseService.selectById(thrInvWarehouseEntity.getPid() + ""); ThrInvWarehouseEntity pEntity = thrInvWarehouseService.selectById(thrInvWarehouseEntity.getPid() + "");
// if (codeEntity == null) {
// int code = Integer.parseInt(pEntity.getCode()) * 1000;
// thrInvWarehouseEntity.setCode(code + "");
// } else {
// thrInvWarehouseEntity.setCode(Integer.parseInt(codeEntity.getCode()) + 1 + "");
// }
thrInvWarehouseEntity.setAdvanceType(pEntity.getAdvanceType()); thrInvWarehouseEntity.setAdvanceType(pEntity.getAdvanceType());
thrInvWarehouseEntity.setLevel(pEntity.getLevel()); thrInvWarehouseEntity.setLevel(pEntity.getLevel());
thrInvWarehouseEntity.setPcode(pEntity.getPcode()); thrInvWarehouseEntity.setPcode(pEntity.getPcode());
} }
thrInvWarehouseEntity.setUpdateTime(new Date());
boolean b = thrInvWarehouseService.insertInvWarehouse(thrInvWarehouseEntity); boolean b = thrInvWarehouseService.insertInvWarehouse(thrInvWarehouseEntity);
if (!b) { if (!b) {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK); return ResultVOUtils.error(ResultEnum.NOT_NETWORK);

@ -29,4 +29,8 @@ public class ThrInvWarehouseEntity {
* *
*/ */
private String pcode; private String pcode;
/**
*
*/
private String thirdSysFk;
} }

@ -44,6 +44,7 @@ public class PostOrderRequest {
private String billType; private String billType;
private String orderId; private String orderId;
private boolean outChangeEnable; private boolean outChangeEnable;
private boolean preCheck;
public String getStockIdFk() { public String getStockIdFk() {
return stockIdFk; return stockIdFk;
@ -94,6 +95,14 @@ public class PostOrderRequest {
public void setOutChangeEnable(boolean outChangeEnable) { public void setOutChangeEnable(boolean outChangeEnable) {
this.outChangeEnable = outChangeEnable; this.outChangeEnable = outChangeEnable;
} }
public boolean isPreCheck() {
return preCheck;
}
public void setPreCheck(boolean preCheck) {
this.preCheck = preCheck;
}
} }
} }

@ -19,4 +19,8 @@ public class FilterThrInvWarehouseRequest extends ListPageRequest {
private String pcode; private String pcode;
private Integer level; private Integer level;
private String lastUpdateTime; private String lastUpdateTime;
/**
*
*/
private String thirdSysFk;
} }

@ -26,4 +26,7 @@ public interface InvPreInProductDetailService {
List<String> findAllCode(FilterInvProductDetailRequest filterInvProductDetailRequest); List<String> findAllCode(FilterInvProductDetailRequest filterInvProductDetailRequest);
InvProductDetailEntity statInvPreInDetail(String code);
} }

@ -1,6 +1,7 @@
package com.glxp.sale.admin.service.inventory.impl; package com.glxp.sale.admin.service.inventory.impl;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.glxp.sale.admin.constant.ConstantType;
import com.glxp.sale.admin.dao.inventory.InvPreInProductDetailDao; import com.glxp.sale.admin.dao.inventory.InvPreInProductDetailDao;
import com.glxp.sale.admin.entity.inventory.InvProductDetailEntity; import com.glxp.sale.admin.entity.inventory.InvProductDetailEntity;
import com.glxp.sale.admin.req.inventory.FilterInvProductDetailRequest; import com.glxp.sale.admin.req.inventory.FilterInvProductDetailRequest;
@ -10,7 +11,9 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
@Service @Service
public class InvPreInProductDetailServiceImpl implements InvPreInProductDetailService { public class InvPreInProductDetailServiceImpl implements InvPreInProductDetailService {
@ -78,4 +81,34 @@ public class InvPreInProductDetailServiceImpl implements InvPreInProductDetailSe
public List<String> findAllCode(FilterInvProductDetailRequest filterInvProductDetailRequest) { public List<String> findAllCode(FilterInvProductDetailRequest filterInvProductDetailRequest) {
return invPreInProductDetailDao.findAllCode(filterInvProductDetailRequest); return invPreInProductDetailDao.findAllCode(filterInvProductDetailRequest);
} }
@Override
public InvProductDetailEntity statInvPreInDetail(String code) {
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
filterInvProductDetailRequest.setOriginCode(code);
List<InvProductDetailEntity> datas = invPreInProductDetailDao.filterInvProductDetail(filterInvProductDetailRequest);
Map<String, InvProductDetailEntity> invProductDetailEntityMap = new HashMap<>();
for (InvProductDetailEntity invProductDetailEntity : datas) {
InvProductDetailEntity temp = invProductDetailEntityMap.get(invProductDetailEntity.getCode());
if (temp == null) {
invProductDetailEntityMap.put(invProductDetailEntity.getOriginCode(), invProductDetailEntity);
} else {
int count1 = 0;
int count2 = 0;
if (temp.getMainAction().equals(ConstantType.TYPE_PUT)) {
count1 = temp.getCount();
} else {
count1 = 0 - temp.getCount();
}
if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
count2 = invProductDetailEntity.getCount();
} else {
count2 = 0 - invProductDetailEntity.getCount();
}
temp.setCount(count1 + count2);
}
}
return invProductDetailEntityMap.get(code);
}
} }

@ -8,6 +8,7 @@ import com.glxp.sale.admin.entity.receipt.ProductInfoEntity;
import com.glxp.sale.admin.res.PageSimpleResponse; import com.glxp.sale.admin.res.PageSimpleResponse;
import com.glxp.sale.admin.util.HttpClient; import com.glxp.sale.admin.util.HttpClient;
import com.glxp.sale.common.res.BaseResponse; import com.glxp.sale.common.res.BaseResponse;
import com.glxp.sale.common.util.ResultVOUtils;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -70,13 +71,33 @@ public class AsyncDiDlHelper {
BaseResponse<List<ProductInfoEntity>> baseResponse = BaseResponse<List<ProductInfoEntity>> baseResponse =
JSONObject.parseObject(response, new TypeReference<BaseResponse<List<ProductInfoEntity>>>() { JSONObject.parseObject(response, new TypeReference<BaseResponse<List<ProductInfoEntity>>>() {
}); });
if (baseResponse.getCode() == 200000) {
List<ProductInfoEntity> productInfoEntityList = baseResponse.getData();
return productInfoEntityList;
} else {
return null;
}
List<ProductInfoEntity> productInfoEntityList = baseResponse.getData();
return productInfoEntityList;
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
return null; return null;
} }
} }
public BaseResponse<List<ProductInfoEntity>> dlByDiRes(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>>>() {
});
return baseResponse;
} catch (Exception e) {
e.printStackTrace();
return ResultVOUtils.error(500, "系统繁忙!");
}
}
} }

@ -19,6 +19,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -100,6 +101,7 @@ public class BasicUnitImportService {
basicUnitMaintainEntity.setContact(erpUnitsResponse.getContact()); basicUnitMaintainEntity.setContact(erpUnitsResponse.getContact());
basicUnitMaintainEntity.setMobile(erpUnitsResponse.getMobile()); basicUnitMaintainEntity.setMobile(erpUnitsResponse.getMobile());
basicUnitMaintainEntity.setCorpType(ConstantStatus.CORP_SP); basicUnitMaintainEntity.setCorpType(ConstantStatus.CORP_SP);
basicUnitMaintainEntity.setUpdateTime(new Date());
basicUnitMaintainService.insertBasicUnitMaintainignore(basicUnitMaintainEntity); basicUnitMaintainService.insertBasicUnitMaintainignore(basicUnitMaintainEntity);
} }
} }

@ -100,7 +100,7 @@ public class InvProductsTrService {
if (bussinessTypeEntity.isPreIn()) { if (bussinessTypeEntity.isPreIn()) {
InvProductEntity invPreProductEntity = InvProductEntity invPreProductEntity =
invPreInProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo(), warehouseEntity.getSupId() invPreInProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo(), warehouseEntity.getSupId()
, warehouseEntity.getInvStorageCode(), warehouseEntity.getInvWarehouseCode()); , null, null);
if (invPreProductEntity == null) { if (invPreProductEntity == null) {
invPreProductEntity = buildInvProduct(erpOrderEntity.getGoodsid(), erpOrderEntity, orderEntity, warehouseEntity); invPreProductEntity = buildInvProduct(erpOrderEntity.getGoodsid(), erpOrderEntity, orderEntity, warehouseEntity);
invPreInProductService.insertInvProduct(invPreProductEntity); invPreInProductService.insertInvProduct(invPreProductEntity);
@ -149,6 +149,17 @@ public class InvProductsTrService {
invProductService.updateInvProduct(invProductEntity); invProductService.updateInvProduct(invProductEntity);
} }
if (orderEntity.isPreCheck()) {
int actCount = getActCount(warehouseEntity);
int count = actCount * warehouseEntity.getCount();
InvProductEntity preInvEntity = invPreInProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo(),
warehouseEntity.getSupId(), null, null);
if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
preInvEntity.setOutCount(preInvEntity.getOutCount() + count);
}
invPreInProductService.updateInvProduct(preInvEntity);
}
} }
} }
@ -172,6 +183,10 @@ public class InvProductsTrService {
invProductDetailEntities = buildInvProductDetail(orderId, erpOrderEntity, orderEntity, 3); invProductDetailEntities = buildInvProductDetail(orderId, erpOrderEntity, orderEntity, 3);
} else { } else {
invProductDetailEntities = buildInvProductDetail(orderId, erpOrderEntity, orderEntity, 2); invProductDetailEntities = buildInvProductDetail(orderId, erpOrderEntity, orderEntity, 2);
if (orderEntity.isPreCheck()) {
insetInv(bussinessTypeEntity, invProductDetailEntities);//2.插入当前库存
}
} }
if (invProductDetailEntities != null && invProductDetailEntities.size() > 0) { if (invProductDetailEntities != null && invProductDetailEntities.size() > 0) {
mInvProductDetailEntities.addAll(invProductDetailEntities); mInvProductDetailEntities.addAll(invProductDetailEntities);
@ -412,16 +427,7 @@ public class InvProductsTrService {
for (WarehouseEntity warehouseEntity : warehouseEntities) { for (WarehouseEntity warehouseEntity : warehouseEntities) {
int actCount = getActCount(warehouseEntity); int actCount = getActCount(warehouseEntity);
int count = actCount * warehouseEntity.getCount(); int count = actCount * warehouseEntity.getCount();
// String code = warehouseEntity.getCode();
UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity); UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity);
// if (udiInfoEntity.getDiType() == ConstantStatus.DITYPE_PACK || udiInfoEntity.getDiType() == ConstantStatus.DITYPE_SYDY
// || (udiInfoEntity.getSjcpbm() != null && !"".equals(udiInfoEntity.getSjcpbm()))) {
// warehouseEntity.setNameCode(udiInfoEntity.getNameCode());
// code = FilterUdiUtils.transGlxpNoSerStr(warehouseEntity);
// count = actCount * warehouseEntity.getCount();
// } else {
// count = warehouseEntity.getCount();
// }
//获取寄售出入库结余数量 //获取寄售出入库结余数量
int invCount = getPreCountByOrder(null, udiInfoEntity.getRelId(), warehouseEntity.getBatchNo(), warehouseEntity.getSupId(), warehouseEntity.getLocStorageCode()); int invCount = getPreCountByOrder(null, udiInfoEntity.getRelId(), warehouseEntity.getBatchNo(), warehouseEntity.getSupId(), warehouseEntity.getLocStorageCode());
if (invCount > 0) {//仓库已存在该产品 if (invCount > 0) {//仓库已存在该产品
@ -506,7 +512,6 @@ public class InvProductsTrService {
warehouseEntity.setMainAction(ConstantType.TYPE_OUT); warehouseEntity.setMainAction(ConstantType.TYPE_OUT);
} }
codesTempService.insertCodesTemp(preOutList); codesTempService.insertCodesTemp(preOutList);
// ioTransInoutService.transInout(outOrder.getId());
} }
//生成寄售入库单据 //生成寄售入库单据

@ -186,10 +186,15 @@ public class IoTransInoutService {
orderSaveRequest.setFromCorpId(warehouseEntity.getFromCorpId()); orderSaveRequest.setFromCorpId(warehouseEntity.getFromCorpId());
orderSaveRequest.setOutChangeEnable(postOrder.isOutChangeEnable()); orderSaveRequest.setOutChangeEnable(postOrder.isOutChangeEnable());
orderSaveRequest.setCustomerId(postOrderRequest.getCustomerId()); orderSaveRequest.setCustomerId(postOrderRequest.getCustomerId());
if (postOrderRequest.getCustomerId().equals(110)) {
orderSaveRequest.setCreateUser(postOrderRequest.getUserId());
}
orderSaveRequest.setLocStorageCode(warehouseEntity.getLocStorageCode()); orderSaveRequest.setLocStorageCode(warehouseEntity.getLocStorageCode());
orderSaveRequest.setMainAction(warehouseEntity.getMainAction()); orderSaveRequest.setMainAction(warehouseEntity.getMainAction());
orderSaveRequest.setReceiveStatus(0); orderSaveRequest.setReceiveStatus(0);
orderSaveRequest.setCreateUser(postOrderRequest.getUserId()); orderSaveRequest.setPreCheck(postOrder.isPreCheck());
orderSaveRequest.setFromCorp(warehouseEntity.getFromCorp()); orderSaveRequest.setFromCorp(warehouseEntity.getFromCorp());
if (postOrder.getErpOrders() != null && postOrder.getErpOrders().size() > 0) if (postOrder.getErpOrders() != null && postOrder.getErpOrders().size() > 0)
orderSaveRequest.setFromType(ConstantStatus.FROM_PDAED); orderSaveRequest.setFromType(ConstantStatus.FROM_PDAED);
@ -243,6 +248,8 @@ public class IoTransInoutService {
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_PROCESS); orderEntity.setStatus(ConstantStatus.ORDER_STATUS_PROCESS);
orderEntity.setExportStatus(ConstantStatus.ORDER_EXPORT_UN); orderEntity.setExportStatus(ConstantStatus.ORDER_EXPORT_UN);
orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_UN); orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_UN);
orderEntity.setCreateUser(null);
orderEntity.setReviewUser(null);
orderEntity.setSignStatus(ConstantStatus.ORDER_SIGN_UN); orderEntity.setSignStatus(ConstantStatus.ORDER_SIGN_UN);
orderEntity.setCustomerId(postUdimsOrderRequest.getCustomerId()); orderEntity.setCustomerId(postUdimsOrderRequest.getCustomerId());
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findDefault(false, true); InvWarehouseEntity invWarehouseEntity = invWarehouseService.findDefault(false, true);
@ -250,7 +257,7 @@ public class IoTransInoutService {
orderEntity.setInvStorageCode(invWarehouseEntity.getCode()); orderEntity.setInvStorageCode(invWarehouseEntity.getCode());
orderEntity.setUpdateTime(new Date()); orderEntity.setUpdateTime(new Date());
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(orderEntity.getAction()); BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(orderEntity.getAction());
String orderNo = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER+ MyStrUtil.trim(bussinessTypeEntity.getPrefix()), "yyyyMMdd")); String orderNo = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER + MyStrUtil.trim(bussinessTypeEntity.getPrefix()), "yyyyMMdd"));
String orderId = orderNo; String orderId = orderNo;
orderEntity.setId(orderId); orderEntity.setId(orderId);

@ -36,8 +36,8 @@ logging.file=D:/glxpdata/udiwms/udiwms.log
file_path=D:/glxpdata/udiwms file_path=D:/glxpdata/udiwms
#UDI\u6570\u636E\u4E0B\u8F7D #UDI\u6570\u636E\u4E0B\u8F7D
UDI_KEY=6b137c66-6286-46c6-8efa-c2f5dd9237df UDI_KEY=6b137c66-6286-46c6-8efa-c2f5dd9237df
UDI_SERVER_URL=https://www.udims.com/UDI_DL_Server_test #UDI_SERVER_URL=https://www.udims.com/UDI_DL_Server_test
#UDI_SERVER_URL=http://127.0.0.1:9994 UDI_SERVER_URL=http://127.0.0.1:9994
#UDI_SERVER_URL=https://www.udims.com/UDI_DL_Server #UDI_SERVER_URL=https://www.udims.com/UDI_DL_Server
#UCLOD\u670D\u52A1 #UCLOD\u670D\u52A1
#UCLOD_SERVER_URL=http://127.0.0.1:9997 #UCLOD_SERVER_URL=http://127.0.0.1:9997

@ -248,7 +248,7 @@
and reviewUser =#{reviewUser} and reviewUser =#{reviewUser}
</if> </if>
<if test="unionUser != '' and unionUser!=null"> <if test="unionUser != '' and unionUser!=null">
and (createUser =#{unionUser} or reviewUser =#{unionUser}) and ((createUser =#{unionUser} or reviewUser =#{unionUser}) or (reviewUser is null and createUser is null) )
</if> </if>
<if test="ullageSupNo != '' and ullageSupNo!=null"> <if test="ullageSupNo != '' and ullageSupNo!=null">
and ullageSupNo =#{ullageSupNo} and ullageSupNo =#{ullageSupNo}

@ -158,7 +158,7 @@
and locStorageCode = #{locStorageCode} and locStorageCode = #{locStorageCode}
</if> </if>
<if test="unionUser != '' and unionUser!=null"> <if test="unionUser != '' and unionUser!=null">
and (createUser =#{unionUser} or reviewUser =#{unionUser}) and ((createUser =#{unionUser} or reviewUser =#{unionUser}) or (reviewUser is null and createUser is null) )
</if> </if>
<if test="createUser!=null"> <if test="createUser!=null">
and createUser = #{createUser} and createUser = #{createUser}

@ -77,13 +77,18 @@
<where> <where>
relIdFk = #{relIdFk} relIdFk = #{relIdFk}
and invStorageCode = #{invStorageCode}
<if test="supId != '' and supId != null"> <if test="supId != '' and supId != null">
AND supId = #{supId} AND supId = #{supId}
</if> </if>
<if test="supId == null"> <if test="supId == null">
AND supId is NULL AND supId is NULL
</if> </if>
<if test="batchNo != '' and batchNo != null">
AND batchNo = #{batchNo}
</if>
<if test="invStorageCode != '' and invStorageCode != null">
AND invStorageCode = #{invStorageCode}
</if>
<if test="invWarehouseCode != '' and invWarehouseCode != null"> <if test="invWarehouseCode != '' and invWarehouseCode != null">
AND invWarehouseCode = #{invWarehouseCode} AND invWarehouseCode = #{invWarehouseCode}
</if> </if>

@ -84,6 +84,9 @@
<if test="supId == null"> <if test="supId == null">
AND supId is NULL AND supId is NULL
</if> </if>
<if test="batchNo != '' and batchNo != null">
AND batchNo = #{batchNo}
</if>
<if test="invWarehouseCode != '' and invWarehouseCode != null"> <if test="invWarehouseCode != '' and invWarehouseCode != null">
AND invWarehouseCode = #{invWarehouseCode} AND invWarehouseCode = #{invWarehouseCode}
</if> </if>

@ -82,6 +82,9 @@
<if test="supId == null"> <if test="supId == null">
AND supId is NULL AND supId is NULL
</if> </if>
<if test="batchNo != '' and batchNo != null">
AND batchNo = #{batchNo}
</if>
<if test="invWarehouseCode != '' and invWarehouseCode != null"> <if test="invWarehouseCode != '' and invWarehouseCode != null">
AND invWarehouseCode = #{invWarehouseCode} AND invWarehouseCode = #{invWarehouseCode}
</if> </if>

@ -31,6 +31,9 @@
<if test="lastUpdateTime!=null and lastUpdateTime!=''"> <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') ]]> <![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
</if> </if>
<if test="thirdSysFk != null">
and thirdSysFk = #{thirdSysFk}
</if>
</where> </where>
</select> </select>
@ -64,6 +67,9 @@
<if test="isDefault != '' and isDefault != null"> <if test="isDefault != '' and isDefault != null">
AND isDefault = #{isDefault} AND isDefault = #{isDefault}
</if> </if>
<if test="thirdSysFk != null">
AND thirdSysFk = #{thirdSysFk}
</if>
</where> </where>
</select> </select>
@ -71,16 +77,16 @@
parameterType="com.glxp.sale.admin.entity.thrsys.ThrInvWarehouseEntity"> parameterType="com.glxp.sale.admin.entity.thrsys.ThrInvWarehouseEntity">
insert INTO thr_inv_warehouse insert INTO thr_inv_warehouse
(pid, code, name, advanceType, isDefault, (pid, code, name, advanceType, isDefault,
status, updateTime, remark) status, updateTime, remark,thirdSysFk)
values (#{pid}, #{code}, values (#{pid}, #{code},
#{name}, #{advanceType}, #{isDefault}, #{name}, #{advanceType}, #{isDefault},
#{status}, #{updateTime}, #{status}, #{updateTime},
#{remark}) #{remark},#{thirdSysFk})
</insert> </insert>
<insert id="insertThrInvWarehouses" parameterType="java.util.List"> <insert id="insertThrInvWarehouses" parameterType="java.util.List">
insert INTO thr_inv_warehouse insert INTO thr_inv_warehouse
(pid, code, name, advanceType, isDefault, (pid, code, name, advanceType, isDefault,
status, updateTime, remark) status, updateTime, remark,thirdSysFk)
VALUES VALUES
<foreach collection="thrInvWarehouseEntitys" item="item" index="index" <foreach collection="thrInvWarehouseEntitys" item="item" index="index"
separator=","> separator=",">
@ -88,7 +94,7 @@
#{item.pid}, #{item.code}, #{item.pid}, #{item.code},
#{item.name}, #{item.advanceType}, #{item.isDefault}, #{item.name}, #{item.advanceType}, #{item.isDefault},
#{item.status}, #{item.updateTime}, #{item.status}, #{item.updateTime},
#{item.remark}) #{item.remark},#{item.thirdSysFk})
</foreach> </foreach>
</insert> </insert>
@ -109,6 +115,7 @@
<if test="status != null">status=#{status},</if> <if test="status != null">status=#{status},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if> <if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="remark != null">remark=#{remark},</if> <if test="remark != null">remark=#{remark},</if>
<if test="thirdSysFk != null">thirdSysFk=#{thirdSysFk},</if>
</trim> </trim>
WHERE id = #{id} WHERE id = #{id}
</update> </update>
@ -146,6 +153,30 @@
<if test="level != null"> <if test="level != null">
AND `level` = #{level} AND `level` = #{level}
</if> </if>
<if test="thirdSysFk != null">
AND `thirdSysFk` = #{thirdSysFk}
</if>
</where> </where>
</select> </select>
<insert id="insertInvWarehouses">
replace into thr_inv_warehouse (pid, code, name, advanceType, isDefault, status, updateTime, remark, level,
pcode,
thirdSysFk)
values
<foreach collection="thrInvWarehouseEntitys" index="index" item="item" separator=",">
(#{item.pid},
#{item.code},
#{item.name},
#{item.advanceType},
#{item.isDefault},
#{item.status},
#{item.updateTime},
#{item.remark},
#{item.level},
#{item.pcode},
#{item.thirdSysFk})
</foreach>
</insert>
</mapper> </mapper>
Loading…
Cancel
Save