库存查询,库存详情,参数配置等

master
anthonyywj2 3 years ago
parent b3dea8a1ec
commit 11de396b84

@ -439,7 +439,7 @@ public class WareHouseController {
if (udiEntity == null) {
String sptmtodi = systemParamConfigService.selectValueByParamKey(Constant.SPTM_TO_DI);
if(sptmtodi.equals("1")){
if (sptmtodi.equals("1")) {
if (code.length() == 13) {
UdiInfoEntity udiInfoEntity = udiInfoService.findBySptm(code);
if (udiInfoEntity != null) {
@ -581,9 +581,16 @@ public class WareHouseController {
if (StrUtil.isEmpty(udiEntity.getSerialNo()) && StrUtil.isEmpty(udiEntity.getBatchNo())) {
return ResultVOUtils.error(500, "批次号不能为空!");
}
BaseResponse checkOriginCodeRes = checkOriginCode(udiEntity);
if (checkOriginCodeRes != null)
return checkOriginCodeRes;
// String isCheck = systemParamConfigService.selectValueByParamKey("code_fill_check");
//三期校验
if (bussinessTypeEntity.isCodeFillCheck()) {
BaseResponse checkOriginCodeRes = checkOriginCode(udiEntity);
if (checkOriginCodeRes != null)
return checkOriginCodeRes;
}
//过期提醒:
SystemParamConfigEntity expireParamConfigEntity = systemParamConfigService.selectByParamKey("expire_date_tip");
@ -893,7 +900,7 @@ public class WareHouseController {
//校验条码的完整性
String errMsg = "";
UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectByNameCode(udiEntity.getUdi());
if(udiRelevanceResponse == null){
if (udiRelevanceResponse == null) {
return ResultVOUtils.error(501, "耗材字典不存在此产品!");
}
if (StrUtil.isEmpty(udiEntity.getBatchNo()) && !udiRelevanceResponse.isAllowNoBatch()) {

@ -65,6 +65,6 @@ public class BussinessTypeEntity {
private boolean scanPreIn;
private boolean vailInv;
private boolean codeFillCheck;
}

@ -64,4 +64,7 @@ public class BussinessTypResponse {
private boolean ullageFill;
private boolean scanPreIn;
private boolean vailInv;
private boolean codeFillCheck;
}

@ -17,4 +17,8 @@ public class WarehouseResponse {
private String fromCorp;
private Integer count;
private String orderId;
private String batchNo;
private String produceDate;
private String expireDate;
private String serialNo;
}

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

@ -12,6 +12,9 @@ public interface InvProductDetailService {
List<InvProductDetailEntity> findByCode(String code);
List<InvProductDetailEntity> findByOriginCode(String code);
List<InvProductDetailEntity> filterInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest);
List<InvProductDetailJoinResponse> filterJoinInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest);

@ -26,6 +26,22 @@ public class InvPreProductDetailServiceImpl implements InvPreProductDetailServic
@Resource
InvPreProductDetailDao invPreProductDetailDao;
@Override
public List<InvProductDetailEntity> findByCode(String code) {
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
filterInvProductDetailRequest.setCode(code);
List<InvProductDetailEntity> invProductDetailEntities = invPreProductDetailDao.filterInvProductDetail(filterInvProductDetailRequest);
return invProductDetailEntities;
}
@Override
public List<InvProductDetailEntity> findByOriginCode(String code) {
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
filterInvProductDetailRequest.setOriginCode(code);
List<InvProductDetailEntity> invProductDetailEntities = invPreProductDetailDao.filterInvProductDetail(filterInvProductDetailRequest);
return invProductDetailEntities;
}
@Override
public List<InvProductDetailEntity> filterInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest) {
if (filterInvProductDetailRequest == null) {

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

@ -14,6 +14,7 @@ import com.glxp.sale.admin.entity.basic.BussinessTypeEntity;
import com.glxp.sale.admin.entity.info.CompanyEntity;
import com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity;
import com.glxp.sale.admin.entity.inout.*;
import com.glxp.sale.admin.entity.inventory.InvProductDetailEntity;
import com.glxp.sale.admin.entity.inventory.InvProductEntity;
import com.glxp.sale.admin.entity.inventory.InvWarehouseEntity;
import com.glxp.sale.admin.entity.udid.UdiEntity;
@ -28,10 +29,10 @@ import com.glxp.sale.admin.service.basic.*;
import com.glxp.sale.admin.service.info.CompanyProductRelevanceService;
import com.glxp.sale.admin.service.info.CompanyService;
import com.glxp.sale.admin.service.inout.*;
import com.glxp.sale.admin.service.inventory.InvPreProductService;
import com.glxp.sale.admin.service.inventory.InvProductService;
import com.glxp.sale.admin.service.inventory.InvWarehouseService;
import com.glxp.sale.admin.service.inventory.*;
import com.glxp.sale.admin.util.*;
import com.glxp.sale.common.res.BaseResponse;
import com.glxp.sale.common.util.ResultVOUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -407,7 +408,14 @@ public class IoTransInoutService {
insertList.clear();
return;
}
//三期校验
String checkOriginMsg = checkOriginCode(warehouseEntity, bussinessTypeEntity);
if (StrUtil.isNotEmpty(checkOriginMsg)) {
orderService.updateOrderStatus(warehouseEntity.getOrderId(), ConstantStatus.ORDER_STATUS_FAIL);
orderService.updateRemark(orderEntity.getId(), checkOriginMsg);
insertList.clear();
return;
}
//校验是否是当前供应商
if (bussinessTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_OUT) {
@ -483,6 +491,66 @@ public class IoTransInoutService {
}
}
@Resource
InvPreProductDetailService invPreProductDetailService;
@Resource
InvProductDetailService invProductDetailService;
public String checkOriginCode(WarehouseEntity warehouseEntity, BussinessTypeEntity bussinessTypeEntity) {
UdiEntity udiEntity = FilterUdiUtils.getGS1Udi(warehouseEntity.getCode());
//校验条码的完整性
String errMsg = "";
UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectByNameCode(udiEntity.getUdi());
if (udiRelevanceResponse == null) {
return "耗材字典不存在此产品";
}
if (bussinessTypeEntity.isAdvanceType()) {
List<InvProductDetailEntity> invPreProductDetailEntitys = invPreProductDetailService.findByOriginCode(warehouseEntity.getCode());
if (CollUtil.isNotEmpty(invPreProductDetailEntitys)) {
InvProductDetailEntity invProductDetailEntity = invPreProductDetailEntitys.get(invPreProductDetailEntitys.size()-1);
if (StrUtil.isEmpty(warehouseEntity.getBatchNo())) {
warehouseEntity.setBatchNo(invProductDetailEntity.getBatchNo());
}
if (StrUtil.isEmpty(warehouseEntity.getProduceDate())) {
warehouseEntity.setProduceDate(invProductDetailEntity.getProductionDate());
}
if (StrUtil.isEmpty(warehouseEntity.getExpireDate())) {
warehouseEntity.setExpireDate(invProductDetailEntity.getExpireDate());
}
}
} else {
List<InvProductDetailEntity> invProductDetailEntities = invProductDetailService.findByOriginCode(warehouseEntity.getCode());
if (CollUtil.isNotEmpty(invProductDetailEntities)) {
InvProductDetailEntity invProductDetailEntity = invProductDetailEntities.get(invProductDetailEntities.size()-1);
if (StrUtil.isEmpty(warehouseEntity.getBatchNo())) {
warehouseEntity.setBatchNo(invProductDetailEntity.getBatchNo());
}
if (StrUtil.isEmpty(warehouseEntity.getProduceDate())) {
warehouseEntity.setProduceDate(invProductDetailEntity.getProductionDate());
}
if (StrUtil.isEmpty(warehouseEntity.getExpireDate())) {
warehouseEntity.setExpireDate(invProductDetailEntity.getExpireDate());
}
}
}
if (StrUtil.isEmpty(warehouseEntity.getBatchNo()) && !udiRelevanceResponse.isAllowNoBatch()) {
errMsg = errMsg + ",批次号";
}
if (StrUtil.isEmpty(warehouseEntity.getProduceDate()) && !udiRelevanceResponse.isAllowNoProduct()) {
errMsg = errMsg + ",生产日期";
}
if (StrUtil.isEmpty(warehouseEntity.getExpireDate()) && !udiRelevanceResponse.isAllowNoExpire()) {
errMsg = errMsg + ",失效日期";
}
if (StrUtil.isNotEmpty(errMsg)) {
return "UDI码" + warehouseEntity.getCode() + "产品三期缺失请补齐" + errMsg.substring(1) + "";
}
return null;
}
//转入正式表后,更换单据状态,等待校验或已完成
public void transStatus(String orderId) {
//todo 改成等待校验,选择校验

@ -10,7 +10,7 @@
basic_bussiness_type.enable,basic_bussiness_type.remark,basic_bussiness_type.mainAction,
basic_bussiness_type.thirdSysFk,basic_bussiness_type.localAction,basic_bussiness_type.secCheckEnable,
basic_bussiness_type.checkUdims,basic_bussiness_type.checkPdaEd,basic_bussiness_type.checkPdaUn,basic_bussiness_type.checkPc,
basic_bussiness_type.checkWebNew,basic_bussiness_type.checkChange,
basic_bussiness_type.checkWebNew,basic_bussiness_type.checkChange,basic_bussiness_type.codeFillCheck,
basic_bussiness_type.secCheckUdims, basic_bussiness_type.secCheckPdaEd, basic_bussiness_type.secCheckPdaUn,
basic_bussiness_type.secCheckWebNew, basic_bussiness_type.secCheckChange,
basic_bussiness_type.ullageFill, basic_bussiness_type.scanPreIn, basic_bussiness_type.vailInv,
@ -124,7 +124,7 @@
basic_bussiness_type.enable,basic_bussiness_type.remark,basic_bussiness_type.mainAction,
basic_bussiness_type.thirdSysFk,basic_bussiness_type.localAction,basic_bussiness_type.secCheckEnable,
basic_bussiness_type.checkUdims,basic_bussiness_type.checkPdaEd,basic_bussiness_type.checkPdaUn,basic_bussiness_type.checkPc,
basic_bussiness_type.checkWebNew,basic_bussiness_type.checkChange,
basic_bussiness_type.checkWebNew,basic_bussiness_type.checkChange,basic_bussiness_type.codeFillCheck,
basic_bussiness_type.secCheckUdims, basic_bussiness_type.secCheckPdaEd, basic_bussiness_type.secCheckPdaUn,
basic_bussiness_type.secCheckWebNew, basic_bussiness_type.secCheckChange,
basic_bussiness_type.ullageFill, basic_bussiness_type.scanPreIn, basic_bussiness_type.vailInv,
@ -181,7 +181,7 @@
,secCheckUdims,secCheckPdaEd,secCheckPdaUn,secCheckPc,secCheckWebNew,
secCheckChange,corpType,basic_bussiness_type.storageCode,checkBalacne,
secCheckBalacne,supplementOrderType,defaultUnit,useDyCount,expireTip,updateTime,prefix
,ullageFill,scanPreIn,vailInv)
,ullageFill,scanPreIn,vailInv,codeFillCheck)
values
(
#{action},
@ -219,7 +219,7 @@
#{prefix},
#{ullageFill},
#{scanPreIn},
#{vailInv}
#{vailInv},#{codeFillCheck}
)
</insert>
@ -234,7 +234,7 @@
checkUdims,checkPdaEd,checkPdaUn,checkPc,checkWebNew,checkChange
,secCheckUdims,secCheckPdaEd,secCheckPdaUn,secCheckPc,secCheckWebNew,
secCheckChange,corpType,storageCode,checkBalacne,secCheckBalacne,supplementOrderType,defaultUnit,useDyCount,expireTip,updateTime,prefix
,ullageFill,scanPreIn,vailInv)
,ullageFill,scanPreIn,vailInv,codeFillCheck)
values
(
#{index},
@ -273,7 +273,7 @@
#{prefix},
#{ullageFill},
#{scanPreIn},
#{vailInv}
#{vailInv},#{codeFillCheck}
)
</insert>
@ -317,6 +317,8 @@
<if test="scanPreIn != null">scanPreIn=#{scanPreIn},</if>
<if test="vailInv != null">vailInv=#{vailInv},</if>
<if test="prefix != null">prefix=#{prefix},</if>
<if test="codeFillCheck != null">codeFillCheck=#{codeFillCheck},</if>
thirdSysFk=#{thirdSysFk},
</trim>
WHERE id = #{id}

Loading…
Cancel
Save