feat: 扫码明细粒度变小 优化

dev_2.5_ocean
chenhc 4 months ago
parent b763214354
commit a223c48e25

@ -899,6 +899,12 @@ public class IoCodeTempController extends BaseController {
return ResultVOUtils.error(500, "重复扫码!");
}
//匹配biz
IoOrderDetailCodeEntity byRelId = ioOrderDetailCodeService.findByRelNameCode(addOrderRequest.getBillNo(), udiEntity.getUdi(), udiEntity.getBatchNo());
if (byRelId!=null){
exitLocalEntity.setBizId(byRelId.getId());
}
//校验库存
BaseResponse invRes = null;
if (IntUtil.value(bussinessTypeEntity.getUseDyCount()) == 2) {
@ -1349,6 +1355,14 @@ public class IoCodeTempController extends BaseController {
exitLocalEntity.setReCount(exitLocalEntity.getMyReCount() * udiCalCountUtil.getCirActCount(udiRelevanceResponses.get(0)));
}
//匹配biz
IoOrderDetailCodeEntity byRelId = ioOrderDetailCodeService.findByRelNameCode(addOrderRequest.getBillNo(), udiEntity.getUdi(), udiEntity.getBatchNo());
if (byRelId!=null){
exitLocalEntity.setBizId(byRelId.getId());
}
//校验库存
BaseResponse invRes = null;
if (IntUtil.value(bussinessTypeEntity.getUseDyCount()) == 2) {
@ -1463,6 +1477,12 @@ public class IoCodeTempController extends BaseController {
codeEnttity.setGroupNumber(groupNumber);
codeEnttity.setQueueCode(queueCode);
//匹配biz
IoOrderDetailCodeEntity byRelId = ioOrderDetailCodeService.findByRelNameCode(addOrderRequest.getBillNo(), udiEntity.getUdi(), udiEntity.getBatchNo());
if (byRelId!=null){
codeEnttity.setBizId(byRelId.getId());
}
//如果是阿里拉的单据会有批次号
IoCollectOrderCodeMan codeMan = ioCollectOrderCodeManService.getOne(new LambdaQueryWrapper<IoCollectOrderCodeMan>().eq(IoCollectOrderCodeMan::getUdiCode, code));
if (codeMan != null) {

@ -596,6 +596,17 @@ public class IoOrderController extends BaseController {
pageSimpleResponse.setList(codeEntities);
return ResultVOUtils.success(pageSimpleResponse);
}
@AuthRuleAnnotation("")
@GetMapping("admin/warehouse/inout/findCheckCodeByBiz")
public BaseResponse findCheckCodeByBiz(FilterCodeRequest filterCodeRequest) {
//校验单据是否已完成
List<IoCodeResponse> codeTempEntities = codeTempService.findJoinByBizId(filterCodeRequest.getBizId());
List<IoCodeResponse> codeEntities = getCheckRusultCode(filterCodeRequest.getOrderId(), codeTempEntities);
PageSimpleResponse<IoCodeResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(0l);
pageSimpleResponse.setList(codeEntities);
return ResultVOUtils.success(pageSimpleResponse);
}
/**

@ -1076,6 +1076,13 @@ public class IoOrderDetailBizController extends BaseController {
Long id = codeLostEntity.getId();
if (id == null) codeLostEntity.setId(IdUtil.getSnowflakeNextId());
}
//匹配biz
IoOrderDetailCodeEntity byRelId = orderDetailCodeService.findByRelNameCode(addOrderRequest.getBillNo(), nameCode, aliYljgBillDetailDrug.getProduceBatchNo());
if (byRelId!=null){
codeLostEntity.setBizId(byRelId.getId());
}
ioCodeLostService.insertOrUpdate(codeLostEntity);
UdiEntity udiEntityy = FilterUdiUtils.getUdi(addOrderRequest.getCode());

@ -87,7 +87,8 @@ public class IoCodeLostEntity {
@TableField(exist = false)
private String endTime;
@TableField(value = "bizId")
private Long bizId;
public static final String COL_ID = "id";

@ -240,4 +240,10 @@ public class IoCodeTempEntity {
*/
@TableField(value = "queueCode")
private String queueCode;
/**
* bizId
*/
@TableField(value = "bizId")
private Long bizId;
}

@ -97,4 +97,6 @@ public class FilterCodeRequest extends ListPageRequest {
*/
private Integer groupNumber;
private Long bizId;
}

@ -705,6 +705,7 @@ public class IoCollectOrderService extends ServiceImpl<IoCollectOrderMapper, IoC
for (IoCollectOrderBiz ioCollectOrderBiz : collectOrderBizs) {
IoCollectOrderBizBackup ioCollectOrderBizBackup = new IoCollectOrderBizBackup();
BeanUtils.copyProperties(ioCollectOrderBiz, ioCollectOrderBizBackup);
ioCollectOrderBizBackup.setId(ioCollectOrderBiz.getId());
ioCollectOrderBizBackups.add(ioCollectOrderBizBackup);
}
ioCollectOrderBizBackupService.saveBatch(ioCollectOrderBizBackups);

@ -90,6 +90,14 @@ public class IoCodeTempService {
return ioCodeTempDao.filterJoinProduct(filterCodeRequest);
}
public List<IoCodeResponse> findJoinByBizId(Long bizId) {
if (bizId == null)
return null;
FilterCodeRequest filterCodeRequest = new FilterCodeRequest();
filterCodeRequest.setBizId(bizId);
return ioCodeTempDao.filterJoinProduct(filterCodeRequest);
}
public int updateById(IoCodeTempEntity codeEnttity) {
return ioCodeTempDao.updateById(codeEnttity);

@ -38,6 +38,7 @@ public interface IoOrderDetailBizService {
IoOrderDetailBizEntity findByRelId(String orderId, Long relId);
IoOrderDetailBizEntity findByRelId(String orderId, String nameCode, String batchNo);
List<IoOrderDetailBizResponse> filterList(FilterOrderDetailBizRequest orderDetailBizRequest);

@ -14,6 +14,7 @@ public interface IoOrderDetailCodeService {
List<IoOrderDetailCodeEntity> findByOrderDetail(String orderId, String productName);
IoOrderDetailCodeEntity findByUnique(String orderId, Long relId, String bacthNo, BigDecimal price);
IoOrderDetailCodeEntity findByRelNameCode(String orderId, String nameCode , String bacthNo);
int findByRelIdCount(String orderId, Long relId, String batchNo);

@ -156,6 +156,20 @@ public class IoOrderDetailBizServiceImpl implements IoOrderDetailBizService {
return null;
}
@Override
public IoOrderDetailBizEntity findByRelId(String orderId, String nameCode, String batchNo) {
List<IoOrderDetailBizEntity> orderDetailBizEntities =
ioOrderDetailBizDao.selectList(new QueryWrapper<IoOrderDetailBizEntity>()
.eq("orderIdFk", orderId)
.eq("nameCode", nameCode)
.eq("batchNo", batchNo)
);
if (CollUtil.isNotEmpty(orderDetailBizEntities)) {
return orderDetailBizEntities.get(0);
}
return null;
}
@Override
public List<IoOrderDetailBizResponse> filterList(FilterOrderDetailBizRequest orderDetailBizRequest) {
if (null == orderDetailBizRequest) {
@ -767,6 +781,13 @@ public class IoOrderDetailBizServiceImpl implements IoOrderDetailBizService {
if (!StringUtils.isBlank(exitLocalEntity.getSerialNo())) {
return ResultVOUtils.error(500, "重复扫码!");
}
//匹配biz
IoOrderDetailCodeEntity byRelId = orderDetailCodeService.findByRelNameCode(addOrderRequest.getBillNo(), udiEntity.getUdi(), udiEntity.getBatchNo());
if (byRelId!=null){
exitLocalEntity.setBizId(byRelId.getId());
}
codeTempService.updateById(exitLocalEntity);
}
}
@ -793,6 +814,13 @@ public class IoOrderDetailBizServiceImpl implements IoOrderDetailBizService {
codeEnttity.setFifoSplit(addOrderRequest.getFifoSplit());
codeEnttity.setProductType(2);
codeEnttity.setCount(1);
//匹配biz
IoOrderDetailCodeEntity byRelId = ioOrderDetailCodeService.findByRelNameCode(addOrderRequest.getBillNo(), udiEntity.getUdi(), udiEntity.getBatchNo());
if (byRelId!=null){
codeEnttity.setBizId(byRelId.getId());
}
String unitFk = null;
if (bussinessTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_OUT) {
unitFk = addOrderRequest.getFromCorp();

@ -65,6 +65,17 @@ public class IoOrderDetailCodeServiceImpl implements IoOrderDetailCodeService {
);
}
@Override
public IoOrderDetailCodeEntity findByRelNameCode(String orderId, String nameCode, String bacthNo) {
return ioOrderDetailCodeDao.selectOne(new QueryWrapper<IoOrderDetailCodeEntity>()
.eq("orderIdFk", orderId)
.eq("nameCode", nameCode)
.eq(StrUtil.isNotEmpty(bacthNo), "batchNo", bacthNo)
.isNull(StrUtil.isEmpty(bacthNo), "batchNo")
.last("limit 1")
);
}
@Override
public int findByRelIdCount(String orderId, Long relId, String batchNo) {
Integer count = ioOrderDetailCodeDao.findByRelIdCount(orderId, relId, batchNo);

@ -19,6 +19,9 @@
<if test="orderId != null and orderId != ''">
orderId = #{orderId}
</if>
<if test="bizId != null and bizId != ''">
bizId = #{bizId}
</if>
<if test="code != null and code != ''">
AND code = #{code}
</if>
@ -75,6 +78,9 @@
<if test="orderId != null and orderId != ''">
AND ic.orderId = #{orderId}
</if>
<if test="bizId != null and bizId != ''">
AND ic.bizId = #{bizId}
</if>
</where>
group by ic.id
</select>

@ -5267,6 +5267,16 @@ ALTER TABLE rel_code_batch
MODIFY COLUMN `batchNo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '批次号';
CALL Pro_Temp_ColumnWork('io_code_temp', 'bizId',
'bigint DEFAULT NULL COMMENT ''biz表主键''',
1);
CALL Pro_Temp_ColumnWork('io_code_lost', 'bizId',
'bigint DEFAULT NULL COMMENT ''biz表主键''',
1);
CALL Pro_Temp_ColumnWork('basic_corp', 'aliEntId',
'varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT ''阿里供应商ID''',
1);
@ -5315,6 +5325,8 @@ CALL Modify_index('rel_code_batch', 'packageSpec', 'rel_code_batch_packageSpec',
CALL Modify_index('io_code', 'code', 'idex_code_query', 'BTREE');
CALL Modify_index('io_code_temp', 'code', 'idex_code_temp_query', 'BTREE');
CALL Modify_index('io_code_temp', 'orderId', 'idex_orderId_temp_query', 'BTREE');
CALL Modify_index('io_code_temp', 'bizId', 'idex_bizId_temp_query', 'BTREE');
CALL Pro_Temp_ColumnWork('sys_workplace', 'jobMode',

Loading…
Cancel
Save