库存发票相关

test
anthonywj 1 year ago
parent 49bef11dd9
commit ffe583217d

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

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

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

@ -245,6 +245,7 @@ public class IoAddInoutService {
//新增业务单据处理 //新增业务单据处理
public void dealBusProcess(IoOrderEntity orderEntity, Integer fromVailPi) { public void dealBusProcess(IoOrderEntity orderEntity, Integer fromVailPi) {
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction());
orderEntity.setErrMsg("正在处理!"); orderEntity.setErrMsg("正在处理!");
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_PROCESSING); orderEntity.setStatus(ConstantStatus.ORDER_STATUS_PROCESSING);
orderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_POST); orderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_POST);
@ -308,10 +309,67 @@ public class IoAddInoutService {
orderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_POST); orderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_POST);
orderEntity.setUpdateTime(new Date()); orderEntity.setUpdateTime(new Date());
orderService.update(orderEntity); orderService.update(orderEntity);
//业务单直接生成扫码单
if (bussinessTypeEntity.getCheckWebNew() == 4) {
boolean exit = codeTempService.isExit(orderEntity.getBillNo());
if (!exit)
stockGenScan(orderEntity);
}
return; 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) { public void genOrderDetailCode(IoOrderEntity orderEntity, IoCodeTempEntity codeTempEntity) {

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

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

@ -89,18 +89,23 @@ public class IoCodeTempServiceImpl implements IoCodeTempService {
@Override @Override
public Boolean checkTempCode(IoCodeTempEntity ioCodeTempEntity) { public Boolean checkTempCode(IoCodeTempEntity ioCodeTempEntity) {
QueryWrapper<IoCodeTempEntity> ew=new QueryWrapper<>(); QueryWrapper<IoCodeTempEntity> ew = new QueryWrapper<>();
ew.eq("code",ioCodeTempEntity.getCode()); ew.eq("code", ioCodeTempEntity.getCode());
ew.eq("corpOrderId",ioCodeTempEntity.getCorpOrderId()); ew.eq("corpOrderId", ioCodeTempEntity.getCorpOrderId());
ew.eq("batchNo",ioCodeTempEntity.getBatchNo()); ew.eq("batchNo", ioCodeTempEntity.getBatchNo());
ew.eq("produceDate",ioCodeTempEntity.getProduceDate()); ew.eq("produceDate", ioCodeTempEntity.getProduceDate());
ew.eq("expireDate",ioCodeTempEntity.getExpireDate()); ew.eq("expireDate", ioCodeTempEntity.getExpireDate());
ew.eq("serialNo",ioCodeTempEntity.getSerialNo()); ew.eq("serialNo", ioCodeTempEntity.getSerialNo());
Long count = ioCodeTempDao.selectCount(ew); Long count = ioCodeTempDao.selectCount(ew);
if(count>0){ if (count > 0) {
return false; return false;
} }
return true; 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 @Override
public void setInvoiceFiltes(FilterOrderRequest filterOrderRequest) { public void setInvoiceFiltes(FilterOrderRequest filterOrderRequest) {
// .eq("corpType", ConstantStatus.CORP_TYPE_OUT) // 可增删改查
List<BasicBussinessTypeEntity> bussinessTypeEntities = basicBussinessTypeDao.selectList(new QueryWrapper<BasicBussinessTypeEntity>() List<BasicBussinessTypeEntity> bussinessTypeEntities = basicBussinessTypeDao.selectList(new QueryWrapper<BasicBussinessTypeEntity>()
.eq("mainAction", ConstantType.TYPE_PUT) .eq("mainAction", ConstantType.TYPE_PUT)
.eq("inStock", false) .eq("inStock", false)
@ -721,6 +721,8 @@ public class IoOrderServiceImpl implements IoOrderService {
if (CollUtil.isNotEmpty(actions1)) if (CollUtil.isNotEmpty(actions1))
filterOrderRequest.setInvoiceActions1(actions1); filterOrderRequest.setInvoiceActions1(actions1);
// 可查看
List<BasicBussinessTypeEntity> bussinessTypeEntities2 = basicBussinessTypeDao.selectList(new QueryWrapper<BasicBussinessTypeEntity>() List<BasicBussinessTypeEntity> bussinessTypeEntities2 = basicBussinessTypeDao.selectList(new QueryWrapper<BasicBussinessTypeEntity>()
.eq("mainAction", ConstantType.TYPE_PUT) .eq("mainAction", ConstantType.TYPE_PUT)
.eq("inStock", true) .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) { 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) 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) .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) { 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) 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) .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("supId", supId)
.eq("deptCode", deptCode) .eq("deptCode", deptCode)
.eq("invCode", invCode) .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 @Override
public InvProductEntity selectByUnique(Long relId, String batchNo, String supId, String deptCode, String invCode) { 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) 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 @Override

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

Loading…
Cancel
Save