库存发票相关

test
anthonywj 1 year ago
parent 49bef11dd9
commit ffe583217d

@ -492,14 +492,16 @@ public class InvWarehouseController extends BaseController {
for (WarehouseBussinessTypeEntity warehouseBussinessTypeEntity : removeLists) {
removeList.add(warehouseBussinessTypeEntity.getAction());
}
if (CollUtil.isNotEmpty(removeList)) {
FilterInvBusUserRequest filterInvBusUserRequest = new FilterInvBusUserRequest();
filterInvBusUserRequest.setSubInvCode(relBusRequset.getInvCode());
filterInvBusUserRequest.setSelectedCodes(relBusRequset.getSelectActions());
List<InvBusUserEntity> invBusUserEntities = invBusUserService.filterInvBusUser(filterInvBusUserRequest);
if (CollUtil.isNotEmpty(invBusUserEntities))
return ResultVOUtils.error(999, "请先移除用户关联单据类型!");
}
// if (CollUtil.isNotEmpty(removeList)) {
// FilterInvBusUserRequest filterInvBusUserRequest = new FilterInvBusUserRequest();
// filterInvBusUserRequest.setSubInvCode(relBusRequset.getInvCode());
// filterInvBusUserRequest.setSelectedCodes(relBusRequset.getSelectActions());
// List<InvBusUserEntity> invBusUserEntities = invBusUserService.filterInvBusUser(filterInvBusUserRequest);
// if (CollUtil.isNotEmpty(invBusUserEntities))
// return ResultVOUtils.error(999, "请先移除用户关联单据类型!");
// }
boolean b = warehouseBussinessTypeService.deleteByCode(relBusRequset.getInvCode());
if (CollUtil.isNotEmpty(relBusRequset.getSelectActions())) {
List<BasicBussinessTypeResponse> basicBussinessTypeResponses = new ArrayList<>();

@ -628,9 +628,10 @@ public class IoCodeTempController extends BaseController {
if (StringUtils.isBlank(orderId) || orderEntity == null) {
String orderNo = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER + StrUtil.trimToEmpty(bussinessTypeEntity.getPrefix()), "yyyyMMdd"));
orderId = orderNo;
inBatch = orderNo.substring((Constant.SCAN_ORDER + StrUtil.trimToEmpty(bussinessTypeEntity.getPrefix())).length());
}
inBatch = orderId.substring((Constant.SCAN_ORDER + StrUtil.trimToEmpty(bussinessTypeEntity.getPrefix())).length());
List<IoCodeTempEntity> codeEnttitys = codeTempService.findByOrderId(orderId);
IoCodeTempEntity exitLocalEntity = null;
IoCodeTempEntity genDetaiEntity = new IoCodeTempEntity();

@ -87,8 +87,13 @@ public class BasicBussinessTypeEntity {
@TableField(value = "checkUdims")
private int checkUdims;
/**
* web
* 0.
* 1./
* 2./
* 3.
* 4.
*/
@TableField(value = "checkWebNew")
private int checkWebNew;

@ -245,6 +245,7 @@ public class IoAddInoutService {
//新增业务单据处理
public void dealBusProcess(IoOrderEntity orderEntity, Integer fromVailPi) {
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction());
orderEntity.setErrMsg("正在处理!");
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_PROCESSING);
orderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_POST);
@ -308,10 +309,67 @@ public class IoAddInoutService {
orderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_POST);
orderEntity.setUpdateTime(new Date());
orderService.update(orderEntity);
//业务单直接生成扫码单
if (bussinessTypeEntity.getCheckWebNew() == 4) {
boolean exit = codeTempService.isExit(orderEntity.getBillNo());
if (!exit)
stockGenScan(orderEntity);
}
return;
}
/**
*
*/
public void stockGenScan(IoOrderEntity orderEntity) {
List<IoOrderDetailBizEntity> bizEntities = orderDetailBizService.findByOrderId(orderEntity.getBillNo());
List<IoCodeTempEntity> codeTempEntities = new ArrayList<>();
for (IoOrderDetailBizEntity bizEntity : bizEntities) {
IoCodeTempEntity codeTempEntity = new IoCodeTempEntity();
String udiCode = "#" + bizEntity.getNameCode()
+ "#" + StrUtil.trimToEmpty(bizEntity.getProductDate())
+ "#" + StrUtil.trimToEmpty(bizEntity.getExpireDate()) +
"#" + StrUtil.trimToEmpty(bizEntity.getBatchNo()) + "#" + "#" + "#";
codeTempEntity.setCode(udiCode);
codeTempEntity.setMainAction(orderEntity.getMainAction());
codeTempEntity.setAction(orderEntity.getAction());
codeTempEntity.setOrderId(orderEntity.getBillNo());
codeTempEntity.setCorpOrderId(orderEntity.getCorpOrderId());
codeTempEntity.setNameCode(bizEntity.getNameCode());
codeTempEntity.setBatchNo(bizEntity.getBatchNo());
codeTempEntity.setProduceDate(bizEntity.getProductDate());
codeTempEntity.setExpireDate(bizEntity.getExpireDate());
codeTempEntity.setSupId(bizEntity.getSupId());
codeTempEntity.setRelId(bizEntity.getBindRlFk());
codeTempEntity.setCount(bizEntity.getCount());
codeTempEntity.setReCount(bizEntity.getCount());
codeTempEntity.setDeptCode(orderEntity.getDeptCode());
codeTempEntity.setInvCode(orderEntity.getInvCode());
codeTempEntity.setUpdateTime(new Date());
codeTempEntity.setCreateTime(new Date());
codeTempEntity.setPrice(bizEntity.getPrice());
if (orderEntity.getBillNo() != null && orderEntity.getBillNo().length() >= 12) {
codeTempEntity.setInBatchNo(orderEntity.getBillNo().substring(orderEntity.getBillNo().length() - 12));
}
codeTempEntities.add(codeTempEntity);
}
codeTempService.insertBatch(codeTempEntities);
bizEntities.forEach(orderDetailBizEntity -> {
IoOrderDetailCodeEntity orderDetailCodeEntity = new IoOrderDetailCodeEntity();
BeanUtils.copyProperties(orderDetailBizEntity, orderDetailCodeEntity);
orderDetailCodeEntity.setId(null);
orderDetailCodeEntity.setReCount(orderDetailBizEntity.getCount());
orderDetailCodeEntity.setCount(orderDetailBizEntity.getCount());
orderDetailCodeService.insert(orderDetailCodeEntity);
});
ioCheckInoutService.check(orderEntity.getBillNo());
}
//生成扫码单据详情
public void genOrderDetailCode(IoOrderEntity orderEntity, IoCodeTempEntity codeTempEntity) {

@ -162,7 +162,7 @@ public class IoCheckInoutService {
return;
}
} else if (orderEntity.getFromType().intValue() == ConstantStatus.FROM_WEBNEW) {
if (bussinessTypeEntity.getCheckWebNew() == 0) {
if (bussinessTypeEntity.getCheckWebNew() == 0 || bussinessTypeEntity.getCheckWebNew() == 4) {
unCheckFirstFinish(orderEntity);
return;
}

@ -40,4 +40,6 @@ public interface IoCodeTempService {
List<IoCodeTempResponse> findCodeList(FilterCodeRequest filterCodeRequest);
Boolean checkTempCode(IoCodeTempEntity ioCodeTempEntity);
boolean isExit(String orderId);
}

@ -89,18 +89,23 @@ public class IoCodeTempServiceImpl implements IoCodeTempService {
@Override
public Boolean checkTempCode(IoCodeTempEntity ioCodeTempEntity) {
QueryWrapper<IoCodeTempEntity> ew=new QueryWrapper<>();
ew.eq("code",ioCodeTempEntity.getCode());
ew.eq("corpOrderId",ioCodeTempEntity.getCorpOrderId());
ew.eq("batchNo",ioCodeTempEntity.getBatchNo());
ew.eq("produceDate",ioCodeTempEntity.getProduceDate());
ew.eq("expireDate",ioCodeTempEntity.getExpireDate());
ew.eq("serialNo",ioCodeTempEntity.getSerialNo());
QueryWrapper<IoCodeTempEntity> ew = new QueryWrapper<>();
ew.eq("code", ioCodeTempEntity.getCode());
ew.eq("corpOrderId", ioCodeTempEntity.getCorpOrderId());
ew.eq("batchNo", ioCodeTempEntity.getBatchNo());
ew.eq("produceDate", ioCodeTempEntity.getProduceDate());
ew.eq("expireDate", ioCodeTempEntity.getExpireDate());
ew.eq("serialNo", ioCodeTempEntity.getSerialNo());
Long count = ioCodeTempDao.selectCount(ew);
if(count>0){
if (count > 0) {
return false;
}
return true;
}
@Override
public boolean isExit(String orderId) {
return ioCodeTempDao.exists(new QueryWrapper<IoCodeTempEntity>().eq("orderId", orderId));
}
}

@ -711,7 +711,7 @@ public class IoOrderServiceImpl implements IoOrderService {
@Override
public void setInvoiceFiltes(FilterOrderRequest filterOrderRequest) {
// .eq("corpType", ConstantStatus.CORP_TYPE_OUT)
// 可增删改查
List<BasicBussinessTypeEntity> bussinessTypeEntities = basicBussinessTypeDao.selectList(new QueryWrapper<BasicBussinessTypeEntity>()
.eq("mainAction", ConstantType.TYPE_PUT)
.eq("inStock", false)
@ -721,6 +721,8 @@ public class IoOrderServiceImpl implements IoOrderService {
if (CollUtil.isNotEmpty(actions1))
filterOrderRequest.setInvoiceActions1(actions1);
// 可查看
List<BasicBussinessTypeEntity> bussinessTypeEntities2 = basicBussinessTypeDao.selectList(new QueryWrapper<BasicBussinessTypeEntity>()
.eq("mainAction", ConstantType.TYPE_PUT)
.eq("inStock", true)

@ -40,7 +40,7 @@ public class InvPreProductServiceImpl implements InvPreProductService {
public InvPreProductEntity selectByUnique(Long relId, String batchNo, String supId, String deptCode, String invCode, BigDecimal price) {
return invPreProductDao.selectOne(new QueryWrapper<InvPreProductEntity>().eq("relIdFk", relId).eq(StrUtil.isNotEmpty(batchNo), "batchNo", batchNo)
.isNull(StrUtil.isEmpty(batchNo), "batchNo").eq("supId", supId).eq("deptCode", deptCode).eq("invCode", invCode)
.eq(price != null, "price", price).isNull(price == null, "price"));
.eq(price != null, "price", price).isNull(price == null, "price").last("limit 1"));
}

@ -39,7 +39,7 @@ public class InvPreinProductServiceImpl implements InvPreinProductService {
public InvPreinProductEntity selectByUnique(Long relId, String batchNo, String supId, String deptCode, String invCode, BigDecimal price) {
return invPreinProductDao.selectOne(new QueryWrapper<InvPreinProductEntity>().eq("relIdFk", relId).eq(StrUtil.isNotEmpty(batchNo), "batchNo", batchNo)
.isNull(StrUtil.isEmpty(batchNo), "batchNo").eq("supId", supId).eq("deptCode", deptCode).eq("invCode", invCode)
.eq(price != null, "price", price).isNull(price == null, "price"));
.eq(price != null, "price", price).isNull(price == null, "price").last("limit 1"));
}

@ -46,14 +46,16 @@ public class InvProductServiceImpl implements InvProductService {
.eq("supId", supId)
.eq("deptCode", deptCode)
.eq("invCode", invCode)
.eq(price != null, "price", price).isNull(price == null, "price")
.eq(price != null, "price", price).isNull(price == null, "price").last("limit 1")
);
}
@Override
public InvProductEntity selectByUnique(Long relId, String batchNo, String supId, String deptCode, String invCode) {
return invProductDao.selectOne(new QueryWrapper<InvProductEntity>().eq("relIdFk", relId).eq(StrUtil.isNotEmpty(batchNo), "batchNo", batchNo)
.isNull(StrUtil.isEmpty(batchNo), "batchNo").eq("supId", supId).eq("deptCode", deptCode).eq("invCode", invCode));
.isNull(StrUtil.isEmpty(batchNo), "batchNo").eq("supId", supId)
.eq("deptCode", deptCode)
.eq("invCode", invCode).last("limit 1"));
}
@Override

@ -360,7 +360,7 @@
AND `action` IN (SELECT `action`
FROM basic_bussiness_type
WHERE supplementOrderType IS NOT NULL
and supplementOrderType
and supplementOrderType
!= '')
</select>
@ -557,7 +557,7 @@
<foreach collection="invoiceActions2" index="index" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
and io.status = 7)
and (io.status = 7 or io.status = 10))
)
</if>
</if>

Loading…
Cancel
Save