单据关联相关修改

dev2.0
anthonywj 2 years ago
parent 54c7b550a2
commit 5ab0fa6296

@ -966,8 +966,19 @@ public class IoCheckInoutService {
if (bussinessTypeEntity.getBackPreinType() == 1) { //按单退货
String orderIds = orderEntity.getCheckPreInOrders();
if (StrUtil.isNotEmpty(orderIds)) {
String[] orderIdArray = orderIds.split(",");
List<String> orderList = CollUtil.toList(orderIdArray);
// 更新关联值
orderList.stream().parallel().forEach(item ->
{
IoOrderEntity temp = orderService.findByBillNo(item);
if (StrUtil.isNotEmpty(orderEntity.getRelKey()) && !temp.getRelKey().contains(orderEntity.getRelKey())) {
temp.setRelKey(temp.getRelKey() + "," + orderEntity.getRelKey());
}
orderService.update(temp);
});
List<IoCodeEntity> outCodeEntitys = codeService.findByOrderId(orderEntity.getBillNo());
List<IoCodeEntity> preInCodeEntities = codeService.findByOrderIds(orderList, null);
@ -1105,6 +1116,7 @@ public class IoCheckInoutService {
outOrder.setFromCorp(codeEntity.getSupId());
outOrder.setOrderType(2);
outOrder.setCreateTime(new Date());
outOrder.setRelKey(orderEntity.getRelKey());
outOrder.setFromType(ConstantStatus.FROM_BACK);
String orderNo = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER + StrUtil.trimToEmpty(basicBussinessTypeEntity.getPrefix()), "yyyyMMdd"));
outOrder.setBillNo(orderNo);

@ -215,6 +215,7 @@
inner JOIN basic_products
ON basic_products.uuid = basic_udirel.uuid
left join company_product_relevance
on basic_udirel.id = company_product_relevance.udiRlIdFk
left JOIN basic_corp on basic_corp.erpId = company_product_relevance.customerId
left join basic_hosp_type bht on basic_udirel.relCode = bht.code
left join thr_products tp on tp.code = basic_udirel.mainId

@ -70,7 +70,7 @@
AND inCodeStatus = #{inCodeStatus}
</if>
<if test="relKey != null">
AND relKey = #{relKey}
AND relKey like concat('%', #{relKey}, '%')
</if>
<if test="filterSelected != null and filterSelected == true">
AND io.preInSelected is null
@ -241,7 +241,7 @@
AND inCodeStatus = #{inCodeStatus}
</if>
<if test="relKey != null">
AND relKey = #{relKey}
AND relKey like concat('%', #{relKey}, '%')
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND date_format(createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and
@ -571,7 +571,7 @@
AND io.inCodeStatus = #{inCodeStatus}
</if>
<if test="relKey != null">
AND io.relKey = #{relKey}
AND io.relKey like concat('%', #{relKey}, '%')
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND date_format(io.createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d')

Loading…
Cancel
Save