库存,单据新增往来仓库信息,仓库,货位字段等

master
anthonyywj2 3 years ago
parent 36f14e193a
commit b1f14b710a

@ -74,6 +74,12 @@ public class ConstantStatus {
public static final int CORP_INTTERNAL = 3; //内部科室等
//往来信息类型-单据
public static final int CORP_TYPE_INPUT = 2; //病人
public static final int CORP_TYPE_OUT = 0; //供应商
public static final int CORP_TYPE_INNOR = 1; //内部科室等
//单据来源
public static final int FROM_UDIMS = 1; //1.UDIMS平台
public static final int FROM_WEBNEW = 2; //网页新增
@ -90,4 +96,11 @@ public class ConstantStatus {
public static final int DITYPE_OWN = 3; //本体标识
public static final int DITYPE_PACK = 4; //包装标识
//流转单据类型
public static final int ORDER_CHANGE_NORMAL_IN = 1; //补采购入库
public static final int ORDER_CHANGE_NORMAL_ADV_IN = 2; //补寄售转入
public static final int ORDER_CHANGE_ADVANCE_IN = 3; //补寄售入库
public static final int ORDER_CHANGE_ADVANCE_OUT = 4; //补寄售出库
}

@ -1,6 +1,7 @@
package com.glxp.sale.admin.controller.basic;
import com.github.pagehelper.PageInfo;
import com.glxp.sale.admin.constant.ConstantStatus;
import com.glxp.sale.admin.constant.ConstantType;
import com.glxp.sale.admin.dao.basic.BussinessChangeTypeDao;
import com.glxp.sale.admin.entity.basic.BussinessChangeTypeEntity;
@ -57,26 +58,35 @@ public class BussinessChangeTypeController {
if (ConstantType.TYPE_PUT.equals(bussinessTypeEntity.getMainAction()) && !bussinessTypeEntity.isAdvanceType()) {
BussinessChangeTypeEntity bussinessChangeTypeEntity1 = new BussinessChangeTypeEntity();
bussinessChangeTypeEntity1.setIntro("入库自动补\"寄售出库单\"");
bussinessChangeTypeEntity1.setChangeType(ConstantStatus.ORDER_CHANGE_ADVANCE_OUT);
bussinessChangeTypeEntity1.setIndex(1);
bussinessChangeTypeEntity1.setAction(bussinessTypeFilterRequest.getAction());
bussinessChangeTypeService.insertBusChangeTypee(bussinessChangeTypeEntity1);
} else if (ConstantType.TYPE_OUT.equals(bussinessTypeEntity.getMainAction()) && !bussinessTypeEntity.isAdvanceType()) {
bussinessTypeEntities = bussinessChangeTypeService.findByAction(bussinessTypeFilterRequest.getAction());
} else if (ConstantType.TYPE_OUT.equals(bussinessTypeEntity.getMainAction()) && !bussinessTypeEntity.isAdvanceType()) {
BussinessChangeTypeEntity bussinessChangeTypeEntity1 = new BussinessChangeTypeEntity();
bussinessChangeTypeEntity1.setIntro("出库自动补\"采购入库单\"");
bussinessChangeTypeEntity1.setChangeType(ConstantStatus.ORDER_CHANGE_NORMAL_IN);
bussinessChangeTypeEntity1.setIndex(1);
bussinessChangeTypeEntity1.setAction(bussinessTypeFilterRequest.getAction());
bussinessChangeTypeService.insertBusChangeTypee(bussinessChangeTypeEntity1);
BussinessChangeTypeEntity bussinessChangeTypeEntity2 = new BussinessChangeTypeEntity();
bussinessChangeTypeEntity2.setIntro("出库自动补\"寄售转入单\"");
bussinessChangeTypeEntity1.setChangeType(ConstantStatus.ORDER_CHANGE_NORMAL_ADV_IN);
bussinessChangeTypeEntity2.setIndex(2);
bussinessChangeTypeEntity2.setAction(bussinessTypeFilterRequest.getAction());
bussinessChangeTypeService.insertBusChangeTypee(bussinessChangeTypeEntity2);
bussinessTypeEntities = bussinessChangeTypeService.findByAction(bussinessTypeFilterRequest.getAction());
} else if (ConstantType.TYPE_OUT.equals(bussinessTypeEntity.getMainAction()) && bussinessTypeEntity.isAdvanceType()) {
bussinessTypeEntities = bussinessChangeTypeService.findByAction(bussinessTypeFilterRequest.getAction());
BussinessChangeTypeEntity bussinessChangeTypeEntity1 = new BussinessChangeTypeEntity();
bussinessChangeTypeEntity1.setIntro("出库自动补\"寄售入库单\"");
bussinessChangeTypeEntity1.setChangeType(ConstantStatus.ORDER_CHANGE_ADVANCE_IN);
bussinessChangeTypeEntity1.setIndex(1);
bussinessChangeTypeEntity1.setAction(bussinessTypeFilterRequest.getAction());
bussinessChangeTypeService.insertBusChangeTypee(bussinessChangeTypeEntity1);
bussinessTypeEntities = bussinessChangeTypeService.findByAction(bussinessTypeFilterRequest.getAction());
}
}
}

