1.修复建垛时,ID未置空导致数据无法插入问题

master
x_z 2 years ago
parent f23ac75a8e
commit 774155618b

@ -32,4 +32,5 @@ public interface StackOrderDao extends BaseMapper<StackOrder> {
* @return
*/
Integer selectId(@Param("orderId") String orderId, @Param("customerId") Long customerId);
}

@ -16,7 +16,7 @@ import java.util.Date;
@TableName("stack_order")
public class StackOrder {
@TableId(type = IdType.AUTO)
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**

@ -51,6 +51,7 @@ public class StackCodeService {
stackCodeEntityList.forEach(stackCodeEntity -> {
UdiEntity udi = FilterUdiUtils.getUdi(stackCodeEntity.getCode());
BeanUtil.copyProperties(udi, stackCodeEntity);
stackCodeEntity.setId(null);
mapper.insert(stackCodeEntity);
});
batchSession.commit();

@ -80,13 +80,12 @@ public class StackOrderService {
if (null == stackOrderEntity.getCreateTime()) {
stackOrderEntity.setCreateTime(new Date());
}
stackOrderEntity.setId(null);
stackOrderDao.insert(stackOrderEntity);
return stackOrderEntity;
}
public void deleteById(Integer id) {
//查询此垛的垛号
String orderId = stackOrderDao.selectOrderIdById(id);
//删除垛数据
stackOrderDao.deleteById(id);
//删除关联的条码数据
@ -219,4 +218,5 @@ public class StackOrderService {
Integer id = stackOrderDao.selectId(orderId, customerId);
return stackCodeDao.selectListByOrderIdFk(id);
}
}

@ -19,4 +19,5 @@
where orderId = #{orderId}
and customerId = #{customerId}
</select>
</mapper>
Loading…
Cancel
Save