@ -239,7 +239,7 @@ public class UdiRelevanceController {
UdiRelevanceEntity udiRelevanceEntity = new UdiRelevanceEntity();
if (udiInfoEntities == null || udiInfoEntities.isEmpty()) {
udiInfoEntities = udiDlHttpClient.getUdiByUuid(key);
if (udiInfoEntities != null) {
if (udiInfoEntities != null && !udiInfoEntities.isEmpty()) {
udiInfoService.insertUdiInfos(udiInfoEntities);
} else {
return ResultVOUtils.error(500, "连接UDI数据下载服务出错");

@ -187,6 +187,11 @@ public class StockOrderController {
stockOrderEntity.setCorpId(companyEntity.getUnitIdFk());
stockOrderEntity.setCorpName(companyEntity.getCompanyName());
stockOrderEntity.setUnitIdFk(companyEntity.getUnitIdFk());
} else {
stockOrderEntity.setCorpId(stockOrderPostRequest.getCorpId());
stockOrderEntity.setCorpName(stockOrderPostRequest.getCorpName());
stockOrderEntity.setUnitIdFk(stockOrderPostRequest.getUnitIdFk());
}
stockOrderEntity.setCustomerId(stockOrderPostRequest.getCustomerId());

@ -213,8 +213,8 @@ public class WareHouseController {
@GetMapping("warehouse/inout/submitOrderWeb")
public BaseResponse submitOrderWeb(AddOrderRequest orderEntity) {
orderService.updateOrderStatus(orderEntity.getOrderId(), ConstantStatus.ORDER_STATUS_PROCESS);
saveOrderWeb(orderEntity);
return ResultVOUtils.success();
return saveOrderWeb(orderEntity);
// return ResultVOUtils.success();
}
@ -225,6 +225,7 @@ public class WareHouseController {
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(addOrderRequest.getAction());
orderEntity1.setAction(addOrderRequest.getAction());
orderEntity1.setMainAction(bussinessTypeEntity.getMainAction());
orderEntity1.setLocStorageCode(addOrderRequest.getLocStorageCode());
orderService.updateOrder(orderEntity1);
return ResultVOUtils.success();
}
@ -272,6 +273,7 @@ public class WareHouseController {
orderSaveRequest.setAction(bussinessTypeEntity.getAction());
orderSaveRequest.setActor(addOrderRequest.getActor());
orderSaveRequest.setCorpOrderId(addOrderRequest.getCorpOrderId());
orderSaveRequest.setLocStorageCode(addOrderRequest.getLocStorageCode());
// orderSaveRequest.setFromCorpId(addOrderRequest.getFromCorpId());
// orderSaveRequest.setFromCorp(addOrderRequest.getFromCorp());
orderSaveRequest.setFromType(ConstantStatus.FROM_WEBNEW);
@ -311,6 +313,7 @@ public class WareHouseController {
warehouseEntity.setNameCode(udiEntity.getUdi());
warehouseEntity.setExpireDate(udiEntity.getExpireDate());
warehouseEntity.setSerialNo(udiEntity.getSerialNo());
warehouseEntity.setLocStorageCode(addOrderRequest.getLocStorageCode());
warehouseEntity.setCount(1);
List<WarehouseEntity> warehouseEntityList = new ArrayList<>();
warehouseEntityList.add(warehouseEntity);

@ -3,6 +3,7 @@ package com.glxp.sale.admin.controller.inventory;
import com.github.pagehelper.PageInfo;
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;
@ -13,6 +14,7 @@ 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.InvPreProductDetailService;
import com.glxp.sale.admin.service.inventory.InvPreProductService;
import com.glxp.sale.admin.service.inventory.InvProductDetailService;
@ -39,6 +41,8 @@ public class InvPreProductsController {
InvPreProductService invProductService;
@Resource
InvPreProductDetailService invProductDetailService;
@Resource
private CompanyService companyService;
@GetMapping("spms/pre/inv/products/filter")
public BaseResponse filterInvProduct(FilterInvProductRequest filterInvProductRequest) {
@ -46,6 +50,10 @@ public class InvPreProductsController {
if (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;

@ -5,6 +5,7 @@ import com.glxp.sale.admin.constant.Constant;
import com.glxp.sale.admin.constant.ConstantStatus;
import com.glxp.sale.admin.constant.ConstantType;
import com.glxp.sale.admin.entity.basic.UdiInfoEntity;
import com.glxp.sale.admin.entity.info.CompanyEntity;
import com.glxp.sale.admin.entity.inout.OrderEntity;
import com.glxp.sale.admin.entity.inventory.InvProductDetailEntity;
import com.glxp.sale.admin.entity.inventory.InvProductEntity;
@ -22,6 +23,7 @@ import com.glxp.sale.admin.res.inventory.InvProductResponse;
import com.glxp.sale.admin.res.inventory.InvProductStatResponse;
import com.glxp.sale.admin.service.basic.UdiInfoService;
import com.glxp.sale.admin.service.basic.UdiRelevanceService;
import com.glxp.sale.admin.service.info.CompanyService;
import com.glxp.sale.admin.service.inout.OrderService;
import com.glxp.sale.admin.service.inventory.InvProductDetailService;
import com.glxp.sale.admin.service.inventory.InvProductService;
@ -57,6 +59,8 @@ public class InvProductsController {
private UdiRelevanceService udiRelevanceService;
@Resource
private UdiInfoService udiInfoService;
@Resource
private CompanyService companyService;
@GetMapping("spms/inv/products/filter")
public BaseResponse filterInvProduct(FilterInvProductRequest filterInvProductRequest) {
@ -64,7 +68,12 @@ public class InvProductsController {
if (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);
}
// filterInvProductRequest.setGroupType("invStorageCode");
List<InvProductResponse> invProductResponses = invProductService.filterJoinInvProduct(filterInvProductRequest);
PageInfo<InvProductResponse> pageInfo;
pageInfo = new PageInfo<>(invProductResponses);
@ -81,6 +90,7 @@ public class InvProductsController {
if (SYSTEM_CUSTOMER_ID.equals(filterInvProductRequest.getCustomerId())) {
filterInvProductRequest.setCustomerId(null);
}
filterInvProductRequest.setSupId(null);
List<InvProductDetailEntity> invProductDetailEntities = invProductDetailService.filterInvProduct(filterInvProductRequest);
PageInfo<InvProductDetailEntity> pageInfo;
pageInfo = new PageInfo<>(invProductDetailEntities);

@ -50,6 +50,13 @@ public class InvWarehouseController {
return ResultVOUtils.success(restMap);
}
@GetMapping("spms/inv/warehouse/filterAll")
public BaseResponse filterAllInvWarehouse(FilterInvWarehouseRequest filterInvWarehouseRequest) {
filterInvWarehouseRequest.setPid(0);
List<InvWarehouseEntity> invWarehouseEntities = invWarehouseService.filterInvWarehouse(filterInvWarehouseRequest);
return ResultVOUtils.success(invWarehouseEntities);
}
public List<InvWarehouseResponse> merge(List<InvWarehouseEntity> invWarehouseEntities,
Integer pid) {
List<InvWarehouseResponse> invWarehouseResponses = new ArrayList<>();

@ -20,6 +20,10 @@ public interface InvPreProductDao {
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);
boolean deleteById(@Param("id") String id);

@ -20,7 +20,12 @@ public interface InvProductDao {
boolean updateInvProduct(InvProductEntity invProductEntity);
InvProductEntity selectById(@Param("id") String id);
InvProductEntity selectById(@Param("id") String id);
InvProductEntity selectByUuid(@Param("relIdFk") String relIdFk, @Param("batchNo") String batchNo,
@Param("supId") String supId, @Param("invStorageCode") String invStorageCode,
@Param("invWarehouseCode") String invWarehouseCode);
boolean deleteById(@Param("id") String id);

@ -14,6 +14,7 @@ public class BussinessChangeTypeEntity {
private Integer beforeTime;
private String remark;
private String name;
private Integer changeType;
public Integer getBeforeTime() {

@ -13,7 +13,7 @@ public class BussinessTypeEntity {
private String thirdSysFk;
private String localAction;
private String localName;
private Boolean checkEnable;
private boolean checkEnable;
private boolean advanceType;
private boolean genUnit;
private boolean innerOrder;
@ -35,5 +35,7 @@ public class BussinessTypeEntity {
private boolean secCheckWebNew;
private boolean secCheckChange;
private int corpType;
}

@ -33,6 +33,6 @@ public class OrderEntity {
private Integer dlCount;
private String invStorageCode;
private String invWarehouseCode;
private String locStorageCode;
}

@ -27,4 +27,5 @@ public class StockOrderEntity {
private String thirdOrderFk;
private String orderIdFk;
private BigDecimal totalPrice;
private String locStorageCode;
}

@ -29,12 +29,13 @@ public class WarehouseEntity {
private String invWarehouseCode;
private String relId;
private Integer status;
private String locStorageCode;
public String getSupId() {
if (supId == null) {
return fromCorpId;
}
// if (supId == null) {
// return fromCorpId;
// }
return supId;
}
}

@ -17,7 +17,7 @@ public class AddOrderRequest {
private Integer fromType;
private String actDate;
private String billType;
private String locStorageCode;
private String orderId;
private String customerId;
}

@ -22,8 +22,9 @@ public class StockOrderPostRequest {
private String type;
private String sourceType;
private String printStatus;
private String locStorageCode;
private BigDecimal price;
private String unitIdFk;
private List<StockOrderDetailEntity> subErpOrders;
private String customerId;
}

@ -26,4 +26,5 @@ public class WarehouseSaveRequest {
private String customerId;
private String nameCode;
private String locStorageCode;
}

@ -23,4 +23,8 @@ public class FilterInvProductDetailRequest extends ListPageRequest {
private String supId;
private String originCode;
private String invStorageCode;
private String invWarehouseCode;
}

@ -22,4 +22,6 @@ public class FilterInvProductRequest extends ListPageRequest {
private String unitFk;
private String invStorageCode;
private String invWarehouseCode;
private String groupType;
}

@ -20,7 +20,7 @@ public class BussinessTypResponse {
private Boolean advanceType; //是否预入库
private Boolean changeEnable;
private Boolean genUnit;
private Boolean innerOrder;
// private Boolean innerOrder;
private Boolean spUse;
private String localName;
private Boolean secCheckEnable;
@ -39,5 +39,5 @@ public class BussinessTypResponse {
private boolean secCheckPc;
private boolean secCheckWebNew;
private boolean secCheckChange;
private int corpType;
}

@ -21,6 +21,7 @@ public class InvProductResponse {
private String companyName;
private String supId;
private String unitFk;
private String invStorageName;
public Integer getInCount() {
if (inCount == null)

@ -12,7 +12,7 @@ public interface InvPreProductService {
List<InvProductResponse> filterJoinInvProduct(FilterInvProductRequest filterInvProductRequest);
InvProductEntity selectByUuid(String uuid, String batchNo,String supId);
InvProductEntity selectByUuid(String uuid, String batchNo, String supId, String invStorageCode, String invWarehouseCode);
InvProductEntity selectById(String id);

@ -10,6 +10,7 @@ import java.util.List;
public interface InvProductDetailService {
List<InvProductDetailEntity> findByCode(String code);
List<InvProductDetailEntity> filterInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest);

@ -13,7 +13,7 @@ public interface InvProductService {
List<InvProductResponse> filterJoinInvProduct(FilterInvProductRequest filterInvProductRequest);
InvProductEntity selectByUuid(String uuid, String batchNo,String supId);
InvProductEntity selectByUuid(String uuid, String batchNo, String supId, String invStorageCode, String invWarehouseCode);
InvProductEntity selectById(String id);

@ -8,6 +8,9 @@ import java.util.List;
public interface InvWarehouseService {
InvWarehouseEntity findDefault(Boolean advaceType, Boolean isDefault);
List<InvWarehouseEntity> filterInvWarehouse(FilterInvWarehouseRequest filterInvWarehouseRequest);
List<InvWarehouseEntity> filterGroupInvWarehouse(FilterInvWarehouseRequest filterInvWarehouseRequest);
@ -18,6 +21,8 @@ public interface InvWarehouseService {
InvWarehouseEntity selectById(String id);
InvWarehouseEntity selectByCode(String code);
boolean deleteById(String id);
}

@ -49,16 +49,21 @@ public class InvPreProductServiceImpl implements InvPreProductService {
}
@Override
public InvProductEntity selectByUuid(String uuid, String batchNo, String supId) {
FilterInvProductRequest filterInvProductRequest = new FilterInvProductRequest();
filterInvProductRequest.setRelIdFk(uuid);
filterInvProductRequest.setBatchNo(batchNo);
filterInvProductRequest.setSupId(supId);
List<InvProductEntity> data = filterInvProduct(filterInvProductRequest);
if (data != null && data.size() > 0) {
return data.get(0);
}
return null;
public InvProductEntity selectByUuid(String uuid, String batchNo, String supId, String invStorageCode, String invWarehouseCode) {
return invPreProductDao.selectByUuid(uuid, batchNo, supId, invStorageCode, invWarehouseCode);
// FilterInvProductRequest filterInvProductRequest = new FilterInvProductRequest();
// filterInvProductRequest.setRelIdFk(uuid);
// filterInvProductRequest.setBatchNo(batchNo);
// filterInvProductRequest.setSupId(supId);
// filterInvProductRequest.setInvWarehouseCode(invWarehouseCode);
// filterInvProductRequest.setInvStorageCode(invStorageCode);
// List<InvProductEntity> data = filterInvProduct(filterInvProductRequest);
// if (data != null && data.size() > 0) {
// return data.get(0);
// }
// return null;
}
@Override

@ -19,6 +19,14 @@ public class InvProductDetailServiceImpl implements InvProductDetailService {
@Resource
InvProductDetailDao invProductDetailDao;
@Override
public List<InvProductDetailEntity> findByCode(String code) {
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
filterInvProductDetailRequest.setCode(code);
List<InvProductDetailEntity> invProductDetailEntities = invProductDetailDao.filterInvProductDetail(filterInvProductDetailRequest);
return invProductDetailEntities;
}
@Override
public List<InvProductDetailEntity> filterInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest) {
if (filterInvProductDetailRequest == null) {

@ -45,16 +45,19 @@ public class InvProductServiceImpl implements InvProductService {
}
@Override
public InvProductEntity selectByUuid(String uuid, String batchNo, String customerId) {
FilterInvProductRequest filterInvProductRequest = new FilterInvProductRequest();
filterInvProductRequest.setRelIdFk(uuid);
filterInvProductRequest.setBatchNo(batchNo);
filterInvProductRequest.setSupId(customerId);
List<InvProductEntity> data = filterInvProduct(filterInvProductRequest);
if (data != null && data.size() > 0) {
return data.get(0);
}
return null;
public InvProductEntity selectByUuid(String uuid, String batchNo, String supId, String invStorageCode, String invWarehouseCode) {
// FilterInvProductRequest filterInvProductRequest = new FilterInvProductRequest();
// filterInvProductRequest.setRelIdFk(uuid);
// filterInvProductRequest.setBatchNo(batchNo);
// filterInvProductRequest.setSupId(supId);
// filterInvProductRequest.setInvWarehouseCode(invWarehouseCode);
// filterInvProductRequest.setInvStorageCode(invStorageCode);
// List<InvProductEntity> data = filterInvProduct(filterInvProductRequest);
// if (data != null && data.size() > 0) {
// return data.get(0);
// }
// return null;
return invProductDao.selectByUuid(uuid, batchNo, supId, invStorageCode, invWarehouseCode);
}
@Override

@ -20,6 +20,18 @@ public class InvWarehouseServiceImpl implements InvWarehouseService {
@Resource
InvWarehouseDao invWarehouseDao;
@Override
public InvWarehouseEntity findDefault(Boolean advaceType, Boolean isDefault) {
FilterInvWarehouseRequest filterInvWarehouseRequest = new FilterInvWarehouseRequest();
filterInvWarehouseRequest.setIsDefault(isDefault);
filterInvWarehouseRequest.setAdvanceType(advaceType);
List<InvWarehouseEntity> invWarehouseEntities = invWarehouseDao.filterInvWarehouse(filterInvWarehouseRequest);
if (invWarehouseEntities != null && invWarehouseEntities.size() > 0)
return invWarehouseEntities.get(0);
return null;
}
@Override
public List<InvWarehouseEntity> filterInvWarehouse(FilterInvWarehouseRequest filterInvWarehouseRequest) {
if (filterInvWarehouseRequest == null) {
@ -61,6 +73,16 @@ public class InvWarehouseServiceImpl implements InvWarehouseService {
return invWarehouseDao.selectById(id);
}
@Override
public InvWarehouseEntity selectByCode(String code) {
FilterInvWarehouseRequest filterInvWarehouseRequest = new FilterInvWarehouseRequest();
filterInvWarehouseRequest.setCode(code);
List<InvWarehouseEntity> invWarehouseEntities = invWarehouseDao.filterInvWarehouse(filterInvWarehouseRequest);
if (invWarehouseEntities != null && invWarehouseEntities.size() > 0)
return invWarehouseEntities.get(0);
return null;
}
@Override
public boolean deleteById(String id) {
return invWarehouseDao.deleteById(id);

@ -8,7 +8,9 @@ import com.glxp.sale.admin.entity.info.CompanyEntity;
import com.glxp.sale.admin.entity.inout.*;
import com.glxp.sale.admin.entity.inventory.InvProductDetailEntity;
import com.glxp.sale.admin.entity.inventory.InvProductEntity;
import com.glxp.sale.admin.entity.inventory.InvWarehouseEntity;
import com.glxp.sale.admin.entity.param.SystemParamConfigEntity;
import com.glxp.sale.admin.entity.udid.UdiEntity;
import com.glxp.sale.admin.req.basic.FilterUdiInfoRequest;
import com.glxp.sale.admin.req.inventory.FilterInvProductDetailRequest;
import com.glxp.sale.admin.res.basic.BussinessTypResponse;
@ -17,10 +19,7 @@ import com.glxp.sale.admin.res.inventory.InvProductDetailJoinResponse;
import com.glxp.sale.admin.service.basic.*;
import com.glxp.sale.admin.service.info.CompanyService;
import com.glxp.sale.admin.service.inout.*;
import com.glxp.sale.admin.service.inventory.InvPreProductDetailService;
import com.glxp.sale.admin.service.inventory.InvPreProductService;
import com.glxp.sale.admin.service.inventory.InvProductDetailService;
import com.glxp.sale.admin.service.inventory.InvProductService;
import com.glxp.sale.admin.service.inventory.*;
import com.glxp.sale.admin.service.param.SystemParamConfigService;
import com.glxp.sale.admin.util.CustomUtil;
import com.glxp.sale.admin.util.DateUtil;
@ -78,6 +77,8 @@ public class InvProductsTrService {
SystemParamConfigService systemParamConfigService;
@Resource
IOOrderStatusService ioOrderStatusService;
@Resource
InvWarehouseService invWarehouseService;
@Async
public void genInvProducts(String orderId) {
@ -106,7 +107,8 @@ public class InvProductsTrService {
ErpOrderEntity erpOrderEntity = getErpOrders(warehouseEntity, erpOrderEntities);
if (bussinessTypeEntity.isAdvanceType()) {//预入库,则转存预入库
InvProductEntity invPreProductEntity =
invPreProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo(), warehouseEntity.getSupId());
invPreProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo(), warehouseEntity.getSupId()
, warehouseEntity.getInvStorageCode(), warehouseEntity.getInvWarehouseCode());
if (invPreProductEntity == null) {
invPreProductEntity = buildInvProduct(erpOrderEntity.getGoodsid(), erpOrderEntity, orderEntity, warehouseEntity);
invPreProductService.insertInvProduct(invPreProductEntity);
@ -121,7 +123,8 @@ public class InvProductsTrService {
invPreProductService.updateInvProduct(invPreProductEntity);
}
} else { //普通出入库
InvProductEntity invProductEntity = invProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo(), warehouseEntity.getSupId());
InvProductEntity invProductEntity = invProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo(),
warehouseEntity.getSupId(), warehouseEntity.getInvStorageCode(), warehouseEntity.getInvWarehouseCode());
if (invProductEntity == null) {
invProductEntity = buildInvProduct(erpOrderEntity.getGoodsid(), erpOrderEntity, orderEntity, warehouseEntity);
invProductEntity.setUnitFk(orderEntity.getFromCorpId());
@ -168,24 +171,29 @@ public class InvProductsTrService {
}
//单据流转
BussinessChangeTypeEntity bussinessChangeTypeEntity = bussinessChangeTypeService.findFirstByAction(bussinessLocalTypeEntity.getLocalAction());
if (bussinessLocalTypeEntity.getChangeEnable() && bussinessChangeTypeEntity != null) {
List<BussinessChangeTypeEntity> bussinessChangeTypeEntitys = bussinessChangeTypeService.findByAction(bussinessLocalTypeEntity.getLocalAction());
if ((bussinessChangeTypeEntitys != null && bussinessChangeTypeEntitys.size() > 0) && bussinessLocalTypeEntity.getChangeEnable()) {
//普通出库
if (ConstantType.TYPE_OUT.equals(bussinessTypeEntity.getMainAction()) && !bussinessTypeEntity.isAdvanceType()) {
List<WarehouseEntity> datas = addOutOrder(orderEntity, mInvProductDetailEntities);//1.先计算现有库存,
// insetInv(bussinessTypeEntity.isAdvanceType(), mInvProductDetailEntities);//2.插入当前库存
List<WarehouseEntity> temps = filterMapCodes(datas);
buildInOrder(bussinessChangeTypeEntity, temps, orderEntity); //3.生成流转单据
//补采购入库或寄售转入单
// List<WarehouseEntity> datas = addOutOrder(orderEntity, mInvProductDetailEntities);//1.先计算现有库存,
// List<WarehouseEntity> temps = filterMapCodes(datas);
addUseOutOrder(orderEntity, mInvProductDetailEntities, bussinessChangeTypeEntitys);
} else if (ConstantType.TYPE_PUT.equals(bussinessTypeEntity.getMainAction()) && !bussinessTypeEntity.isAdvanceType())
//普通入库补单
{
BussinessChangeTypeEntity bussinessChangeTypeEntity = bussinessChangeTypeEntitys.get(0);
List<WarehouseEntity> datas = addPutOrder(orderEntity, mInvProductDetailEntities);
List<WarehouseEntity> temps = filterMapCodes(datas);
// insetInv(bussinessTypeEntity.isAdvanceType(), mInvProductDetailEntities);//2.插入当前库存
buildPreOutOrder(bussinessChangeTypeEntity, temps, orderEntity); //3.生成流转单据
} else if (ConstantType.TYPE_OUT.equals(bussinessTypeEntity.getMainAction()) && bussinessTypeEntity.isAdvanceType()) {
//寄售出库补单
BussinessChangeTypeEntity bussinessChangeTypeEntity = bussinessChangeTypeEntitys.get(0);
List<WarehouseEntity> datas = addPreOutOrder(orderEntity, mInvProductDetailEntities);
List<WarehouseEntity> temps = filterMapCodes(datas);
// insetInv(bussinessTypeEntity.isAdvanceType(), mInvProductDetailEntities);//2.插入当前库存
@ -199,34 +207,136 @@ public class InvProductsTrService {
}
//普通出库补单
public List<WarehouseEntity> addOutOrder(OrderEntity orderEntity, List<InvProductDetailEntity> invProductDetailEntities) {
//普通出库补单-- //补采购入库或寄售转入单
public void addUseOutOrder(OrderEntity orderEntity, List<InvProductDetailEntity> invProductDetailEntities, List<BussinessChangeTypeEntity> bussinessChangeTypeEntities) {
List<WarehouseEntity> warehouseEntities = codesService.findByReceiptId(orderEntity.getId());
List<WarehouseEntity> inList = new ArrayList<>();
List<WarehouseEntity> preiInList = new ArrayList<>();
for (WarehouseEntity warehouseEntity : warehouseEntities) {
if (isAdavnce(warehouseEntity)) {//补寄售转入
//获取普通出入库结余数量
int actCount = getActCount(warehouseEntity);
int count = 0;
UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity);
String code = warehouseEntity.getCode();
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 = getCountByOrder(null, warehouseEntity.getCode(), warehouseEntity.getSupId());
if (invCount <= 0) {
invCount = getCountByOrder(null, code, warehouseEntity.getSupId());
}
if (invCount > 0) {
if (count > invCount) {
int lea = count - invCount;
warehouseEntity.setCount(lea / (getActCount(warehouseEntity)));
preiInList.add(warehouseEntity);
}
} else {
warehouseEntity.setCount(count);
preiInList.add(warehouseEntity);
}
InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode());
insetInvSingle(false, invProductDetailEntity);
warehouseEntity.setCode(code);
} else {
//获取普通出入库结余数量
int actCount = getActCount(warehouseEntity);
int count = 0;
UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity);
String code = warehouseEntity.getCode();
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 = getCountByOrder(null, warehouseEntity.getCode(), warehouseEntity.getSupId());
if (invCount <= 0) {
invCount = getCountByOrder(null, code, warehouseEntity.getSupId());
}
if (invCount > 0) {
if (count > invCount) {
int lea = count - invCount;
warehouseEntity.setCount(lea / getActCount(warehouseEntity));
inList.add(warehouseEntity);
}
} else {
warehouseEntity.setCount(count);
inList.add(warehouseEntity);
}
InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode());
insetInvSingle(false, invProductDetailEntity);
warehouseEntity.setCode(code);
}
}
BussinessChangeTypeEntity advChangeTypeEntity = null;
BussinessChangeTypeEntity norChangeTypeEntity = null;
for (BussinessChangeTypeEntity bussinessChangeTypeEntity : bussinessChangeTypeEntities) {
if (bussinessChangeTypeEntity.getChangeType() == ConstantStatus.ORDER_CHANGE_NORMAL_ADV_IN) {
advChangeTypeEntity = bussinessChangeTypeEntity;
} else if (bussinessChangeTypeEntity.getChangeType() == ConstantStatus.ORDER_CHANGE_NORMAL_IN) {
norChangeTypeEntity = bussinessChangeTypeEntity;
}
}
if (inList.size() > 0) {
List<WarehouseEntity> temps = filterMapCodes(inList);
buildInOrder(norChangeTypeEntity, temps, orderEntity); //3.生成采购入库流转单据
}
if (preiInList.size() > 0) {
List<WarehouseEntity> temps1 = filterMapCodes(preiInList);
buildNorPreInOrder(advChangeTypeEntity, temps1, orderEntity); //3.补寄售转入
}
}
public List<WarehouseEntity> addOutOrder(OrderEntity
orderEntity, List<InvProductDetailEntity> invProductDetailEntities) {
List<WarehouseEntity> warehouseEntities = codesService.findByReceiptId(orderEntity.getId());
List<WarehouseEntity> inList = new ArrayList<>();
for (WarehouseEntity warehouseEntity : warehouseEntities) {
//获取普通出入库结余数量
int actCount = getActCount(warehouseEntity);
int count = 0;
UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity);
String code = warehouseEntity.getCode();
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);
// warehouseEntity.setCode(code);
// warehouseEntity.setCount(actCount * warehouseEntity.getCount());
count = actCount * warehouseEntity.getCount();
} else {
count = warehouseEntity.getCount();
}
int invCount = getCountByOrder(null, warehouseEntity.getCode(), warehouseEntity.getSupId());
if (invCount <= 0) {
invCount = getCountByOrder(null, code, warehouseEntity.getSupId());
}
if (invCount > 0) {
int count = actCount * warehouseEntity.getCount();
if (count > invCount) {
int lea = count - invCount;
warehouseEntity.setCount(lea / (getActCount(warehouseEntity)));
warehouseEntity.setCount(lea / actCount);
inList.add(warehouseEntity);
}
} else {
warehouseEntity.setCount(count);
inList.add(warehouseEntity);
}
InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode());
@ -237,21 +347,12 @@ public class InvProductsTrService {
}
//普通入库补单
public List<WarehouseEntity> addPutOrder(OrderEntity orderEntity, List<InvProductDetailEntity> invProductDetailEntities) {
public List<WarehouseEntity> addPutOrder(OrderEntity
orderEntity, List<InvProductDetailEntity> invProductDetailEntities) {
List<WarehouseEntity> warehouseEntities = codesService.findByReceiptId(orderEntity.getId());
List<WarehouseEntity> preOutList = new ArrayList<>();
for (WarehouseEntity warehouseEntity : warehouseEntities) {
//获取普通出入库结余数量
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
// filterInvProductDetailRequest.setCode(warehouseEntity.getCode());
filterInvProductDetailRequest.setProductIdFk(warehouseEntity.getRelId());
filterInvProductDetailRequest.setSupId(warehouseEntity.getSupId());
List<InvProductDetailJoinResponse> detailJoinResponseList
= invPreProductDetailService.filterJoinInvProduct(filterInvProductDetailRequest);
UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(warehouseEntity.getRelId());
if ((detailJoinResponseList != null && detailJoinResponseList.size() > 0)
|| (udiRelevanceEntity.getIsAdavence() != null && udiRelevanceEntity.getIsAdavence())
) {
if (isAdavnce(warehouseEntity)) {
preOutList.add(warehouseEntity);
}
InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode());
@ -261,21 +362,24 @@ public class InvProductsTrService {
}
//寄售出库补单
public List<WarehouseEntity> addPreOutOrder(OrderEntity orderEntity, List<InvProductDetailEntity> invProductDetailEntities) {
public List<WarehouseEntity> addPreOutOrder(OrderEntity
orderEntity, List<InvProductDetailEntity> invProductDetailEntities) {
List<WarehouseEntity> warehouseEntities = codesService.findByReceiptId(orderEntity.getId());
List<WarehouseEntity> prePutList = new ArrayList<>();
for (WarehouseEntity warehouseEntity : warehouseEntities) {
// int actCount = getActCount(warehouseEntity);
int actCount = getActCount(warehouseEntity);
int count = 0;
String code = warehouseEntity.getCode();
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);
// warehouseEntity.setCode(code);
// warehouseEntity.setCount(actCount * warehouseEntity.getCount());
count = actCount * warehouseEntity.getCount();
} else {
count = warehouseEntity.getCount();
}
//获取寄售出入库结余数量
int invCount = getPreCountByOrder(null, warehouseEntity.getCode(), warehouseEntity.getSupId());
@ -283,13 +387,13 @@ public class InvProductsTrService {
invCount = getPreCountByOrder(null, code, warehouseEntity.getSupId());
}
if (invCount > 0) {
int count = getActCount(warehouseEntity) * warehouseEntity.getCount();
if (count > invCount) {
int lea = count - invCount;
warehouseEntity.setCount(lea / (getActCount(warehouseEntity)));
warehouseEntity.setCount(lea / (getActCount(warehouseEntity.getCode())));
prePutList.add(warehouseEntity);
}
} else {
warehouseEntity.setCount(count);
prePutList.add(warehouseEntity);
}
InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode());
@ -320,6 +424,8 @@ public class InvProductsTrService {
if (preOutList == null || preOutList.size() <= 0) {
return;
}
InvWarehouseEntity invWarehouseEntity = invWarehouseService.selectByCode(orderEntity.getLocStorageCode());
InvWarehouseEntity defaultWarehouseEntity = invWarehouseService.findDefault(true, true);
//寄售出库生成单据
CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(Constant.SYSTEM_CUSTOMER_ID));
OrderEntity outOrder = new OrderEntity();
@ -338,14 +444,18 @@ public class InvProductsTrService {
outOrder.setErpFk(null);
outOrder.setCustomerId(Constant.SYSTEM_CUSTOMER_ID);
outOrder.setId(CustomUtil.getId());
outOrder.setFromCorp(companyEntity.getCompanyName());
outOrder.setFromCorpId(companyEntity.getUnitIdFk());
outOrder.setFromCorp(invWarehouseEntity.getName());
outOrder.setFromCorpId(invWarehouseEntity.getCode());
outOrder.setLocStorageCode(defaultWarehouseEntity.getCode());
// outOrder.setFromCorp(companyEntity.getCompanyName());
// outOrder.setFromCorpId(companyEntity.getUnitIdFk());
orderService.insertOrder(outOrder);
for (WarehouseEntity warehouseEntity : preOutList) {
warehouseEntity.setOrderId(outOrder.getId());
warehouseEntity.setFromCorp(orderEntity.getFromCorp());
warehouseEntity.setFromCorpId(orderEntity.getFromCorpId());
warehouseEntity.setFromCorp(invWarehouseEntity.getName());
warehouseEntity.setFromCorpId(invWarehouseEntity.getCode());
warehouseEntity.setId(null);
warehouseEntity.setLocStorageCode(defaultWarehouseEntity.getCode());
warehouseEntity.setAction(bussinessChangeTypeEntity.getScAction());
warehouseEntity.setMainAction(ConstantType.TYPE_OUT);
}
@ -402,12 +512,14 @@ public class InvProductsTrService {
BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByErpId(corpName);
outOrder.setFromCorp(basicUnitMaintainEntity.getName());
outOrder.setFromCorpId(corpName);
outOrder.setLocStorageCode(orderEntity.getLocStorageCode());
orderService.insertOrder(outOrder);
for (WarehouseEntity warehouseEntity : temps) {
warehouseEntity.setOrderId(outOrder.getId());
warehouseEntity.setId(null);
warehouseEntity.setFromCorp(outOrder.getFromCorp());
warehouseEntity.setFromCorpId(outOrder.getFromCorpId());
warehouseEntity.setLocStorageCode(outOrder.getLocStorageCode());
warehouseEntity.setAction(bussinessChangeTypeEntity.getScAction());
warehouseEntity.setMainAction(ConstantType.TYPE_PUT);
}
@ -437,6 +549,7 @@ public class InvProductsTrService {
outOrder.setFromCorp(null);
outOrder.setCustomerId(Constant.SYSTEM_CUSTOMER_ID);
outOrder.setFromCorpId(null);
outOrder.setLocStorageCode(orderEntity.getLocStorageCode());
orderService.insertOrder(outOrder);
warehouseEntity.setOrderId(outOrder.getId());
warehouseEntity.setId(null);
@ -444,6 +557,7 @@ public class InvProductsTrService {
warehouseEntity.setMainAction(ConstantType.TYPE_PUT);
warehouseEntity.setFromCorp(null);
warehouseEntity.setFromCorpId(null);
warehouseEntity.setLocStorageCode(outOrder.getLocStorageCode());
codesTempService.insertCodesTempSingle(warehouseEntity);
}
@ -459,7 +573,7 @@ public class InvProductsTrService {
//采购入库生成单据
Map<String, List<WarehouseEntity>> filterSupMaps = new HashMap<>();
List<WarehouseEntity> unkonwCorpList = new ArrayList<>();
// InvWarehouseEntity invWarehouseEntity = invWarehouseService.findDefault(false, true);
//根据库存,过滤供应商,条码分组
for (WarehouseEntity warehouseEntity : useInList) {
if (warehouseEntity.getSupId() != null) {
@ -491,6 +605,7 @@ public class InvProductsTrService {
BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByErpId(corpName);
outOrder.setFromCorp(basicUnitMaintainEntity.getName());
outOrder.setFromCorpId(corpName);
outOrder.setLocStorageCode(orderEntity.getLocStorageCode());
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("additional_auto_submit");
if ("1".equals(systemParamConfigEntity.getParamValue())) {
outOrder.setStatus(ConstantStatus.ORDER_STATUS_PROCESS);
@ -504,6 +619,7 @@ public class InvProductsTrService {
warehouseEntity.setId(null);
warehouseEntity.setFromCorp(outOrder.getFromCorp());
warehouseEntity.setFromCorpId(outOrder.getFromCorpId());
warehouseEntity.setLocStorageCode(outOrder.getLocStorageCode());
warehouseEntity.setAction(bussinessChangeTypeEntity.getScAction());
warehouseEntity.setMainAction(ConstantType.TYPE_PUT);
}
@ -531,6 +647,7 @@ public class InvProductsTrService {
outOrder.setErpFk(null);
outOrder.setId(CustomUtil.getId());
outOrder.setFromCorp(null);
outOrder.setLocStorageCode(orderEntity.getLocStorageCode());
outOrder.setFromCorpId(null);
orderService.insertOrder(outOrder);
warehouseEntity.setOrderId(outOrder.getId());
@ -539,6 +656,109 @@ public class InvProductsTrService {
warehouseEntity.setMainAction(ConstantType.TYPE_PUT);
warehouseEntity.setFromCorp(null);
warehouseEntity.setFromCorpId(null);
warehouseEntity.setLocStorageCode(outOrder.getLocStorageCode());
codesTempService.insertCodesTempSingle(warehouseEntity);
}
}
//生成寄售转入单据
public void buildNorPreInOrder(BussinessChangeTypeEntity
bussinessChangeTypeEntity, List<WarehouseEntity> useInList, OrderEntity orderEntity) {
if (useInList.size() <= 0) {
return;
}
//采购入库生成单据
Map<String, List<WarehouseEntity>> filterSupMaps = new HashMap<>();
List<WarehouseEntity> unkonwCorpList = new ArrayList<>();
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findDefault(true, true);
//根据库存,过滤供应商,条码分组
for (WarehouseEntity warehouseEntity : useInList) {
if (warehouseEntity.getSupId() != null) {
if (filterSupMaps.get(warehouseEntity.getSupId()) == null) {
List<WarehouseEntity> temps = new ArrayList<>();
temps.add(warehouseEntity);
filterSupMaps.put(warehouseEntity.getSupId(), temps);
} else {
filterSupMaps.get(warehouseEntity.getSupId()).add(warehouseEntity);
}
} else
unkonwCorpList.add(warehouseEntity);
}
//有供应商生成采购入库单据
for (String corpName : filterSupMaps.keySet()) {
List<WarehouseEntity> temps;
temps = filterSupMaps.get(corpName);
OrderEntity outOrder = new OrderEntity();
BeanUtils.copyProperties(orderEntity, outOrder);
outOrder.setActDate(DateUtil.getBeforeDay(outOrder.getActDate(), bussinessChangeTypeEntity.getBeforeTime()));
outOrder.setAction(bussinessChangeTypeEntity.getScAction());
outOrder.setMainAction(ConstantType.TYPE_PUT);
outOrder.setContrastStatus(ConstantStatus.ORDER_CHECK_UN);
outOrder.setCustomerId(Constant.SYSTEM_CUSTOMER_ID);
outOrder.setFromCorp(invWarehouseEntity.getName());
outOrder.setFromCorpId(invWarehouseEntity.getCode());
outOrder.setLocStorageCode(orderEntity.getLocStorageCode());
outOrder.setErpFk(null);
outOrder.setFromType(ConstantStatus.FROM_CHANGE);
outOrder.setId(CustomUtil.getId());
// BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByErpId(corpName);
// outOrder.setFromCorp(basicUnitMaintainEntity.getName());
// outOrder.setFromCorpId(corpName);
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("additional_auto_submit");
if ("1".equals(systemParamConfigEntity.getParamValue())) {
outOrder.setStatus(ConstantStatus.ORDER_STATUS_PROCESS);
} else {
outOrder.setStatus(ConstantStatus.ORDER_STATUS_ADDITIONAL);
}
orderService.insertOrder(outOrder);
for (WarehouseEntity warehouseEntity : temps) {
warehouseEntity.setOrderId(outOrder.getId());
warehouseEntity.setId(null);
warehouseEntity.setFromCorp(outOrder.getFromCorp());
warehouseEntity.setFromCorpId(outOrder.getFromCorpId());
warehouseEntity.setLocStorageCode(outOrder.getLocStorageCode());
warehouseEntity.setAction(bussinessChangeTypeEntity.getScAction());
warehouseEntity.setMainAction(ConstantType.TYPE_PUT);
}
codesTempService.insertCodesTemp(temps);
// ioTransInoutService.transInout(outOrder.getId());
}
//无供应商,一个条码生成一个错误单据,到时候利用单据合并生成同一个单据
for (WarehouseEntity warehouseEntity : unkonwCorpList) {
OrderEntity outOrder = new OrderEntity();
BeanUtils.copyProperties(orderEntity, outOrder);
outOrder.setActDate(DateUtil.getBeforeDay(outOrder.getActDate(), bussinessChangeTypeEntity.getBeforeTime()));
outOrder.setAction(bussinessChangeTypeEntity.getScAction());
outOrder.setMainAction(ConstantType.TYPE_PUT);
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("additional_auto_submit");
if ("1".equals(systemParamConfigEntity.getParamValue())) {
outOrder.setStatus(ConstantStatus.ORDER_STATUS_PROCESS);
} else {
outOrder.setStatus(ConstantStatus.ORDER_STATUS_ADDITIONAL);
}
outOrder.setContrastStatus(ConstantStatus.ORDER_CHECK_UN);
outOrder.setRemark("未选择供应商");
outOrder.setErpFk(null);
outOrder.setId(CustomUtil.getId());
outOrder.setFromCorp(invWarehouseEntity.getName());
outOrder.setFromCorpId(invWarehouseEntity.getCode());
outOrder.setLocStorageCode(orderEntity.getLocStorageCode());
orderService.insertOrder(outOrder);
warehouseEntity.setOrderId(outOrder.getId());
warehouseEntity.setId(null);
warehouseEntity.setAction(bussinessChangeTypeEntity.getScAction());
warehouseEntity.setMainAction(ConstantType.TYPE_PUT);
warehouseEntity.setFromCorp(outOrder.getFromCorp());
warehouseEntity.setFromCorpId(outOrder.getFromCorpId());
warehouseEntity.setLocStorageCode(outOrder.getLocStorageCode());
codesTempService.insertCodesTempSingle(warehouseEntity);
}
@ -547,7 +767,8 @@ public class InvProductsTrService {
//生成库存
private InvProductEntity buildInvProduct(String relId, ErpOrderEntity erpOrderEntity, OrderEntity orderEntity, WarehouseEntity warehouseEntity) {
private InvProductEntity buildInvProduct(String relId, ErpOrderEntity erpOrderEntity, OrderEntity
orderEntity, WarehouseEntity warehouseEntity) {
InvProductEntity invProductEntity = new InvProductEntity();
invProductEntity.setRelIdFk(relId);
invProductEntity.setBatchNo(erpOrderEntity.getBatchNo());
@ -560,6 +781,8 @@ public class InvProductsTrService {
invProductEntity.setProductsName(erpOrderEntity.getCoName());
invProductEntity.setYlqxzcrbarmc(erpOrderEntity.getProductCompany());
invProductEntity.setZczbhhzbapzbh(erpOrderEntity.getAuthCode());
invProductEntity.setInvStorageCode(warehouseEntity.getInvStorageCode());
invProductEntity.setInvWarehouseCode(warehouseEntity.getInvWarehouseCode());
int count = getActCount(warehouseEntity) * warehouseEntity.getCount();
if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
invProductEntity.setOutCount(count);
@ -600,6 +823,8 @@ public class InvProductsTrService {
invProductDetailEntity.setExpireDate(warehouseEntity.getExpireDate());
invProductDetailEntity.setAction(warehouseEntity.getAction());
invProductDetailEntity.setMainAction(orderEntity.getMainAction());
invProductDetailEntity.setInvStorageCode(warehouseEntity.getInvStorageCode());
invProductDetailEntity.setInvWarehouseCode(warehouseEntity.getWarehouseCode());
invProductDetailEntity.setOrderIdFk(warehouseEntity.getOrderId());
invProductDetailEntity.setCount(actCount * warehouseEntity.getCount());
if (purchaseType != null) {
@ -657,7 +882,8 @@ public class InvProductsTrService {
}
public InvProductDetailEntity filterInvByCode(List<InvProductDetailEntity> invProductDetailEntities, String code) {
public InvProductDetailEntity filterInvByCode(List<InvProductDetailEntity> invProductDetailEntities, String
code) {
for (InvProductDetailEntity invProductDetailEntity : invProductDetailEntities) {
if (invProductDetailEntity.getOriginCode().equals(code)) {
@ -683,6 +909,22 @@ public class InvProductsTrService {
return 1;
}
public int getActCount(String code) {
UdiEntity udiEntity = FilterUdiUtils.getUdi(code);
UdiRelevanceResponse udiInfoBean = udiRelevanceService.selectByNameCode(udiEntity.getUdi());
if (udiInfoBean != null) {
if (udiInfoBean.getIsUseDy() == 1 && udiInfoBean.getDiType() != 2) {
if (udiInfoBean.getBhzxxsbzsl() == 0)
return udiInfoBean.getZxxsbzbhsydysl();
else
return udiInfoBean.getZxxsbzbhsydysl() * udiInfoBean.getBhzxxsbzsl();
} else {
return udiInfoBean.getBhzxxsbzsl();
}
}
return 1;
}
public boolean isMutiPack(WarehouseEntity warehouseEntity) {
UdiRelevanceResponse udiInfoBean = udiRelevanceService.selectByNameCode(warehouseEntity.getNameCode());
List<UdiInfoEntity> udiInfoEntities = udiInfoService.findByUuids(udiInfoBean.getUuid());
@ -696,8 +938,6 @@ public class InvProductsTrService {
UdiRelevanceResponse udiInfoBean = udiRelevanceService.selectByNameCode(warehouseEntity.getNameCode());
List<UdiInfoEntity> udiInfoEntities = udiInfoService.findByUuids(udiInfoBean.getUuid());
if (udiInfoBean != null) {
for (UdiInfoEntity udiInfoEntity : udiInfoEntities) {
if (udiInfoBean.getIsUseDy() == 1) {
if (udiInfoEntity.getDiType() == ConstantStatus.DITYPE_SYDY) {
@ -827,4 +1067,22 @@ public class InvProductsTrService {
return results;
}
//判断是否是寄售产品
public boolean isAdavnce(WarehouseEntity warehouseEntity) {
//获取普通出入库结余数量
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
// filterInvProductDetailRequest.setCode(warehouseEntity.getCode());
filterInvProductDetailRequest.setProductIdFk(warehouseEntity.getRelId());
filterInvProductDetailRequest.setSupId(warehouseEntity.getSupId());
List<InvProductDetailJoinResponse> detailJoinResponseList
= invPreProductDetailService.filterJoinInvProduct(filterInvProductDetailRequest);
UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(warehouseEntity.getRelId());
if ((detailJoinResponseList != null && detailJoinResponseList.size() > 0)
|| (udiRelevanceEntity.getIsAdavence() != null && udiRelevanceEntity.getIsAdavence())
) {
return true;
} else return false;
}
}

@ -95,7 +95,8 @@ public class InvProductsTrService_back {
ErpOrderEntity erpOrderEntity = getErpOrders(warehouseEntity, erpOrderEntities);
if (bussinessTypeEntity.isAdvanceType()) {//预入库,则转存预入库
InvProductEntity invPreProductEntity =
invPreProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo(), warehouseEntity.getSupId());
invPreProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo(),
warehouseEntity.getSupId(), warehouseEntity.getInvStorageCode(), warehouseEntity.getInvWarehouseCode());
if (invPreProductEntity == null) {
invPreProductEntity = buildInvProduct(erpOrderEntity.getGoodsid(), erpOrderEntity, orderEntity, warehouseEntity);
// if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
@ -125,7 +126,8 @@ public class InvProductsTrService_back {
invPreProductService.updateInvProduct(invPreProductEntity);
}
} else { //普通出入库
InvProductEntity invProductEntity = invProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo(), warehouseEntity.getSupId());
InvProductEntity invProductEntity = invProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo()
, warehouseEntity.getSupId(), warehouseEntity.getInvStorageCode(), warehouseEntity.getInvWarehouseCode());
if (invProductEntity == null) {
invProductEntity = buildInvProduct(erpOrderEntity.getGoodsid(), erpOrderEntity, orderEntity, warehouseEntity);
// if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {

@ -14,6 +14,8 @@ import com.glxp.sale.admin.entity.basic.UdiRelevanceEntity;
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.inventory.InvWarehouseEntity;
import com.glxp.sale.admin.entity.udid.UdiEntity;
import com.glxp.sale.admin.httpclient.ErpOrderClient;
import com.glxp.sale.admin.req.basic.FilterUdiInfoRequest;
@ -27,6 +29,8 @@ 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.InvProductDetailService;
import com.glxp.sale.admin.service.inventory.InvWarehouseService;
import com.glxp.sale.admin.service.param.SystemParamConfigService;
import com.glxp.sale.admin.service.thrsys.ThrDataService;
import com.glxp.sale.admin.service.thrsys.ThrOrderService;
@ -85,6 +89,11 @@ public class IoTransInoutService {
CompanyProductRelevanceService companyProductRelevanceService;
@Resource
CompanyService companyService;
@Resource
InvWarehouseService invWarehouseService;
@Resource
InvProductDetailService invProductDetailService;
//web端新增订单
@Async
@ -170,6 +179,7 @@ public class IoTransInoutService {
orderSaveRequest.setCorpOrderId(warehouseEntity.getCorpOrderId());
orderSaveRequest.setFromCorpId(warehouseEntity.getFromCorpId());
orderSaveRequest.setCustomerId(postOrderRequest.getCustomerId());
orderSaveRequest.setLocStorageCode(warehouseEntity.getLocStorageCode());
orderSaveRequest.setMainAction(warehouseEntity.getMainAction());
orderSaveRequest.setReceiveStatus(0);
orderSaveRequest.setFromCorp(warehouseEntity.getFromCorp());
@ -242,24 +252,43 @@ public class IoTransInoutService {
orderService.updateOrder(orderEntity);
basicUnitMaintainService.insertBasicUnitMaintain(basicUnitMaintainEntity);
}
if (!Constant.SYSTEM_CUSTOMER_ID.equals(orderEntity.getFromCorpId())) {
BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByErpId(orderEntity.getFromCorpId());
if (basicUnitMaintainEntity == null) {
orderEntity.setRemark("往来单位不存在!");
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_FAIL);
orderService.updateOrder(orderEntity);
return;
}
}
// if (!Constant.SYSTEM_CUSTOMER_ID.equals(orderEntity.getFromCorpId())) {
// BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByErpId(orderEntity.getFromCorpId());
// if (basicUnitMaintainEntity == null) {
// orderEntity.setRemark("往来单位不存在!");
// orderEntity.setStatus(ConstantStatus.ORDER_STATUS_FAIL);
// orderService.updateOrder(orderEntity);
// return;
// }
// }
WarehouseQueryRequest warehouseQueryRequest = new WarehouseQueryRequest();
warehouseQueryRequest.setOrderId(orderEntity.getId());
List<WarehouseEntity> filterList = codesTempService.findByOrderId(warehouseQueryRequest);
List<WarehouseEntity> insertList = new ArrayList<>();
orderEntity.setInvStorageCode(orderEntity.getLocStorageCode());
orderService.updateOrder(orderEntity);
if (bussinessTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_INNOR) {
if (orderEntity.getInvStorageCode() == null) {
orderEntity.setRemark("未选择当前仓库信息");
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_FAIL);
orderService.updateOrder(orderEntity);
}
} else if (bussinessTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_OUT) {
if (orderEntity.getInvStorageCode() == null) {
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findDefault(bussinessTypeEntity.isAdvanceType(), true);
orderEntity.setInvStorageCode(invWarehouseEntity.getCode());
orderService.updateOrder(orderEntity);
}
}
for (int j = 0; j < filterList.size(); j++) {
WarehouseEntity warehouseEntity = filterList.get(j);
warehouseEntity.setInvStorageCode(orderEntity.getLocStorageCode());
String result = new InoutUtils().filterCode(warehouseService, warehouseEntity, systemParamConfigService);
if (result == null) {
insertList.add(warehouseEntity);
@ -300,7 +329,10 @@ public class IoTransInoutService {
//转入正式表后,更换单据状态,等待校验或已完成
public void transStatus(String orderId) {
//todo 改成等待校验,选择校验
OrderEntity orderEntity = orderService.findById(orderId);
String action = orderEntity.getAction();
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(action);
List<WarehouseEntity> warehouseEntityList = warehouseService.findByReceiptId(orderId);
myErpOrderService.deleteByOrderId(orderEntity.getId());
//为所有条码关联基础信息关联表ID
@ -318,22 +350,33 @@ public class IoTransInoutService {
warehouseEntity.setStatus(0);
if (warehouseEntity.getRelId() == null)
warehouseEntity.setRelId(udiRelevanceEntities.get(0).getId() + "");
String originSupId = checkOriginExitSup(warehouseEntity);
String supId = null;
if (originSupId == null)
supId = checkExitSup(warehouseEntity.getRelId());
else
supId = originSupId;
if (supId != null) {//&& !supId.equals("MUTI")
if (bussinessTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_OUT) {
String originSupId = checkOriginExitSup(warehouseEntity);
String supId = null;
if (originSupId == null) {
supId = checkExitSup(warehouseEntity.getRelId());
if (supId == null) {
supId = checkInvExitSup(warehouseEntity);
}
} else
supId = originSupId;
if (supId != null) {//&& !supId.equals("MUTI")
warehouseEntity.setSupId(supId);
}
} else {
String supId = checkExitSup(warehouseEntity.getRelId());
if (supId == null) {
supId = checkInvExitSup(warehouseEntity);
}
warehouseEntity.setSupId(supId);
}
}
warehouseService.updateCode(warehouseEntity);
}
String action = orderEntity.getAction();
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(action);
if (!bussinessTypeEntity.getCheckEnable()) {
if (!bussinessTypeEntity.isCheckEnable()) {
orderEntity = orderService.findById(orderEntity.getId());
unCheckFinish(orderEntity, warehouseEntityList);
} else {
@ -370,7 +413,7 @@ public class IoTransInoutService {
}
}
genOrderDetail(warehouseEntityList);
checkMutiDi(orderEntity.getId()); //校验一个DI是否绑定多个产品ID
checkMutiDi(orderEntity.getId(), bussinessTypeEntity); //校验一个DI是否绑定多个产品ID
orderEntity = orderService.findById(orderEntity.getId());
if (orderEntity.getContrastStatus() != ConstantStatus.ORDER_CHECK_FAIL) {
orderService.updateOrderStatus(orderEntity.getId(), ConstantStatus.ORDER_STATUS_CHECK);
@ -379,8 +422,9 @@ public class IoTransInoutService {
}
public void unCheckFinish(OrderEntity orderEntity, List<WarehouseEntity> warehouseEntityList) {
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(orderEntity.getAction());
genOrderDetail(warehouseEntityList);
checkMutiDi(orderEntity.getId()); //校验一个DI是否绑定多个产品ID
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());
@ -401,6 +445,7 @@ public class IoTransInoutService {
}
public String checkOriginExitSup(WarehouseEntity warehouseEntity) {
if (ConstantType.TYPE_PUT.equals(warehouseEntity.getMainAction())) {
return warehouseEntity.getFromCorpId();
} else if (ConstantType.TYPE_OUT.equals(warehouseEntity.getMainAction())) {
@ -411,7 +456,6 @@ public class IoTransInoutService {
return null;
}
//校验是否存在供应商
public String checkExitSup(String relId) {
//校验条码关联供应商
@ -428,11 +472,19 @@ public class IoTransInoutService {
return null;
}
public String checkInvExitSup(WarehouseEntity warehouseEntity) {
List<InvProductDetailEntity> invProductDetailEntities = invProductDetailService.findByCode(warehouseEntity.getCode());
if (invProductDetailEntities.size() > 0) {
return invProductDetailEntities.get(0).getSupId();
}
return null;
}
public void genOrderDetail(List<WarehouseEntity> warehouseEntityList) {
new InoutUtils(udiUrl).generateConstrastDetail(udiInfoService, udiRelevanceService, myErpOrderService, warehouseEntityList);
}
public void checkMutiDi(String orderId) {
public void checkMutiDi(String orderId, BussinessTypeEntity bussinessTypeEntity) {
//校验是否di绑定多个产品ID
OrderEntity orderEntity = orderService.findById(orderId);
FilterErpOrderRequest filterErpOrderRequest = new FilterErpOrderRequest();
@ -441,7 +493,6 @@ public class IoTransInoutService {
if (erpOrderEntities != null && erpOrderEntities.size() > 0) {
for (ErpOrderEntity erpOrderEntity : erpOrderEntities) {
//校验DI是否绑定多个产品ID
FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest();
filterUdiInfoRequest.setNameCode(erpOrderEntity.getNameCode());
@ -454,7 +505,7 @@ public class IoTransInoutService {
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS);
orderService.updateOrder(orderEntity);
} else {
if (erpOrderEntity.getSupId() == null || erpOrderEntity.getSupId().equals("MUTI")) {
if (bussinessTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_OUT && (erpOrderEntity.getSupId() == null || erpOrderEntity.getSupId().equals("MUTI"))) {
if (erpOrderEntity.getSupId() == null) {
erpOrderEntity.setBindStatus(ConstantStatus.ORDER_DETAIL_SUP_NONE);
orderEntity.setRemark("该产品未绑定供应商");

@ -33,9 +33,9 @@ logging.file=D:/1s/udiwms/udiwms.log
file_path=D:/1s/udiwms
#UDI\u6570\u636E\u4E0B\u8F7D
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=https://www.udims.com/UDI_DL_Server
#UDI_SERVER_URL=https://www.udims.com/UDI_DL_Server
#UCLOD\u670D\u52A1
#UCLOD_SERVER_URL=http://127.0.0.1:9997
#UCLOD_SERVER_URL=http://127.0.0.1:8080/UDIC_UCLOUD_SERVER

@ -17,12 +17,12 @@
parameterType="com.glxp.sale.admin.entity.basic.BussinessChangeTypeEntity">
insert
INTO basic_bustype_pre
(action, scAction, `index`, remark, beforeTime,intro)
(action, scAction, `index`, remark, beforeTime,intro,changeType)
values (#{action},
#{scAction},
#{index},
#{remark},
#{beforeTime},#{intro})
#{beforeTime},#{intro},#{changeType})
</insert>
<update id="updateBusChangeType" parameterType="com.glxp.sale.admin.entity.basic.BussinessChangeTypeEntity">
@ -34,6 +34,8 @@
<if test="beforeTime != null">beforeTime = #{beforeTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="intro != null">intro = #{intro},</if>
<if test="changeType != null">changeType = #{changeType},</if>
</trim>
WHERE id = #{id}
</update>

@ -23,7 +23,7 @@
select basic_bustype_origin.name,
basic_bustype_origin.action thirdAction,
basic_bussiness_type.action,
basic_bustype_local.action localAction
basic_bustype_local.action localAction,
from basic_bustype_origin
LEFT JOIN basic_bussiness_type on basic_bussiness_type.thirdAction = basic_bustype_origin.action
LEFT JOIN basic_bustype_local on basic_bustype_local.originAction = basic_bustype_origin.action

@ -15,7 +15,7 @@
basic_bussiness_type.secCheckWebNew, basic_bussiness_type.secCheckChange,
basic_bustype_local.name localName,basic_bussiness_type.checkEnable, basic_bustype_local.advanceType,
basic_bustype_local.changeEnable,basic_bussiness_type.genUnit,basic_bussiness_type.innerOrder,
basic_bustype_local.spUse
basic_bustype_local.spUse,corpType
FROM basic_bussiness_type LEFT JOIN basic_bustype_local
on basic_bussiness_type.localAction = basic_bustype_local.action
<where>
@ -83,7 +83,7 @@
(action,name,enable,remark,mainAction,localAction,thirdSysFk,
checkEnable,genUnit,innerOrder,secCheckEnable,
checkUdims,checkPdaEd,checkPdaUn,checkPc,checkWebNew,checkChange
,secCheckUdims,secCheckPdaEd,secCheckPdaUn,secCheckPc,secCheckWebNew,secCheckChange)
,secCheckUdims,secCheckPdaEd,secCheckPdaUn,secCheckPc,secCheckWebNew,secCheckChange,corpType)
values
(
#{action},
@ -108,7 +108,7 @@
#{secCheckPdaUn},
#{secCheckPc},
#{secCheckWebNew},
#{secCheckChange}
#{secCheckChange},#{corpType}
)
</insert>
@ -121,7 +121,7 @@
(`index`,action,name,enable,remark,mainAction,localAction,thirdSysFk,
checkEnable,genUnit,innerOrder,secCheckEnable,
checkUdims,checkPdaEd,checkPdaUn,checkPc,checkWebNew,checkChange
,secCheckUdims,secCheckPdaEd,secCheckPdaUn,secCheckPc,secCheckWebNew,secCheckChange)
,secCheckUdims,secCheckPdaEd,secCheckPdaUn,secCheckPc,secCheckWebNew,secCheckChange,corpType)
values
(
#{index},
@ -147,7 +147,7 @@
#{secCheckPdaUn},
#{secCheckPc},
#{secCheckWebNew},
#{secCheckChange}
#{secCheckChange},#{corpType}
)
</insert>
@ -178,6 +178,7 @@
<if test="secCheckWebNew != null">secCheckWebNew=#{secCheckWebNew},</if>
<if test="secCheckChange != null">secCheckChange=#{secCheckChange},</if>
<if test="index != null">index=#{index},</if>
<if test="corpType != null">corpType=#{corpType},</if>
thirdSysFk=#{thirdSysFk},
</trim>
WHERE id = #{id}

@ -116,8 +116,7 @@
nameCode,packRatio,packLevel,bhxjsl,
bhzxxsbzsl,zxxsbzbhsydysl,bhxjcpbm,bzcj,addType,deviceRecordKey,
cpmctymc,cplb,flbm,ggxh,qxlb,tyshxydm,ylqxzcrbarmc,zczbhhzbapzbh,ylqxzcrbarywmc,uuid,sjcpbm,versionNumber
,diType,productType
)
,diType,productType)
values
(
#{nameCode},

@ -39,7 +39,7 @@
INSERT INTO io_codes(action, mainAction, code, corpOrderId, actor, actDate,
fromCorpId, fromCorp, orderId, batchNo, produceDate, expireDate,
serialNo, count, packageLevel, warehouseCode, nameCode, supId, relId, status,
invStorageCode,invWarehouseCode)
invStorageCode, invWarehouseCode, locStorageCode)
values (#{action},
#{mainAction},
#{code},
@ -49,7 +49,7 @@
#{fromCorpId},
#{fromCorp}, #{orderId}, #{batchNo}, #{produceDate}, #{expireDate}, #{serialNo}, #{count},
#{packageLevel}, #{warehouseCode},
#{nameCode}, #{supId}, #{relId}, #{status}, #{invStorageCode}, #{invWarehouseCode})
#{nameCode}, #{supId}, #{relId}, #{status}, #{invStorageCode}, #{invWarehouseCode}, #{locStorageCode})
</insert>
<insert id="insertWarehouses" parameterType="java.util.List">
@ -61,7 +61,8 @@
actor,
actDate,
fromCorpId,fromCorp,orderId,batchNo,produceDate,expireDate,
serialNo,count,packageLevel,warehouseCode,nameCode,supId, relId,status,invStorageCode,invWarehouseCode)
serialNo,count,packageLevel,warehouseCode,nameCode,supId,
relId,status,invStorageCode,invWarehouseCode,locStorageCode)
VALUES
<foreach collection="io_codesEntities" item="item" index="index"
separator=",">
@ -81,7 +82,7 @@
,#{item.serialNo}
,#{item.count}
,#{item.packageLevel} ,#{item.warehouseCode},#{item.nameCode},#{item.supId}
,#{item.relId},#{item.status},#{item.invStorageCode},#{item.invWarehouseCode})
,#{item.relId},#{item.status},#{item.invStorageCode},#{item.invWarehouseCode},#{item.locStorageCode})
</foreach>
</insert>
@ -161,6 +162,8 @@
<if test="supId != null">supId=#{supId},</if>
<if test="invStorageCode != null">invStorageCode=#{invStorageCode},</if>
<if test="invWarehouseCode != null">invWarehouseCode=#{invWarehouseCode},</if>
<if test="locStorageCode != null">locStorageCode=#{locStorageCode},</if>
</trim>
WHERE id=#{id}
</update>

@ -9,7 +9,7 @@
(action, mainAction,code, corpOrderId, actor,actDate,
fromCorpId, fromCorp,
orderId,batchNo,produceDate,expireDate,serialNo,
count,nameCode,supId,invStorageCode,invWarehouseCode)
count,nameCode,supId,invStorageCode,invWarehouseCode,locStorageCode)
VALUES
<foreach collection="codes" item="item" index="index"
separator=",">
@ -28,7 +28,7 @@
,#{item.expireDate}
,#{item.serialNo}
,#{item.count},#{item.nameCode},#{item.supId},
#{item.invStorageCode},#{item.invWarehouseCode}
#{item.invStorageCode},#{item.invWarehouseCode},#{item.locStorageCode}
)
</foreach>
</insert>
@ -38,7 +38,7 @@
parameterType="com.glxp.sale.admin.entity.inout.WarehouseEntity">
INSERT INTO io_codes_temp(action, mainAction, code, corpOrderId, actor, actDate,
fromCorpId, fromCorp, orderId, batchNo, produceDate, expireDate, serialNo,
count, nameCode, supId, invStorageCode, invWarehouseCode)
count, nameCode, supId, invStorageCode, invWarehouseCode,locStorageCode)
values (#{action},
#{mainAction},
#{code},
@ -52,7 +52,7 @@
#{produceDate},
#{expireDate},
#{serialNo},
#{count}, #{nameCode}, #{supId}, #{invStorageCode}, #{invWarehouseCode})
#{count}, #{nameCode}, #{supId}, #{invStorageCode}, #{invWarehouseCode},#{locStorageCode})
</insert>
<select id="findByOrderId" parameterType="com.glxp.sale.admin.req.inout.WarehouseQueryRequest"

@ -32,7 +32,7 @@
<insert id="insertOrder" keyProperty="id" parameterType="com.glxp.sale.admin.entity.inout.OrderEntity">
insert INTO io_order(id, action, corpOrderId, actDate, fromCorpId, actor, mainAction,
fromCorp, status, remark, exportStatus, fromType, contrastStatus, signStatus,
receiveStatus, erpFk, stockCheckFk, customerId, supId, exportFilePath)
receiveStatus, erpFk, stockCheckFk, customerId, supId, exportFilePath,locStorageCode)
values (#{id},
#{action},
#{corpOrderId},
@ -50,7 +50,7 @@
#{receiveStatus},
#{erpFk},
#{stockCheckFk},
#{customerId}, #{supId}, #{exportFilePath})
#{customerId}, #{supId}, #{exportFilePath},#{locStorageCode})
</insert>
<update id="updateOrder" parameterType="com.glxp.sale.admin.entity.inout.OrderEntity">
UPDATE io_order
@ -73,6 +73,10 @@
<if test="stockCheckFk != null">stockCheckFk=#{stockCheckFk},</if>
<if test="supId != null">supId=#{supId},</if>
<if test="exportFilePath != null">exportFilePath=#{exportFilePath},</if>
<if test="invStorageCode != null">invStorageCode=#{invStorageCode},</if>
<if test="invWarehouseCode != null">invWarehouseCode=#{invWarehouseCode},</if>
<if test="locStorageCode != null">locStorageCode=#{locStorageCode},</if>
</trim>
WHERE id = #{id}
</update>

@ -24,7 +24,7 @@
parameterType="com.glxp.sale.admin.entity.inout.StockOrderEntity">
insert INTO stock_order(id, billNo, billdate, corpId, corpName, billType, billFlag,
thirdSysFk, status, statusInfo, type, sourceType,
printStatus, unitIdFk, customerId, thirdOrderFk, orderIdFk, totalPrice)
printStatus, unitIdFk, customerId, thirdOrderFk, orderIdFk, totalPrice, locStorageCode)
values (#{id},
#{billNo},
#{billdate},
@ -37,7 +37,8 @@
#{statusInfo},
#{type},
#{sourceType},
#{printStatus}, #{unitIdFk}, #{customerId}, #{thirdOrderFk}, #{orderIdFk}, #{totalPrice})
#{printStatus}, #{unitIdFk}, #{customerId}, #{thirdOrderFk}, #{orderIdFk}, #{totalPrice},
#{locStorageCode})
</insert>
<update id="updateById" parameterType="com.glxp.sale.admin.entity.inout.StockOrderEntity">
UPDATE stock_order
@ -59,6 +60,7 @@
<if test="thirdOrderFk != null">thirdOrderFk=#{thirdOrderFk},</if>
<if test="orderIdFk != null">orderIdFk=#{orderIdFk},</if>
<if test="totalPrice != null">totalPrice=#{totalPrice},</if>
<if test="locStorageCode != null">locStorageCode=#{locStorageCode},</if>
</trim>
WHERE id = #{id}

@ -43,9 +43,17 @@
<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>
</where>
<if test="groupType != '' and groupType != null">
GROUP BY #{groupType}
</if>
</select>
<select id="selectById" parameterType="Map"
@ -57,6 +65,31 @@
</select>
<select id="selectByUuid" parameterType="Map"
resultType="com.glxp.sale.admin.entity.inventory.InvProductEntity">
SELECT *
FROM inv_pre_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>
<!-- and supId = #{supId}-->
<select id="filterJoinInvProduct" parameterType="com.glxp.sale.admin.req.inventory.FilterInvProductRequest"
resultType="com.glxp.sale.admin.res.inventory.InvProductResponse">
SELECT
@ -67,11 +100,12 @@
basic_products.ylqxzcrbarmc,basic_products.zczbhhzbapzbh,
inv_pre_product.inCount,inv_pre_product.outCount
,inv_pre_product.reCount,inv_pre_product.customerId,
basic_corp.name companyName,inv_pre_product.supId,inv_pre_product.unitFk
basic_corp.name companyName,inv_pre_product.supId,inv_pre_product.unitFk ,inv_warehouse.name invStorageName
FROM inv_pre_product
inner join basic_udirel on inv_pre_product.relIdFk = basic_udirel.id
inner join basic_products on basic_udirel.uuid = basic_products.uuid
inner join basic_corp on inv_pre_product.supId=basic_corp.erpId
left join basic_corp on inv_pre_product.supId=basic_corp.erpId
left join inv_warehouse on inv_warehouse.code=inv_pre_product.invStorageCode
<where>
basic_products.diType=1
<if test="cpmctymc != '' and cpmctymc != null">
@ -83,6 +117,13 @@
<if test="relIdFk != '' and relIdFk != null">
AND inv_pre_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>
@ -111,6 +152,9 @@
AND unitFk = #{unitFk}
</if>
</where>
<if test="groupType != '' and groupType != null">
GROUP BY #{groupType}
</if>
</select>
<insert id="insertInvProduct" keyProperty="id"

@ -40,6 +40,12 @@
<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>
@ -85,6 +91,12 @@
<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>

@ -43,8 +43,17 @@
<if test="unitFk != '' and unitFk != null">
AND unitFk = #{unitFk}
</if>
</where>
<if test="invStorageCode != '' and invStorageCode != null">
AND invStorageCode = #{invStorageCode}
</if>
<if test="invWarehouseCode != '' and invWarehouseCode != null">
AND invWarehouseCode = #{invWarehouseCode}
</if>
</where>
<if test="groupType != '' and groupType != null">
GROUP BY #{groupType}
</if>
</select>
<select id="selectById" parameterType="Map"
@ -55,7 +64,30 @@
</select>
<select id="selectByUuid" parameterType="Map"
resultType="com.glxp.sale.admin.entity.inventory.InvProductEntity">
SELECT *
FROM inv_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="filterJoinInvProduct" parameterType="com.glxp.sale.admin.req.inventory.FilterInvProductRequest"
resultType="com.glxp.sale.admin.res.inventory.InvProductResponse">
SELECT
@ -66,10 +98,12 @@
basic_products.ylqxzcrbarmc,basic_products.zczbhhzbapzbh,
inv_product.inCount,inv_product.outCount
,inv_product.reCount,inv_product.customerId,basic_corp.name companyName,inv_product.unitFk,inv_product.supId
,inv_warehouse.name invStorageName
FROM inv_product
inner join basic_udirel on inv_product.relIdFk = basic_udirel.id
inner join basic_products on basic_udirel.uuid = basic_products.uuid
inner join basic_corp on inv_product.supId=basic_corp.erpId
left join basic_corp on inv_product.supId=basic_corp.erpId
left join inv_warehouse on inv_warehouse.code=inv_product.invStorageCode
<where>
basic_products.diType=1
<if test="cpmctymc != '' and cpmctymc != null">
@ -108,8 +142,17 @@
<if test="unitFk != '' and unitFk != null">
AND unitFk = #{unitFk}
</if>
</where>
<if test="invStorageCode != '' and invStorageCode != null">
AND invStorageCode = #{invStorageCode}
</if>
<if test="invWarehouseCode != '' and invWarehouseCode != null">
AND invWarehouseCode = #{invWarehouseCode}
</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">

@ -42,7 +42,12 @@
<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>
@ -87,6 +92,12 @@
<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>

Loading…
Cancel
Save